Home   Help Search Login Register  

Author Topic: A "GET_OUT" Trigger  (Read 755 times)

0 Members and 1 Guest are viewing this topic.

Offline CYRIUS

  • Members
  • *
  • I'm a llama!
A "GET_OUT" Trigger
« on: 10 Sep 2004, 02:43:34 »
Im rather new to OFPEC, and I know the most basics of editing and i have been searching for answears to a trigger.

I have a MAN driving a CAR along the road. If hes car is damaged or destroyed he will leave the car and continue on foot.
So i want a trigger to activate if he EXITS the car, so the player will be notified
if that happends. Or so i can activate some other fancy thing with the trigger.

ANYONE HAVE A SUGESTION?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:A "GET_OUT" Trigger
« Reply #1 on: 10 Sep 2004, 05:17:24 »
so what u basicly need is the condition of the triger ? not a poblem

not (unitname in carname)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline CYRIUS

  • Members
  • *
  • I'm a llama!
Re:A "GET_OUT" Trigger
« Reply #2 on: 10 Sep 2004, 10:49:43 »
Eeee, Thanks.
That was easy.

Red Ant

  • Guest
Re:A "GET_OUT" Trigger
« Reply #3 on: 10 Sep 2004, 11:49:36 »
Will that always work, though? I mean the dude might also leave the car temporarily because he's under attack, but the car might still be in perfect condition.

olseric

  • Guest
Re:A "GET_OUT" Trigger
« Reply #4 on: 10 Sep 2004, 13:24:02 »
Well, if you want it only if the car is shot up...

? damage yourcarname > 0.9:stuff you want here

That'll check to see if the car is driveable.  You may have to fiddle with 0.9 to find the actual damage level that the car is non-driveable.

PsyWarrior

  • Guest
Re:A "GET_OUT" Trigger
« Reply #5 on: 10 Sep 2004, 13:50:20 »
Greetings,

Actually, OFP already comes with a command to check if a unit is non-drivable: canMove.

So
? canMove _unit: _yourCode = "here"
Would be a better solution than checking for a certain damage threshhold.

Quote
the dude might also leave the car temporarily because he's under attack
This should not happen. A unit should only disembark from a vehicle:
-When ordered to.
-When the vehicle is no longer able to move.

LCD's solution will work.

-Supr. Cmdr. PsyWarrior
-Psychic Productions

Red Ant

  • Guest
Re:A "GET_OUT" Trigger
« Reply #6 on: 10 Sep 2004, 13:54:39 »
Well yeah, but if he's the only guy in his group then he may essentially "order himself" to disembark and fight, no?

PsyWarrior

  • Guest
Re:A "GET_OUT" Trigger
« Reply #7 on: 10 Sep 2004, 14:03:55 »
Quote
Well yeah, but if he's the only guy in his group then he may essentially "order himself" to disembark and fight, no?

If a unit is in a vehicle, he will try to drive on (if the vehicle is unarmed), or will engage with the vehicle's weapons.

Unless he is given a specific order by a player commander, or through scripting (for example, using a HIT eventHandler to detect when the unit is under attack, and then ordering the unit out), which overrides the default behaviour. I have never seen the driver of an unarmed vehicle stop and disembark to engage the enemy of his own volition when he comes under attack. He usually just drives on, and gets shot through the windscreen... ::)

But maybe I just don't spend enough time playing with unarmed vehicles :P
Certainly, when the driver of a repair/ rearm truck or M113 ambulance comes under attack when on a support mission, they just keep driving towards the group they are on their way to support.

-PsyWarrior

Red Ant

  • Guest
Re:A "GET_OUT" Trigger
« Reply #8 on: 10 Sep 2004, 14:06:05 »
Hmmm, coulda sworn I had seen some truck drivers jump out and fight ... but I'll just take your word on that.  :P

PsyWarrior

  • Guest
Re:A "GET_OUT" Trigger
« Reply #9 on: 10 Sep 2004, 14:15:39 »
Quote
Hmmm, coulda sworn I had seen some truck drivers jump out and fight
It is possible. As I said, it could be scripted. If you saw it in one of the campaigns or missions, chances are that it was a scripted reaction to a scripted attack...

Or if you saw it in the mission editor, ignore... :P
It could be, of course, that an enemy unit had a lucky shot, and hit the tyre of the truck...

-PsyWarrior

Offline CYRIUS

  • Members
  • *
  • I'm a llama!
Re:A "GET_OUT" Trigger
« Reply #10 on: 10 Sep 2004, 14:22:42 »
Thanks for all the good advice and tips all, they will come in handy. I used the tip i got from LCD. And now the MAN wil drive the car following the waypoints even if he is attacked.
If the car is disabled then he leavs the car and begins to fight.

I set the trigger to activate General Barrons "Surrender AI script"
So when the car is disabled the MAN disembarks the car and eder flee, fight or surrender randomely.
A good Script. :)