Home   Help Search Login Register  

Author Topic: switching lights back on  (Read 794 times)

0 Members and 1 Guest are viewing this topic.

pazuzu

  • Guest
switching lights back on
« 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.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:switching lights back on
« Reply #1 on: 24 Jun 2005, 23:50:35 »
Have you tried "AUTO" instead?


Planck
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:switching lights back on
« Reply #2 on: 24 Jun 2005, 23:54:00 »
This is just a shot in the dark, but what if you ran a seperate script with something like this:

Quote
#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

pazuzu

  • Guest
Re:switching lights back on
« Reply #3 on: 25 Jun 2005, 00:09:00 »
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.

qqqqqq

  • Guest
Re:switching lights back on
« Reply #4 on: 25 Jun 2005, 00:09:15 »
Quote
This is just a shot in the dark

 ;D ;D

pazuzu

  • Guest
Re:switching lights back on
« Reply #5 on: 25 Jun 2005, 00:17:08 »
hehe...this is seriuos business...

Offline Pilot

  • Contributing Member
  • **
Re:switching lights back on
« Reply #6 on: 25 Jun 2005, 01:12:56 »
Quote
This is just a shot in the dark

 ;D ;D
Lol, I didn't even realize I said that, please forgive me ;D

Quote
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.

Quote
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.

Quote
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
« Last Edit: 25 Jun 2005, 04:28:02 by Student Pilot »

pazuzu

  • Guest
Re:switching lights back on
« Reply #7 on: 25 Jun 2005, 04:55:42 »
Thanks Student Pilot, your script worked perfectly.