Jump to content
Sign in to follow this  
Bejmo

Help with spawn script

Recommended Posts

Hello all hoping someone can help with a script i have cobbled together from all over the place. What i am trying to do is. On a trigger spawn a CH47, Pilot and some guys that will then fly to an LZ unload guys who then move into position and the CH47 buggers off. I know i can have the whole lot on the map waiting to go but i am trying to cut down on stuff on the map as my pc isn't the best. Also trying to wrap my head around scripting in my Little spare time.

I have ........and dont laugh i know its a mess and probably very wrong :P

This..

// Creates Marker

createMarker ["BFQRF1", position SPBFQRF1];

"BFQRF1" setMarkerPos getPos SPBFQRF1;

createMarker ["BFQRF1G", position SPBFQRF2];

"BFQRF1G" setMarkerPos getPos SPBFQRF2;

BFQRF1 = createGroup west;

BFQRF1G = createGroup west;

//CH47 and Pilot

veh = createVehicle ["CH_47F_EP1", getMarkerPos "SPBFQRF1", [],0,"fly"];

CH_47F_EP1pilot = grpr1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];

CH_47F_EP1pilot moveInDriver veh;

//Blufor QRF

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

BFQRF1G createUnit ["USMC_Soldier", getMarkerPos "BFQRF1G", ["BFQRF1G"], 1, "FORM"];

{_x moveInCargo chopper1} foreach units group BFQRF1G;

//CH47 Waypoints

_point1 = getmarkerPos "WPBFQRF1_1";

_wp0 = BFQRF1 addWaypoint [ _point1, 10];

_wp0 setWaypointType "MOVE";

_wp0 setWaypointStatements ["true", ""];

_wp0 setWaypointSpeed "FULL";

_point2 = getmarkerPos "WPBFQRF1_2";

_wp1 = BFQRF1 addWaypoint [ _point2, 10];

_wp1 setWaypointType "TR UNLOAD";

_wp1 setWaypointStatements ["true", ""];

_wp1 setWaypointSpeed "FULL";

_point3 = getmarkerPos "WPBFQRF1_3";

_wp2 = BFQRF1 addWaypoint [ _point3, 10];

_wp2 setWaypointType "MOVE";

_wp2 setWaypointStatements ["true", ""];

_wp2 setWaypointSpeed "FULL";

//Blufor QRF Waypoints

_point1 = getmarkerPos "WPBFQRFG1_1";

_wp0 = BFQRF1G addWaypoint [ _point1, 10];

_wp0 setWaypointType "MOVE";

_wp0 setWaypointStatements ["true", ""];

_wp0 setWaypointSpeed "FULL";

Sleep 1;

exit

Any help would be very apreciated :)

Share this post


Link to post
Share on other sites

Well... from just scanning it nothings really "wrong" except you don't need the last two lines for sure.

What it needs is testing.... and since it's your script... you test it! Tell us what doesn't work and someone will try to help you.

Also when posting code... Go Advanced and use the "code" tags to post the code. It makes it a little easier for everyone to digest.

Share this post


Link to post
Share on other sites

What twirly says, and the couple of things that stand out to me are:

Why all the global variables?

You create two groups, but the pilot is in neither, with no waypoints for the pilot group.

Share this post


Link to post
Share on other sites

Hi fellas thanks for the replys. I have tested and i get nada no helli no pilot and no guys. Im not sure about which are the global variables if its the two markers i wasnt sure if i could spawn everything with the one and as for the pilot i just put it in as it was working in the on activation field in editor for someone elses project. Actualy i tried that first and wanted to expand so thats why i tried to merge it with a spawn script that i use that does work. Anyway its all good i will keep plugigng away at it ;)

PS: and i will put future scripts in the code thingy :)

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  

×