OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Trajectory7 on 01 Nov 2002, 23:14:17

Title: Nighty Night
Post by: Trajectory7 on 01 Nov 2002, 23:14:17
Hi it'd be great if someone could tell me how to turn specific streetlamps on/off.
I need it to go dark on command at a base where there's a lamp.
Althought this is my first post don't be fooled, i can handle some script, i'm just a bit um ... rusty.

Cheers
Title: Re:Nighty Night
Post by: seanver on 01 Nov 2002, 23:46:24
Well, what I'm gonna tell will only owrk if you have resistance.

If you do, that is what I hope, click on the Show ID butom.

You must know where is the streetlamp, try with the map, putting a unit near, etc. WEll once you have identified the streetlamp, you have to use this command:

object ID switchLight "Off"

ID is the number of the streetlamp. So now, it will be switched off.

If you don't have resistance, I'm afraid I can't help you there.
Title: Re:Nighty Night
Post by: Wolfrug on 02 Nov 2002, 11:20:07
Blargh, resistance is like...like...cheating! ;) Anyhow, haven't got OFP with me, but I think this is about the way to go about it:

figure out the loc of the streetlamp, and then place a game logic on it, name the gl something.
Then create a trigger, condition whatever (suggest you try it out first with just "true" though), and put something akin to this in the on activation field:

lamp=nearestObject[g1, "streetlamp"]; lamp switchLight "OFF"

(g1=name of gamelogic) can't remember the actual object name of the lamp, but I think that was it ;) If it doesn't work, complain. Haven't got OFP with me right now...

Wolfrug out.
Title: Re:Nighty Night
Post by: Trajectory7 on 04 Nov 2002, 00:54:42
thanks