Home   Help Search Login Register  

Author Topic: Trigger synchronization  (Read 459 times)

0 Members and 1 Guest are viewing this topic.

Offline AirCav

  • Members
  • *
  • I'm a llama!
Trigger synchronization
« on: 10 Jan 2005, 03:01:16 »
Ok a couple questions:

1.  I have a waypoint with more then one trigger synchronized to it.  How do I set it up so that the tripping of any one of the triggers synchronized to that waypoint will release it?

2.  I have multiple triggers on a road that I want to keep unarmed until a single trigger gets tripped.  How do I accomplish that?

3.  How do I make a vehicle (a VBIED) to execute an explosion script if it's damage falls below a certain level?  Is that a trigger or a code in the vehicle's Init field?

Again, thanks for all the help.  I'm in Iraq and haven't had the online time to hit all the tutorials.  I'm trying to creat a mission that reflects some of our my convoy experiences.  You guys can get me back whe I release the mission for beta testing.

-air

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Trigger synchronization
« Reply #1 on: 10 Jan 2005, 05:18:23 »
1) when any trigger is activated, make a boolean true, and have for the activation of all of them:
whatever conditions you want ||(means or) thatBoolean

2)when the one trigger gets tripped, make a boolean true, and on the others relying on it:
your conditions && thatBoolean

3)trigger:
condition: getdammage vehicle >= <dammage limit>
on activation:[vehicle] exec "Kaboom.sqs"


and cheers to you for serving in the military. Good luck with OFP and Iraq  ;)

Offline AirCav

  • Members
  • *
  • I'm a llama!
Re:Trigger synchronization
« Reply #2 on: 10 Jan 2005, 05:38:03 »
Hey Trig,

Thanks for the help.  OFP has really made the time fly by here as I try to figure out the inns and outs of the game.  Plus, there's nothing like self induced flashbacks!

Ok, onto business.  I should mention i'm using an antiquated version 1.46.  I can't find Resistance anywhere and it'll take two months to order it.  Anyway to D/L it?

1 & 2.  Your talking above my head.  Boolean?  Where is that option?  I'll try looking it up.

3.  Is this right? getdammage carbomb >= <0>  I get an Ínvalid number in expression error.  Also, does it matter if the car started as an empty object and I had the driver load it later?  

thanks again
-Air
« Last Edit: 10 Jan 2005, 05:40:37 by AirCav »

Rokket

  • Guest
Re:Trigger synchronization
« Reply #3 on: 10 Jan 2005, 06:14:45 »
For #2 There's a good script for blowing up a convoy truck that is activated like triggerhappy's code, but done in the init.sqs - this may cause more lag, I don't know if there's any diff between starting it in the init and in a trigger, maybe better. It works because Ii had fun playing with it. This is the code to put in an init.sqs file (the first script initiated when game starts, can be just a text file saved as "init.sqs":)
=====
INIT FILE
@(getdammage ammotruck>0.02)
[ammotruck] exec "bigammoexplosionwg.sqs"
exit
======
The script is:

;// Ammo Explosion Script
;// by Rubble_Maker, Rubble_Maker@gmx.net
;// shortened by Rocket (for anti-lag)

_obj= _this select 0
_pos=getpos _obj

?getdammage _obj>=1:goto "skip_foreplay"

_BOOM = "mortarshell" camCreate (getpos _obj)
_obj setdammage 1

#skip_foreplay

;// now the crap hits the fan. Growing explosions plus more and more rockets...

_rndproj=["mortarshell","mortarshell","HEAT120""LaserGuidedBomb","mortarshell","HEAT120"]
_interval=50
_c1= _interval
_c2=50
_total_cycles= 0
#l1
   _c1= _c1 - 1
   ?_c1==0:_interval=_interval-10; _c1=_interval;_BOOM = (_rndproj select (random 5)) camCreate (getpos _obj);_total_cycles=_total_cycles+1
   _c2=_c2-1
   ~0.008
   ?_total_cycles<5:goto "l1"

;// Pop some big explosions with increasing intensity

_intensity=5
_vel=30

#l2
   _c=_intensity
   #bigexplosions
      _pos=(getpos _obj)
      _BOOM = "barrel1" camCreate [(_pos select 0),(_pos select 1),0]
      _BOOM = (_rndproj select (random 5)) camCreate _pos
      ?random 5>4:_BOOM = "HEAT120" camCreate _pos
      _c=_c-1
      ?_c>0:goto "bigexplosions"
   
   ~1
   ?random 2>1:_BOOM = "mortarshell" camCreate (getpos _obj)
   ~0.5
   ~random 1
   _intensity=_intensity+5
   ?_intensity<20:goto "l2"
_BOOM = "LaserGuidedBomb" camCreate (getpos _obj)
   
EXIT
==========
I can't find the orig script but am pretty sure it's on OFPEC under scripts. .It has more particles and flares and doohickies, but I didn't think necessary, it's a fine explosion as it is. Just makea truck called "ammotruck" (or change the name in init and script)

#1 - Boolean just means True/False. So you could do this:

Trig 1 ONActivation: go=true
Trig 2 OnActivation: go =true
WayPoint: CONDITION: go

You wouldn't need to synch or group, just let the variable do the job: when either trigger is tripped it makes the variable "go" active ("true"), and that is the condition for the waypoint. I do this alot to hold a group until an event happens. Synching is good too, but multiple works well this way.

v 1.46 - You can download upgrades up to 1.96, but I think you need Res to bridge the 1.46-1.75 gap.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Trigger synchronization
« Reply #4 on: 10 Jan 2005, 21:59:47 »
3) the <> are just there to show you that that isn't a command, but rather a value you change. sorry for the confusion