OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NecorB on 14 Aug 2005, 15:52:33

Title: Need help with StreetLamps!!!
Post by: NecorB on 14 Aug 2005, 15:52:33
I want to use streetlamps in a night mission added trough the editor - not using already placed streetlamps.  I want several lamps to turn "on" when enemy is spotted - the enemy spotted part is no problem.

My problem is this: The streetlamps simply wont turn "on"!

IÂ've read following

Inflaming Lighthouses (Beginner)
(Submitted by: Credits: Icarus_uk)

and a bunch of other scripts but light just wont go "on"...

/NecorB

Title: Re:Need help with StreetLamps!!!
Post by: Planck on 14 Aug 2005, 16:06:37
You can turn on editor placed streelamps with:

nameoflamp switchlight "on"

However, the light source will appear half way up the lamppost instead of at the top.
This is because the streetlights were only meant to be embedded in .wrp files and BIS probably didn't think people would want to place them via the editor.....maybe.

Anyway there are streetlight addons available that use the 'fire' simulation instead of the 'streelamp' simulation.
These are usually turned on using:

nameoflamp inflame true

I don't have a link for you, but try ofp.cz or another favourite website.


Planck
Title: Re:Need help with StreetLamps!!!
Post by: bored_onion on 14 Aug 2005, 16:15:58
Quote
This is because the streetlights were only meant to be embedded

couldnt you setpos them lower?
Title: Re:Need help with StreetLamps!!!
Post by: Planck on 14 Aug 2005, 16:35:24
Quote
couldnt you setpos them lower?

Not really, the light source is attached to the model.

So if you set half the model underground then the light source would presumably be on the ground.

I think.


Planck
Title: Re:Need help with StreetLamps!!!
Post by: NecorB on 14 Aug 2005, 16:47:44
thanks for answers.

The line, nameoflamp switchlight "on", works but second time I "preview"
the mission from the editor OPF crashes! Not even a error message appear.?!

I tried using this line

this setpos [getpos this select 0, getpos this select 1, (getpos this select 2) + 1]

in the lamp init filed to raise the light but also this time OPF crashes with no error message.
Same thing happens when placed in trigger.


From this text/script
Inflaming Lighthouses (Beginner)
(Submitted by: Credits: Icarus_uk)

I tested this line

This Inflame TRUE; This Setpos [Getpos logic select 0, getpos logic select
1, (getpos logic select 2) +5]

The line "This Inflame TRUE" dont even light the lamp, and if I change it to "nameoflamp switchlight "on", again the game crashes.

Any ideas someone?
Title: Re:Need help with StreetLamps!!!
Post by: Raptorsaurus on 14 Aug 2005, 17:22:29
"Setposing" them lower will make the light also go lower, so the light still ends up being below the "bulb" of the lamp.

Attached is a streetlamp addon that uses the BIS models, but just reconfigured so that they light by flame with no smoke (use:  <this inflame true> to turn on and <this inflame false> to turn them off.   The only problem is they do not turn on/off automatically with day/night, but for your application that should not matter.  I do not remember where I got the addon, so whoever the author is, sorry for not crediting you.  There is a nice assorment of colors, white, yellow, red, blue.  I used the red in a mission where I scripted it to blink on and off in unison with the alarm ringing of a trigger (also west detected by east),  I put the trigger right near the light.  Let me know if you want to use that script and I will dig it up for you.  Anyway, the zipped file attached is the streetlamp.pbo.  I hope is helps you.
Title: Re:Need help with StreetLamps!!!
Post by: NecorB on 14 Aug 2005, 18:51:21
The addon for red, blue, yellow lamps etc I allready have...the problem with that is its not streetlams, its airplanes á la Boeing(?!). Have never understood why. However, as long I cant get the lamps to turn on at right alltude it doesnt really matters.

-> Raptorsaurus! If you still have the mission you speak of I would gladly take a lock at it.  Maybe I see something IÂ've missed (it also sound like a great mission to play)
Title: Re:Need help with StreetLamps!!!
Post by: Tomb on 14 Aug 2005, 22:15:46
if ya need to paint them hostile troopers with white, try the "MTH_Spot" or alike ::) ;D

if nothing else works - make the crap in daylight!  ::) ;D (lmao)
Title: Re:Need help with StreetLamps!!!
Post by: Mikero on 15 Aug 2005, 02:24:52
Planck is giving you the best info here.

If you use switchlight "on", ofp will crash.

you need an addon, any addon, that has modified the streetlamps to have 'camp fires' and actions.

there are many of them available. The most popular are

streetlamps.pbo

and

AEF_reallights.pbo

you can get them  here (http://http:/andrew.nf/ofp/addons/) on the beta hosting site, OR you can use my  EditorUpate102  (http://andrew.nf/ofp/addons/MikerosEditorupdate102V3.01.zip) which already has these 'features' attached to many objects that have 'lights'

the 'correct' usage for these lights (whether from my Editor102, or the others) is

[this] inflame true/false

with the above editor you can put it in the init field.

an unfortunate 'feature' of all these lights addons, as good as they are, is that the use the fire simulation. Thus you will get lots of 'flickering' no matter what you try.