infinite loop probem.

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
mohaakilla51
Private
Posts: 8
Joined: Thu Jun 28, 2007 2:18 pm

infinite loop probem.

Post 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?
Noob MOHAA Mapper, Scripter, Player :P
ignore my extravegant use of ellipses... I just have an addiction to them when typing... I use them more that commas.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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....
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

i think it does because


"!"(regardless of argument)
mohaakilla51
Private
Posts: 8
Joined: Thu Jun 28, 2007 2:18 pm

Post 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?
Noob MOHAA Mapper, Scripter, Player :P
ignore my extravegant use of ellipses... I just have an addiction to them when typing... I use them more that commas.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

try a light switch

look at my "lighswitch.pk3" demo here -

http://recyclingbin.mods-r-us.net/seiten/misc.html
mohaakilla51
Private
Posts: 8
Joined: Thu Jun 28, 2007 2:18 pm

Post 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]
Noob MOHAA Mapper, Scripter, Player :P
ignore my extravegant use of ellipses... I just have an addiction to them when typing... I use them more that commas.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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.
Post Reply