OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pazuzu on 24 Jun 2005, 23:44:14
-
I've got a problem with a mission I'm making on Nogova island. I have all the lights switch off & if I go to restart mission, the light are still off. I've heard of this problem before but I'm not sure how to deal with it...
I tried switching lights back on with init.sqs & that works but if I go to a different mission after switching lights off that doesn't do me any good.
I then tried using exit.sqs to turn them back on but it didn't work.
I put these commands in both init & exit.sqs:
(object 18) switchLight "ON"
(object 161) switchlight "ON"
(object 14121) switchlight "ON"
(object 173887) switchlight "ON"
Thanks.
-
Have you tried "AUTO" instead?
Planck
-
This is just a shot in the dark, but what if you ran a seperate script with something like this:
#Loop
?time <= 2: goto "LightOn"
~1
goto "Loop"
#LightOn
object 18 switchlight "ON"
object 161 switchlight "ON"
object 14121 switchlight "ON"
object 173887 switchlight "ON"
goto "Loop"
Syntax not guarenteed
-Student Pilot
-
Ok, this would turn them back on I guess but how do I run this and at what point in the mission.
I mean would I just call the scipt from end trigger? So lights are turned back on before mission ends?
They have to be turned back on no matter how the mission ends(win or lose).
Do you know about exit.sqs?
I read it works like init.sqs but is activated at end of mission...
Does it work in MP?
Thanks for reply.
-
This is just a shot in the dark
;D ;D
-
hehe...this is seriuos business...
-
This is just a shot in the dark
;D ;D
Lol, I didn't even realize I said that, please forgive me ;D
Ok, this would turn them back on I guess but how do I run this and at what point in the mission.
Just run the script from the beginning. When the mission is reloaded or restarted the time varibale is set to 0. The script recognizes this and, when the mission is reloaded, it automatically turns the lights back on. Then the script starts itself over so if the mission is reloaded again, it turns the lights back on again.
Do you know about exit.sqs?
I read it works like init.sqs but is activated at end of mission...
No, I don't know much about it. But I think the reason it isn't working for you is when the mission is reloaded, it isn't considered the end of the mission. Then end of the mission comes when an end trigger fires.
Does it work in MP?
I have no clue, I'm in the dark when it comes to mp scripting (I'm sorry, I couldn't resist ;D)
-Student Pilot
-
Thanks Student Pilot, your script worked perfectly.