Home   Help Search Login Register  

Author Topic: static flare trap (not fire)  (Read 579 times)

0 Members and 1 Guest are viewing this topic.

Bedlam

  • Guest
static flare trap (not fire)
« on: 03 Mar 2003, 06:04:48 »
first of all  .. im a noob at scripting.. ;)

ive tested the flare traps on this site and they dont do it for me..
since im making a realistic coop with the things that the army have.

I need a triggered static flare that is possible change lifespan on.

anyone that can help me with this?

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:static flare trap (not fire)
« Reply #1 on: 03 Mar 2003, 07:38:21 »
I've solved this by setting some upwards velocity to the flare and created a new flare to the same place just before the first one burns out. Too bad I'm not at my home computer right now and don't have the script with me but here's a rough estimate of what you need for this.

What you need is a loop script.

;script start bookmark

_count = 0
#start

;create a flare to position where gamelogic 'gl1' is

?_count < 1: _flare1 = "flarered" camcreate getpos gl1

;create a new flare where count is exactly 340

?_count == 340: _flare1 = "flarered" camcreate getpos gl1

;loop bookmark

#loop

;increase count with 1

_count = _count +1

;set upwards velocity to the flare1

_flare1 setvelocity [0,0,1]

;set time to wait. adjust this time to make the flare stabile.

~0.05

;go to 'start' to create a new flare when count is 339
?_count == 340: goto "start"

;exit script when count is 680
?_count == 680: exit

;go to bookmark 'loop'

goto "loop"




I know this is bad editing but hey, what ever makes it work ;)
Using the counter because the script waits for 0.05 seconds before starting all over again and a flare burns for 17 seconds. Thus 340*0.05=17seconds and 680*0.05=34seconds.
Believe me it looks much better the way I have it at home  :P ;D
« Last Edit: 03 Mar 2003, 09:22:17 by Artak »
Not all is lost.

Bedlam

  • Guest
Re:static flare trap (not fire)
« Reply #2 on: 03 Mar 2003, 09:12:28 »
thx for the reply  :)

ive used your script and added a game logic "gl1"
and a trigger that "[] exec "flare.sqs"

was that right?

cause it wont work? :-\

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:static flare trap (not fire)
« Reply #3 on: 03 Mar 2003, 09:19:11 »
lol  ;D :-\

What's the error it gives?

ok I noticed at least 1 error in the script. I didn't reset the count to 0. I have now updated the script above ^
« Last Edit: 03 Mar 2003, 09:20:23 by Artak »
Not all is lost.

Bedlam

  • Guest
Re:static flare trap (not fire)
« Reply #4 on: 03 Mar 2003, 10:02:12 »
it works now

how do u setpos Z axis only?


like  "gl1 setpos [0,0,2]" but  without the x,y ...

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:static flare trap (not fire)
« Reply #5 on: 03 Mar 2003, 10:24:08 »
for example you can type this in the gl1's init field

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

and your gamelogic is now in 10 meters height.
Not all is lost.

Bedlam

  • Guest
Re:static flare trap (not fire)
« Reply #6 on: 03 Mar 2003, 10:38:47 »
TY alot m8

its starting to make some sense now..  ;)