Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #1 
This code will create a random vehicle from the list (Array) on a maker called "vehicleSpawn". use this code in the On Activation box of a trigger.

westvehicle = ["LIB_SdKfz_7","Lib_sdkfz251","LIB_kfz1","LIB_opelblitz_open_y_camo","LIB_opelblitz_tent_y_camo","LIB_SdKfz_7_AA","LIB_opelblitz_parm","LIB_opelblitz_ambulance","LIB_opelblitz_fuel"]; 
spawnPoint = "vehicleSpawn";  
reward = westvehicle select floor(random count westvehicle) createVehicle getMarkerPos spawnpoint; 


If you want the probability of a specific vehicle spawning to be higher, just add the class name of the specific vehicle into the list again.

The above works perfectly well in single player, the below code is to be used in multiplayer as it forces the trigger to run on the server only rather than all the clients, stops a once only trigger being called again when JIP occurs

if(isServer) then {
westvehicle = ["LIB_SdKfz_7","Lib_sdkfz251","LIB_kfz1","LIB_opelblitz_open_y_camo","LIB_opelblitz_tent_y_camo","LIB_SdKfz_7_AA","LIB_opelblitz_parm","LIB_opelblitz_ambulance","LIB_opelblitz_fuel"];
spawnPoint = "vehicleSpawn";  
reward = westvehicle select floor(random count westvehicle) createVehicle getMarkerPos spawnpoint; 
};


This following code in the condition rather than having just "this" also helps to ensure a multiplayer trigger will only run once on the server.

(this) && (isServer)
0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #2 

Ironjim came up with this to produce explosions in a 100m radius around a marker I believe, this would have to be within a script and called by a trigger or radio call maybe.

_rshell = ["lib_sh_81_he" , "lib_sh_82_he"];
_hell = (_rshell select (floor(random(count _rshell)))) createVehicle[(_strikemarker select 0)+(random 60 - random 120), (_strikemarker select 1)-(random 60 + random 120), 100];



Only thing I don't know is where in the code do we determin the name of the marker the expolsions happen around, if anyone could add to this little script, it would be appreciated.

 

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.