Home   Help Search Login Register  

Author Topic: Moveing units in multiplayer help  (Read 1165 times)

0 Members and 1 Guest are viewing this topic.

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Moveing units in multiplayer help
« on: 09 Mar 2003, 22:46:18 »
right im makeing a multiplayer ctf mission in need to know if it posible to make a unit that woz a human player but disconected and is now AI mount a random aircraft (the one close to him) and then fly to a marker on map and Guard area. Im gessing that this will have to be a scripted action but i cant make it work can any one on hear help with my problem

Rubble_Maker

  • Guest
Re:Moveing units in multiplayer help
« Reply #1 on: 10 Mar 2003, 20:26:15 »
Well you could use the nearestObject command to grab the aircraft closest to the unit, but it will only work for vehicles in a 50m perimeter. I guess it'd be much simpler to make a list of all aircraft available, i.e.

_aircraft= [aircraft1,aircraft2,...];

then loop through the list and see which one is closest to _unit:

_minseed=9999
; Initialize with any unit just to make sure OFP allocates variable globally,
; not just within the loop's scope
_daOne=player
"if (_x distance _unit<_minseed) then {_minseed=_x distance _unit;_daOne=_x}" foreach _aircraft

Now _daOne should be the closest aircraft.


Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Moveing units in multiplayer help
« Reply #2 on: 10 Mar 2003, 20:28:51 »
can u send a demo mission
my email is

swafusa2@hotmail.com or just upload it on hear