Home   Help Search Login Register  

Author Topic: Nighty Night  (Read 895 times)

0 Members and 1 Guest are viewing this topic.

Trajectory7

  • Guest
Nighty Night
« 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

seanver

  • Guest
Re:Nighty Night
« Reply #1 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.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Nighty Night
« Reply #2 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.
"When 900 years YOU reach, look as good you will not!"

Trajectory7

  • Guest
Re:Nighty Night
« Reply #3 on: 04 Nov 2002, 00:54:42 »
thanks