Editors Depot - Mission Editing and Scripting > Arma2 - Editing/Scripting General

Random unit moveinCargo command

(1/2) > >>

eegore:

  I'm trying to come up with an efficient method to randomly assign a unit to the cargo of one of 4 vehicles.

  I have 2x wheeled vehicle, a helo and a boat all heading to a single location but I am not sure how to randomize the moveinCargo command. 

  The Unit (T1) is not the player he is the intended target to eliminate.  The objective is to increase replayability by not having the exact same insertion each time. 

h-:
Put the vehicles in an array and randomly select them based on array count:

--- Code: ---_inserts = [wheel1,wheel2,helo,boat];
T1 moveInCargo (_inserts select (random ((count _inserts)-1))); // -1 needed because count starts from 1 and array element idx from 0. BIS should really provide a arrayCount command already..
--- End code ---

eegore:

  Ok I placed this in the init file and it usually works.

  For some reason the UH1 will land and let the T1 unit out then fly away.  Not sure why it wont carry the unit to the LZ.  They are both BLUFOR units.

h-:
Does the T1 have some waypoint?

eegore:

  He does not.  I haven't exactly figured out how to get him out of the vehicles and into a building yet.

  Maybe a distance activated trigger that tells him to eject, and another that tells him to go to a gameLogic.

Navigation

[0] Message Index

[#] Next page

Go to full version