Home   Help Search Login Register  

Author Topic: any kind of flare  (Read 1049 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
any kind of flare
« on: 20 Jan 2006, 21:08:44 »
Alright i have this scripts which basiccaly creates smoke trails on flares but only works on whit flares how can i get it to work with all flares

the original line
Code: [Select]
?_projectile != "flare" : exit
Ive tried these lines instead none which work

Code: [Select]
?_projectile != "flare" or "flarered" or "flaregreen" or "flareyellow" : exit
Code: [Select]
?_projectile != "flare" or _projectile != "flarered" or _projectile != "flaregreen" or _projectile != "flareyellow" or : exit
Both of them give errors and dont work.
How will i get it to work if any flare is fired?
Cheers

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:any kind of flare
« Reply #1 on: 20 Jan 2006, 21:55:23 »
You are writing in English, not OFP code.     The correct syntax is:-

? (_projectile != "flare") or (_projectile != "flarered") etc

However that will not work, logically.   Take the not outside the brackets.

? not ((_projectile == "flare") or (_projectile == "flarered") etc) : exit


« Last Edit: 20 Jan 2006, 21:58:18 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:any kind of flare
« Reply #2 on: 20 Jan 2006, 22:24:21 »
You could also do this with an array.  This will also allow one to add different flare types (addon flares) very easily by adding those to the array.  Here's how:

Code: [Select]
_flaretypes = ["flare", "flarered", "flaregreen", flareyellow"]
if (not (_projectile in _flaretypes)) then {exit}
or you can put the if-then in short hand
Code: [Select]
? ! (_projectile in _flaretypes) : exit
If someone makes a purple flare called "flarepurple", then that can be added to the array.
« Last Edit: 20 Jan 2006, 22:24:34 by Raptorsaurus »

Offline 456820

  • Contributing Member
  • **
Re:any kind of flare
« Reply #3 on: 20 Jan 2006, 23:11:06 »
thanks ill try them out ASAP
Since i dont plan on releasing the script to the public as i am just editing it to work with more then the white flare, but even so an array does sound like a good idea ill try them both though
Cheers

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:any kind of flare
« Reply #4 on: 21 Jan 2006, 02:49:15 »
the array is the easiest, and probably best, way of doing it

Offline 456820

  • Contributing Member
  • **
Re:any kind of flare
« Reply #5 on: 21 Jan 2006, 10:24:15 »
okay thats sovled that problem
Thanks alot

Topic solved