Y origin calculation?
Moderator: Moderators
i was thinking, i'm using if (isalive($player[local.p]) if it wouldn't be better to use while (isalive $player[local.p]
the if statement if only accessed while checking, if i add a while for each player, it scans all the time, or am i wrong in this ?
besides that 32 while loops, would that give a high server load ?
what you think is the best? while or a trigger ?
the if statement if only accessed while checking, if i add a while for each player, it scans all the time, or am i wrong in this ?
besides that 32 while loops, would that give a high server load ?
what you think is the best? while or a trigger ?
[VS-UK]Maj.OddBall[BnHQ]
ok, after some searching i added this to my script
and:
So this means it spawned triggers for every player.
now the question,
how can i get the state of the trigger in an "if" statement?
something like : if trigger = 1 bla bla bla..
if possible, i don't want to use the waittill trigger
Code: Select all
start:
for (local.h = 1; local.h <= $player.size; local.h++)
{
level.num = int(local.h)
thread playertrigger $player[local.h]
}
end
Code: Select all
playertrigger local.player:
level.trigger[level.num] = spawn trigger_use
level.trigger[level.num].origin = $player[level.num].origin
level.trigger[level.num] setsize ( -50 -50 -50 ) ( 50 50 50 )
level.trigger[level.num] glue local.player
end
now the question,
how can i get the state of the trigger in an "if" statement?
something like : if trigger = 1 bla bla bla..
if possible, i don't want to use the waittill trigger
[VS-UK]Maj.OddBall[BnHQ]
You will have to use waittill trigger I'm afraid
... however it's quite easy to work-around it:
With this bit of code you can do neat things, i.e. call the watchtrigger thread once and after that you can simply do:

Code: Select all
$mytrigger thread watchtrigger
// ---
watchtrigger:
self wait 0.05 // trigger every frame
while(self)
{
self waittill trigger
self.lasttriggertime = level.time
}
end
isbeingtriggered:
end (level.time - self.lasttriggertime <= 0.10)
Code: Select all
if ($mytrigger waitthread isbeingtriggered)
{
// etc
}

