OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 03 Sep 2003, 18:50:51

Title: " X_ switchlight "off" " crashes to desktop?
Post by: The-Architect on 03 Sep 2003, 18:50:51
The-Architect here,

I just put switchlight off command into a trigger and flashpoint crashed to desktop. It does it every time!

I have an M2 Machinegun east (empty), and a nva soldier (moveingunner m2),
and I've tried the command in both init fields and with a trigger.

Is there another way to have the light off?

 :-[
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: oyman on 03 Sep 2003, 19:04:01
i think the code is this

" x switchlight off" x = the soldiers name

or put the soldiers behaviour to stealth like this

x setbehaviour "stealth" x = the soldiers name

i think
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: deaddog on 03 Sep 2003, 19:45:02
You cant turn off the light on the M2.

Switchlight is for steetlamps.  The correct usage is:

(object xxxxx) swithlamp "on/off/auto"

where xxxxx is the object id of the streetlamp.

Sucks, doesn't it :)
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: SheepOnMintSauce on 03 Sep 2003, 19:53:28
Yep, that's true. I tried it with a truck to turn the lights on, and if Flashpoint didn't crash on me, the truck became dammaged and useless.  ::)
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: LCD on 03 Sep 2003, 22:59:21
actualy dere was a script 2 make da MG turn its lights off  ;D

use search function - nd if u dont find it ill do ;)

bout da switchlight - as deaddog said - 4 streetlamps only

LCD OUT
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: The-Architect on 04 Sep 2003, 01:18:48
I tried the setbehaviour "stealth" command and still nothing. Check how I've set the guns up (seperated man from gun). Also I can't find the script anywhere either.   :-[
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: LCD on 04 Sep 2003, 02:04:53
check da next thread

http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=9854;start=0

answer is dere somwere ;)

LCD OUT
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: B-2-0 on 04 Sep 2003, 02:51:14
;Lightoff.sqs
#Loop
_this select 0 action ["Light Off"]
~0.01
goto "Loop"



Name your M2 say....M2 :P

Activate the script by typing M2 exec "Lightoff.sqs" in the init.sqs or [this] exec "Lightoff.sqs" in the M2's init field
Title: Re:" X_ switchlight "off" " crashes to desktop?
Post by: Komuna on 09 Sep 2003, 04:28:25
;Lightoff.sqs
#Loop
_this select 0 action ["Light Off"]
~0.01
goto "Loop"



Name your M2 say....M2 :P

Activate the script by typing M2 exec "Lightoff.sqs" in the init.sqs or [this] exec "Lightoff.sqs" in the M2's init field

Hmmm... Why should you type different argument type for the same script...? It wouldn't work!
Cuz at the init.sqs you'd have an object - 'M2' - and at the M2's initField you'd have an array - '[this]'.
Therefore you should use the argument 'this' (the object) at the initField or keep the init.sqs syntax as it's shown and modify your script into the following:

;Lightoff.sqs
#Loop
_this action ["Light Off"]
~0.01
goto "Loop"