Page 1 of 1

infinite loop probem.

Posted: Thu Jun 28, 2007 2:37 pm
by mohaakilla51
OK, this is the first map i have ever made and I based my script off of the Objectives tutorial by AL. It keeps telling me I have an infinite loop because I have:

Code: Select all

main:
...
thread test_enter
...
end

test_enter:
while!(isTouching enter)
{
wait 1
}
$light show
end
but the only problem is I know f no other wa to code this because if I take out the while loop then it only checks it once and never again. Is there anyway to do this without the While loop?

Posted: Thu Jun 28, 2007 7:52 pm
by jv_map
Hmmm I'm quite surprised that code does anything at all :? , but there's no possibility of an infinite loop in there....

Posted: Thu Jun 28, 2007 8:27 pm
by ViPER
i think it does because


"!"(regardless of argument)

Posted: Thu Jun 28, 2007 8:50 pm
by mohaakilla51
well crap... make me feel stupid wont you :oops:
so how would I code that then, I have the dynamic light set up and I have the $light hide set up, i just want it to show the light when I enter a certain room... how would I do this then?

Posted: Thu Jun 28, 2007 9:20 pm
by ViPER
try a light switch

look at my "lighswitch.pk3" demo here -

http://recyclingbin.mods-r-us.net/seiten/misc.html

Posted: Thu Jun 28, 2007 9:25 pm
by mohaakilla51
Here let me Quote myself
MOHAAkilla51's sig wrote:Noob MOHAAmapper, scripter
could you explain that please, or tell me how to do it with a regular .scr file. I would prefer to be able to do it in the .scr file for now however...[/quote]

Posted: Thu Jun 28, 2007 10:27 pm
by ViPER
Take a look - The light is fully scripted to enhance the map. the trigger, the switch model and the light is all scripted.

the hanging lamps are mapped but you could script those too.