Jump to content

Problem with CastImmediateOnSelf/Timer/Actor Effect


SHAD0WC0BRA

Recommended Posts

Hey there. I'm trying to create a script for a Base Effect which I will then use in an Actor Effect to apply a different Actor Effect. The idea is to have an effect that will wait 8 seconds and then either apply or not apply based on random chance. Here is my script as it is presently (this script is using only the built in GECK functions):

 

scn BarkScorpionParalysisSCRIPT

float timer

begin ScriptEffectStart
if GetRandomPercent > 75
if timer < 8
set timer to timer + GetSecondsPassed
else
CastImmediateOnSelf BarkScorpionParalysis
set timer to 0
endif
endif
end

 

I have this script attached to a Base Effect. I have set the flags Hostile, Self, Touch, and No Magnitude. On the Actor Effect, I have chosen this Base Effect and set it to zero duration/magnitude/area and to range "Self."

 

Here is some additional information to make sure I haven't messed anything else up. This is a paralysis effect, and I've created a paralysis base effect with the flags Hostile, Recover, Self, Touch, and Target. This base effect is tied an actor effect that you see in the above script called "BarkScorpionParalysis." I have it set to 100 Magnitude, 5 Duration, 0 Area, and range "Touch" (it's the same as another mod with paralysis that I've made, so I figured that would work).

 

Also, does anyone know why bark scorpions seem to poison themselves and die sometimes with my mod? I have all the ranges on the actor effects just like in the vanilla game, and they're definitely inflicting poison on me...

Edited by SHAD0WC0BRA
Link to comment
Share on other sites

Just for starters ... you can't make a timer work in a 1 frame block.

You need to use "ScriptEffectUpdate" for continuous reading.

 

And it looks like you want to have a "No Magnitude" for paralysis ... since it is basically just on/off ?

 

Why scorpions are poisoning themselves ?

According to this script ...

scn BarkScorpionPoisonEffectSCRIPT

float timerEffect
ref myself

begin ScriptEffectStart

set myself to GetSelf

if myself == player
;ShowWarning "Poisoned by bark scorpion!"
float randomTime
set randomTime to 5.0 + 20.0/99.0 * GetRandomPercent
set timerEffect to randomTime
ShowMessage FixerDizzyMsg
endif

end

begin ScriptEffectUpdate

set myself to GetSelf

if myself == player
if timerEffect <= 0
ApplyImageSpaceModifier BarkScorpionPoisonISFX
set timerEffect to 5.0 + 20/99.0 *GetRandomPercent
else
set timerEffect to (timerEffect - GetSecondsPassed)
endif
endif

end

 

 

It is using a variable "MySelf" to make sure it is only the player.

But notice , this effect is just a visual , and does no actual damage.

So you may want to split up particular pieces into multiple base effects , and try to keep it simple with what flags they use. Because I think to many flags can confuse it depending on what your doing ? IDK really , but dealing with effects can get confusing pretty fast imo ... hence I tend to try to keep it simple.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...