Reaper_Man, on 08 November 2022 - 05:01 AM, said:
If you want to get the current counter value outside of ifcount (some other if statement, a switch, etc.), then you can use .htg_t 0 to retrieve it. I can sort of understand if this is before .htg_t was implemented.
ifcount 33 state somecode ifge sprite[].htg_t 0 33 state somecode
These 2 behave identically.
switch sprite[].htg_t 0
{
case 33
state somecode
break
}
endswitchThis is one example of examining the actor counter directly, outside of ifcount.
i think it was a case of overthinking.
useractor notenemy LOCKPLAYER
cstat 32768
getactor[].hitag FOUNDHITAG
// ifpdistl 1024 // remove remlines to make it non global!
{
setvar ONPARA 1 // gamevar ONPARA triggers a lockplayer situation wich was initially used for a descending with a "parachute" type of thing, but it works just as well when the player is already on the ground.
/*
ifcount 1 {
addvar COUNT 1 // the original "timer"
resetcount
}
*/
add COUNT 1
ife FOUNDHITAG COUNT { setvar ONPARA 0 killit }
else
ifcount 10240 { setvar ONPARA 0 killit } // used to kill the actor after a specific time in case HT wasnt set.
}
enda
for completionists sake, here is the actual onpara setting, this goes into the APLAYER code
ifvare ONPARA 1 { setp[].movement_lock 15 setp[].weapon_pos 20 } // if on parachute, dont move forward back or to the side and lower the weapon
else
ifvare ONPARA 0 { setp[].movement_lock 0 } // when on the ground give the player back controll.
and the gamevar itself
gamevar ONPARA 0 1 gamevar COUNT 0 2 gamevar FOUNDHITAG 0 2

Help
Duke4.net
DNF #1
Duke 3D #1


