Jump to content

need help with this script


demonocus666

Recommended Posts

Off the top of my head (so untested), try this:

 

 

ScriptName AAAko2min

Float s

Begin ScriptEffectStart

ForceAV Fatigue -1000

End

Begin ScriptEffectFinish

If ( s > 120 )
	ForceAV Fatigue 1000
EndIf

End

Begin GameMode

If s > 120
	Return
Else
	Set s to s + GetSecondsPassed
EndIf

End

 

Link to comment
Share on other sites

Ok, maybe the ScriptEffectFinish is the problem. Try it this way:

 

 

ScriptName AAAko2min

Float s

Begin ScriptEffectStart

Set s To 0
ForceAV Fatigue -1000

End

Begin GameMode

If s < 120
	Set s to s + GetSecondsPassed
Else
	ForceAV Fatigue 1000
EndIf

End

 

Link to comment
Share on other sites

That's odd. Does he get up if you use the forceav command on him (select him first) from the console?
Link to comment
Share on other sites

I'm not sure what scripting language this is but I would think you would do something like I have below.

I'm not even using the variable or function get_time, I just wanted to include it to show how it would look in c++

It would look similar in perl it would just be called a sub instead.

 

*/

int get_time()

{

// function to get time from game

 

}

/*

 

int main()

{

// float time = get_time();

float fatigue = -1000;

float fatigue_inc = 8.3;

float new_fatigue;

int i = 1;

 

 

for (i>0, i<120, i++)

{

new_fatigue=+fatigue_inc;

}

 

return 0;

Link to comment
Share on other sites

The trouble is ScriptEffectStart only runs 1 time, when the spell is casted. It never executes again.

ScriptEffectFinish only runs once the spell ran out and again only does this once.

When ScriptEffectFinish executes is determined by the spell's "duration" and cannot be controlled from inside by a counter or something like you do.

 

I suggest you use the duration of the spell itself instead of a seconds counter inside the script. Make the spell last 120 seconds and ScriptEffectFinish will execute exactly 120 seconds after ScriptEffectStart. You can use ScriptEffectStart to lower the fatigue and then ScriptEffectFinish to raise it up again.

 

If your spell's duration was never set to 120 seconds but less, none of Hickory's solutions ever had even a chance to work, as they all depended on 120 seconds to be passed for the fatigue reset to get executed. In the first one "s" was never > 120 when ScriptEffectFinish executed, and in the second the script terminated (the spell's duration ran out) before "s" got > 120. I don't even know if you can use GetSecondsPassed inside a spell script. I remember inside a ScriptEffect... block it's said to not work at all.

 

And if this was not the script for a spell even but an Object or Quest script, then using ScriptEffect... blocks was futile to begin with.

Link to comment
Share on other sites

The trouble is ScriptEffectStart only runs 1 time, when the spell is casted. It never executes again.

ScriptEffectFinish only runs once the spell ran out and again only does this once.

When ScriptEffectFinish executes is determined by the spell's "duration" and cannot be controlled from inside by a counter or something like you do.

 

I suggest you use the duration of the spell itself instead of a seconds counter inside the script. Make the spell last 120 seconds and ScriptEffectFinish will execute exactly 120 seconds after ScriptEffectStart. You can use ScriptEffectStart to lower the fatigue and then ScriptEffectFinish to raise it up again.

 

If your spell's duration was never set to 120 seconds but less, none of Hickory's solutions ever had even a chance to work, as they all depended on 120 seconds to be passed for the fatigue reset to get executed. In the first one "s" was never > 120 when ScriptEffectFinish executed, and in the second the script terminated (the spell's duration ran out) before "s" got > 120. I don't even know if you can use GetSecondsPassed inside a spell script. I remember inside a ScriptEffect... block it's said to not work at all.

 

And if this was not the script for a spell even but an Object or Quest script, then using ScriptEffect... blocks was futile to begin with.

your suggestion worked kudos to you heres what i did;

scriptname AAAko2min

 

begin scripteffectstart

forceav fatigue -1000

 

end

 

begin scripteffectfinish

forceav fatigue 1000

 

 

end

 

then i set the spell duration to 120 and it worked

Link to comment
Share on other sites

  • Recently Browsing   0 members

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