script ignore line 1st time only
Moderator: Moderators
script ignore line 1st time only
how do i make my script skip out a section of a thread the first time it is run, but have it read every other time it is run.
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
the thread is set by a trigger, it does some stuff and close some doors then opens them later on
but because the game starts with teh doors closed they dont need to close the first time the thread is run, i.e. push a button runs thread.
so i was lookin for a way to tell the script "do not close the doors the 1st time the thread is triggered".
in short, i want this part of my thread ignored the 1st time around, then included in the thread every other time it is triggered
but because the game starts with teh doors closed they dont need to close the first time the thread is run, i.e. push a button runs thread.
so i was lookin for a way to tell the script "do not close the doors the 1st time the thread is triggered".
in short, i want this part of my thread ignored the 1st time around, then included in the thread every other time it is triggered
Code: Select all
if(level.pos != self.floor)
{
$("doors_" + $lift.floor) playsound lift_gate
$("doors_" + $lift.floor) doclose
$left_door moveEast 78
$right_door moveWest 78
$left_door move
$right_door waitmove
level.doorpos = 0
}maybe you could do:
I don't know if that would work, but try it...
Code: Select all
level.skip1sttime = 1
thing:
if(level.pos != self.floor)
{
if(level.skip1sttime == 1)
{
level.skip1sttime = 0
goto thing
end
}
else
{
$("doors_" + $lift.floor) playsound lift_gate
$("doors_" + $lift.floor) doclose
$left_door moveEast 78
$right_door moveWest 78
$left_door move
$right_door waitmove
level.doorpos = 0
}
}-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Yes M&M it will cause an error if you are using the moveEast/moveWest commands. Well not an error as such, but the doors would move too far and become dislaced. If you instead use moveto command you would not have this problem in the first place and the doors would only move to the correct positions.

