Home   Help Search Login Register  

Author Topic: Detect flare fired.  (Read 1028 times)

0 Members and 3 Guests are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Detect flare fired.
« on: 06 Nov 2004, 23:50:51 »
Ok, I have an ammo box with a ak74 grenadelauncher and 5 flares in it.
I want a trigger to recognise if the player decides to fire one of these flares.

That means, he has to pick up the ak74GL, take the flares and fire.

Can it be done?

More simply, can I do it?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Detect flare fired.
« Reply #1 on: 07 Nov 2004, 00:06:47 »
Well, it could be done using eventhandlers, and I'm sure someone will describe that for you. However, since EH's aren't available in v1.46, you'll have to do it some other way, if your sig is true. :P

Luckily for you, there is a script that is automatically launched when a flare is fired. It is called onFlare.sqs. You can find out more info on it here:

http://www.ofpec.com/editors/comref.php?letter=3#Event%20based%20scripts
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Detect flare fired.
« Reply #2 on: 07 Nov 2004, 15:37:57 »
No, I recently got 1.96 back. I'll change that now.

Sorry.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Detect flare fired.
« Reply #3 on: 07 Nov 2004, 16:27:55 »
Ok, so I checked the link and had a search for Event handlers.

I found some info and am interested in the onflare.sqs script.

The comand reference just says that it exists and is executed when a flare is fired.

How can this help me?

Also, if an Eveny handler would do the trick how would I go about it?

I saw something on it here but I don't understand it.
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=20266;start=0

It sound exactly what I want. However I'm not sure how to implement it.

Cheers.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Detect flare fired.
« Reply #4 on: 07 Nov 2004, 16:37:57 »
Just write a script called onflare.sqs and it will be run when a flare is fired.

There are at least two arguments returned - colour and firer - so you can script signals.  I've attached the 'onflare.sqs' from 'A Touch of Frost' (shameless advertising, I know) to illustrate. Or should I say illuminate?


Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Detect flare fired.
« Reply #5 on: 07 Nov 2004, 20:25:22 »
Cheers that's really helped.

However more trouble.

I have a flare trap set up in another location.

How can I make sure that the script recognises that its the player that has fired the flare not the flare being fired from the trap?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Detect flare fired.
« Reply #6 on: 07 Nov 2004, 21:05:39 »
Have a line at the beginning of onflare.sqs that checks if _this select 1 is the player; if not exit.  Hopefully, a camcreated flare (if that's how the trap works) won't cause any problems.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Detect flare fired.
« Reply #7 on: 08 Nov 2004, 01:03:55 »
Could you write me a snippet which includes the _this select 1 part, as I dont know the syntax.

Cheers
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Detect flare fired.
« Reply #8 on: 08 Nov 2004, 01:14:58 »
? (_this select 1) != player : exit
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Detect flare fired.
« Reply #9 on: 08 Nov 2004, 17:42:05 »
That worked a treat guys.
Many thanks.  ;D
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."