Questions regarding Base / Actor Effects

Post » Wed Sep 22, 2010 3:26 pm

Hi,
i have 2 questions regarding base/actor effects. The first question is, how can i apply a actor effect through a script? Here the code from my script:

scn WaterHeal1Menu

int iButton

Begin ScriptEffectStart

Begin GameMod
set iButton to GetButtonPressed
if Button == -1
Return
elseif iButton == 0
[???]
elseif iButton == 1
player.showrecipemenu WaterModPWaterRecipes
endif
RemoveMe
End


At the [???] i want to apply the actor effect WaterHeal1Purified [000B878F] to the player character, how can i do this?

My second question is for a base effect. This effect is a script effect, the effect is added to an ingestible. How can i check if the ingestible, to which the effect was added, is a reference to a ObjectID?
My first try was this:

scn WaterModGenericAddScript

begin ScriptEffectStart
if GetIsID NukaCola
player.additem NukaColaBottle
endif
end


This didn't work. Is is possible to check the object to which the effect is attached?
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am

Post » Wed Sep 22, 2010 9:06 am

At the [???] i want to apply the actor effect WaterHeal1Purified [000B878F] to the player character, how can i do this?
CastImmediateOnSelf (CIOS).

This didn't work. Is is possible to check the object to which the effect is attached?
That script runs on the person consuming the ingestible. You're checking to see if the player is a nuka-cola bottle, which is quite unlikely to be true. You can't get the base form that cast an effect from the effect's script.
User avatar
Life long Observer
 
Posts: 3476
Joined: Fri Sep 08, 2006 7:07 pm

Post » Wed Sep 22, 2010 12:51 pm

Thanks for the info. Is it possible to attach a script directly to the Nuka-Cola that will function? Since all ingestible have the possibility to add a script directly to them, will that work?
User avatar
Jessica Raven
 
Posts: 3409
Joined: Thu Dec 21, 2006 4:33 am

Post » Wed Sep 22, 2010 1:46 pm

Thanks for the info. Is it possible to attach a script directly to the Nuka-Cola that will function? Since all ingestible have the possibility to add a script directly to them, will that work?


If you're looking to add an empty bottle after consuming the water/cola/whatever, the easiest thing to do is do it like the "Add Cap" effect. Base effect that calls a script such as this:

Begin ScriptEffectStart	AddItem NukaColaBottle 1End


(Note the above will add an empty bottle to whomever consumes the Nuka Cola be it the player or an NPC)
User avatar
Sammi Jones
 
Posts: 3407
Joined: Thu Nov 23, 2006 7:59 am

Post » Wed Sep 22, 2010 7:05 am

If you're looking to add an empty bottle after consuming the water/cola/whatever, the easiest thing to do is do it like the "Add Cap" effect. Base effect that calls a script such as this:

Begin ScriptEffectStart	AddItem NukaColaBottle 1End


(Note the above will add an empty bottle to whomever consumes the Nuka Cola be it the player or an NPC)


I was trying to build one effect/script for all adding, but with the limitations of the GECK i will have to build for each item an own effect.
User avatar
Francesca
 
Posts: 3485
Joined: Thu Jun 22, 2006 5:26 pm


Return to Fallout: New Vegas