Jump to content
Sign in to follow this  
CaptainBravo

Spawn truck with troops to persue player

Recommended Posts

Hey everyone,

I have a few spawn scripts but they are not giving me what I need

I want to spawn a truck loaded with troops and head to Marker A where it will unload troops who will in turn proceed to a marker B in area. (once a triggor activated)

I want to use a custom addons which makes BIS spawn manager not possible.

Any ideas on how to achieve this?

Thank you for your help :)

Share this post


Link to post
Share on other sites

[/color]

You could create the spawn script then with the trigger have it activate another script that will give a waypoint to the spawned group:

newaypoint1= group addwaypoint [(getpos/getmarkerpos pos/"marker"),1]

newaypoint1 setwaypointtype "move"

in addition if you want it to unload the troops I woul create another sqs script as such:

#loop

?(truck distance (getmarkerpos "markerB") <= 50):goto "truckexit"

~5

?!(alive truck):goto "end"

~5

?!(alive (leader group)): goto "end"

goto "loop"

#truckexit

{unassignvehicle _x} foreach units group

#end

~1

exit

hope this helps. Sqs isnt the most efficient but it works for me.

Edited by Rejenorst

Share this post


Link to post
Share on other sites

Thanks Rejenorst for your help.

I am not sure how to spawn truck and troops and connect them to this script?

Thanks.

Share this post


Link to post
Share on other sites

ah ok.

you have to use the createvehicle command.

for trucktype in the quotation marks you have to find the right vehicle class name which should be listed in one of the sticky topics at the top of this forum.

truckname = "trucktype" createVehicle (getmarkerpos "markername")

if you need to spawn the men use this command to create each soldier, there are variations to the command here http://community.bistudio.com/wiki/createUnit

"soldierWB" createUnit [getMarkerPos "marker_1", _groupAlpha,"loon1 = this ;

this addweapon {binocular}", 0.6, "corporal"]

then :

{_x assignascargo truckname} foreach units _groupAlpha

(leader _groupAlpha) assignasdriver truckname

{[_x] ordergetin true} foreach units _groupAlpha

ultimately you could make an sqs file like this assuming you have a group of soldiers:

_groupAlpha = creategroup east/west

_truckname = "trucktype" createVehicle (getmarkerpos "markername")

"soldierWB" createUnit [getMarkerPos "marker_1", _groupAlpha,"", 0.6, "corporal"]

//The above command needs to be repeated once for each soldier

{_x assignascargo truckname} foreach units _groupAlpha

(leader _groupAlpha) assignasdriver truckname

{[_x] ordergetin true} foreach units _groupAlpha

newwaypoint1= group addwaypoint [(getmarkerpos "markerB"),1]

newwaypoint1 setwaypointtype "move"

#loop

?(truck distance (getmarkerpos "markerB") <= 50):goto "truckexit"

~5

?!(alive truck):goto "end"

~5

?!(alive (leader group)): goto "end"

goto "loop"

#truckexit

{unassignvehicle _x} foreach units _groupalpha

#end

~1

exit

---------- Post added at 12:58 PM ---------- Previous post was at 12:56 PM ----------

For the soldierwb you have to find the right class type of soldier you want spawned which is also stickied somewhere at the top of the forum.

Share this post


Link to post
Share on other sites

ughh .. any chance of an example mission? I have been at for a couple of days with no luck :confused:

Any example would be highly appreciated :o

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  

×