Script "WaterLevelCheck" (Void)
{
While (TRUE)
{
if ( GetActorProperty (0, APROP_Waterlevel) < 3 && GetUserVariable(0, "user_isswimming")==1 )
SetActorState(0, "Swim.Cancel");
else if ( GetActorProperty (0, APROP_Waterlevel) == 3 && GetUserVariable(0, "user_isswimming")==0 )
SetActorState(0, "Swim.Allow");
Delay(1);
}
}
ACTOR Somerandomshitthatswims
{
var int user_isswimming;
States:
{
Swim.Cancel:
TNT1 A 0 A_ChangeFlag("FLOAT",0)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
TNT1 A 0 A_SetUserVar("user_isswimming",0)
Goto See
Swim.Allow:
TNT1 A 0 A_ChangeFlag("FLOAT",1)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_SetUserVar("user_isswimming",1)
Goto See
}
}
Nash wrote:I'm interested in this too. Would appreciate it if someone posted a bare-bones example. I see MaxEd achieved this in his Powerslave mod but the WAD is too large-scope for me to quickly inspect (yeah I'm impatient LOL).
Spoiler:
Revilution wrote:The problem there Ozymandias81, the delay to check if the actor is under water is too long and causes a bit of "jumping" out of the water, this behavior is the intention on this mainly because a piranha really behaves as this unlike a shark that stays underwater more often, reducing the check delay on the state would solve the problem but this will go make piles of extra lines in the decorate which isn't necessary if there is a script is running on background to do the job it.
Well decision is up to Torm on what code use, both solves the problem i think (as i said above, i didn't tested mine)
Spoiler:
Nash wrote:TBH (and no offense) this is all really hacky shit and it really should be just be an engine-side flag like +CANTLEAVEWATER or something like that. :S
Users browsing this forum: No registered users and 2 guests