Jump to content
Sign in to follow this  
Kendo J

Simple spawn script... what am I doing wrong?

Recommended Posts

Ok here is a very simple spawn script I am using that is called from a trigger [this, gamelogic, group1] exec "vehspawnscript.sqf"

It is on a repeating trigger that will spawn the squad everytime it is killed off.

Everything spawns, but the guys are not going into the truck. I dont want to name the truck cos the squad may be killed and the script called again spawning a second truck, but before the first truck is deleted or destroyed.

Is it possible to do this with out naming the truck? or will i have to delete the first one early in the script before I create the second?

_sp = _this select 0;

_grp = _this select 1;

_truck = "Uralopen" createVehicle getPos _sp

"TeamLeaderE" createUnit [_sp, _grp, "this addweapon binocular; this moveincargo _truck; this assignAsCargo _truck", 0.75, "SERGEANT"]

"SoldierEG" createUnit [_sp, _grp, "this moveindriver _truck; this assignAsDriver _truck", 0.6, "Corporal"]

"SoldierE" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.4, "Private"]

"SoldierEB" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.3, "Private"]

"SoldierEB" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.3, "Private"]

"SoldierEB" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.3, "Private"]

"SoldierEAT" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.3, "Private"]

"SoldierEMG" createUnit [_sp, _grp, "this moveincargo _truck; this assignAsCargo _truck", 0.3, "Private"]

_grp setBehaviour "safe"

_grp setformation "LINE"

exit

Share this post


Link to post
Share on other sites

Seem logical to assign a name to that truck and define where exactly they need to mount.

Share this post


Link to post
Share on other sites

Yeah I had to name the truck and at the beggining of the script I deleted it. So on the next spawn a new truck is made.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×