Home   Help Search Login Register  

Author Topic: Detecting vehicles  (Read 1013 times)

0 Members and 1 Guest are viewing this topic.

Silencer

  • Guest
Detecting vehicles
« on: 25 Feb 2005, 13:01:47 »
Hi all,

I have created 2 vehicles, this way:

_SkodaRed= "SkodaRed" createvehicle _Coordinates
_SkodaGreen= "SkodaGreen" createvehicle _Coordinates

This works perfect, but I also have made a trigger (somewhere else).

Question 1:  I want to know how to detect: If the car is
                   _SkodaRed or _SkodaGreen. How can I do this?

Question 2:  And how can I remove the (variable) vehicle when
                    it is in the trigger?

Thanks!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detecting vehicles
« Reply #1 on: 25 Feb 2005, 15:15:23 »
Use a typeOf command in the trigger.    Probably.
Plenty of reviewed ArmA missions for you to play

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Detecting vehicles
« Reply #2 on: 25 Feb 2005, 20:36:36 »
Or assign the vehicles to GLOBAL variables, instead of LOCAL ones:

SkodaRed= "SkodaRed" createvehicle _Coordinates
SkodaGreen= "SkodaGreen" createvehicle _Coordinates

Now you can refer to those vehicles in ANY script, using their variables (SkodaRed or SkodaGreen).
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 Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Detecting vehicles
« Reply #3 on: 25 Feb 2005, 21:10:11 »
Hmmmmm I think u will have problems m8...

Our Vehicle Respawn script (MP Dedi Server) uses also "Createvehicle",and somehow many commands do not work on a vehicle created with CreateVehicle :(

Getdammage,TypeOf,Fuel...etc do not work.
 try TypeOf  _SkodaRed or Getdammage _SkodaRed -->Hint format["%1",GetDammage _SkodaRed] will give U scalar :/

Atleast thats what i could find out,if somebody has more info pls share ;)

A very Usefull command would be "SetName",assigning a name outside the editor.

A possible workaround is having your car already on the map somewhere hidden and have it setpossed to the place you want when U want.

Then U can use :?(TypeOf Nameof your RedSkoda == "SkodaRed"):hint "Red Skoda spotted :P" Just an example :D

To remove the vehicle in the triggers list I think U need to look after arrays and how to change them.
[5,6,7] = [5,6,7,8] - [8]
Or If U just use 1 vehicle:thislist resize 0

Again,if somebody has more info I am happy to hear :)








« Last Edit: 25 Feb 2005, 21:12:17 by Platoon Patton »
http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline Blanco

  • Former Staff
  • ****
Re:Detecting vehicles
« Reply #4 on: 26 Feb 2005, 04:22:45 »
Quote
Our Vehicle Respawn script (MP Dedi Server) uses also "Createvehicle",and somehow many commands do not work on a vehicle created with CreateVehicle

Well now, that's strange  ???
This should mean you can't create vehicles with createvehicle?

General is Barron is right, make your variables global and you can deletevehicle the cars via a trigger or another script without a problem.
Any local variable in a trigger creates an error (local variable in a local space)
« Last Edit: 26 Feb 2005, 04:25:59 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting vehicles
« Reply #5 on: 26 Feb 2005, 13:29:05 »
Quote
Our Vehicle Respawn script (MP Dedi Server) uses also "Createvehicle",and somehow many commands do not work on a vehicle created with CreateVehicle
Yeah, that certainly is strange because those commands you mention work just fine in my OFP...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.