OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Serial Killer on 18 Jun 2005, 13:26:46

Title: Light...
Post by: Serial Killer on 18 Jun 2005, 13:26:46
Is it possible to create light somewhere, without any addons, etc.?
Title: Re:Light...
Post by: Planck on 18 Jun 2005, 13:31:38
No, I think you will always need an addon, even if it is only a config which is pbo'ed and placed in the addons folder.

But, I'm willing to be proved wrong   ;D


Planck
Title: Re:Light...
Post by: Serial Killer on 18 Jun 2005, 13:34:44
Well is it possible to create flare on the ground and keep it there?

(Just my idea ;D)
Title: Re:Light...
Post by: Planck on 18 Jun 2005, 14:08:59
I seem to recall that flares go out when they reach the ground, so, I would say no.

But, once again, I'm willing to be proved wrong.


Planck
Title: Re:Light...
Post by: DBR_ONIX on 18 Jun 2005, 14:10:33
Code: [Select]
_where=_this select 0
_i=0

start:
_flare = "Flare" Camcreate getpos _where

loop:
_flare setpos getpos _where
~0.2
_i=_i+1
?(_i>100): goto "start"
goto "loop"

Basicly creates a flare, setpos's it every 0.2 of a second, if it's been there for 0.2*100, make a new one (Play with this value, 100 gives the flare a life-time of 20 seconds, change it to the life of the a flare, so when it is about to burn out, a new flare it made)

called on object, [this] exec "script.sqs", such as a gamelogic
if you want the light at 2m,
Code: [Select]
this setpos [getpos this select 0, getpos this select 1, 2]; [this] exec "script.sqs"
:)
- Ben
Title: Re:Light...
Post by: Serial Killer on 18 Jun 2005, 14:14:33
Thanks! :)
Title: Re:Light...
Post by: bedges on 18 Jun 2005, 14:18:44
sorry to be the one to do it planck sir ;)

flares can be created and then passed to a loop which sets their velocity to 0. keeping them lit is the tricksy part. the loop needs to include a timer which creates another flare in the same place just as the previous flare goes out....

see attached.

edit - heh, beaten to it... ho hum :P
Title: Re:Light...
Post by: Serial Killer on 18 Jun 2005, 14:22:18
Well that script didn't work for me :-\ First I fixed it, because OFP messaged errors about that start and loop things, so my script looks like this now:

Code: [Select]
_where=_this select 0
_i=0

#start
_flare = "Flare" Camcreate getpos _where

#loop
_flare setpos getpos _where
~0.2
_i=_i+1
?(_i>100): goto "start"
goto "loop"

But it isn't still working.

EDIT: I'll try bedge's script first...
Title: Re:Light...
Post by: Serial Killer on 18 Jun 2005, 14:53:01
Well that script was fine, but bad thing is that the flare suddenly falls on the ground and it's dark again :-\ I still would like to test DBR_ONIX's script.
Any way to fix it?

EDIT: Well it works when I place that flare on 100 alt. I'll ask here if I need more help with it...

EDIT: Well that flare stops lighting suddenly :-\
Title: Re:Light...
Post by: 456820 on 18 Jun 2005, 17:23:03
you can turn on light posts around you using the animate command i think (in com ref)
and also using fire's put this in its init field
this inflame true
thats all i know of if none of them are suitable for you im sorry
Title: Re:Light...
Post by: bedges on 18 Jun 2005, 17:32:02
the animate command is for doors. lampposts are controlled using the switchlight command (http://www.ofpec.com/editors/comref.php?letter=S#switchLight).

@serial killer - the problem is that flares take a second or two to light up once created. if you can work out the timing for this, you can stay in the setvelocity loop for just long enough, and have a flare waiting in the wings to replace it.
Title: Re:Light...
Post by: Serial Killer on 18 Jun 2005, 18:25:46
Next two questions:

1. Is it possible to disable sound effects from campfire while it's flaming?
2. Is it possible to disable smoke effects from campfire while it's flaming?
Title: Re:Light...
Post by: bedges on 18 Jun 2005, 18:35:45
most likely on both counts, and it would involve taking the model config to bits.... sort of out of my depth here ;)
Title: Re:Light...
Post by: Planck on 18 Jun 2005, 19:18:38
Quote
1. Is it possible to disable sound effects from campfire while it's flaming?
2. Is it possible to disable smoke effects from campfire while it's flaming?

1.  Apart from switching off your speakers, the only way is to edit the game config.bin......not recommended.

2.  The only way is to edit the game config.bin......not recommended.

There is always the possibility of making a config addon though.


Planck