Jump to content
Sign in to follow this  
Deathcon5

need help troubleshooting this script

Recommended Posts

I'm a newb at scripting. Thanks in advance for the help. I was working on this script to simulate 15 cruise missiles. I got the script to drop the bombs and it was working fine. Then I needed to add some waypoint activation stuff into it and it broke the script again. If someone could take a look at this script and spot what I am not doing right it would be greatly appreciated. Everything should be fine until the bottom where I added the SetCurrentWaypoint commands.

{
if(isServer) then
{
sleep 60; ///delay before missiles/bombs get to target

_bomb11="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_11" select 0), (getmarkerPos "bombmkr_11" select 1), 200];
_bomb11 setDir 90; _bomb11 setVelocity [300,0,-200];

_misFlare11 = "#lightpoint" createVehicle (position _bomb11);
_misFlare11 setLightBrightness 0.3;
_misFlare11 setLightAmbient[1.0, 1.0, 1.0];
_misFlare11 setLightColor[1.0, 0.2, 0.2];
_misFlare11 lightAttachObject [_bomb11, [-5,0,0]];
sleep 1;




_bomb12="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_12" select 0), (getmarkerPos "bombmkr_12" select 1), 200];
_bomb12 setDir 90; _bomb12 setVelocity [300,0,-200];

_misFlare12 = "#lightpoint" createVehicle (position _bomb12);
_misFlare12 setLightBrightness 0.3;
_misFlare12 setLightAmbient[1.0, 1.0, 1.0];
_misFlare12 setLightColor[1.0, 0.2, 0.2];
_misFlare12 lightAttachObject [_bomb13, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare11;



_bomb13="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_13" select 0), (getmarkerPos "bombmkr_13" select 1), 200];
_bomb13 setDir 90; _bomb13 setVelocity [300,0,-200];

_misFlare13 = "#lightpoint" createVehicle (position _bomb13);
_misFlare13 setLightBrightness 0.3;
_misFlare13 setLightAmbient[1.0, 1.0, 1.0];
_misFlare13 setLightColor[1.0, 0.2, 0.2];
_misFlare13 lightAttachObject [_bomb13, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare12;




_bomb14="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_14" select 0), (getmarkerPos "bombmkr_14" select 1), 200];
_bomb14 setDir 90; _bomb14 setVelocity [300,0,-200];

_misFlare14 = "#lightpoint" createVehicle (position _bomb14);
_misFlare14 setLightBrightness 0.3;
_misFlare14 setLightAmbient[1.0, 1.0, 1.0];
_misFlare14 setLightColor[1.0, 0.2, 0.2];
_misFlare14 lightAttachObject [_bomb14, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare13;



_bomb15="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_15" select 0), (getmarkerPos "bombmkr_15" select 1), 200];
_bomb15 setDir 90; _bomb15 setVelocity [300,0,-200];

_misFlare15 = "#lightpoint" createVehicle (position _bomb15);
_misFlare15 setLightBrightness 0.3;
_misFlare15 setLightAmbient[1.0, 1.0, 1.0];
_misFlare15 setLightColor[1.0, 0.2, 0.2];
_misFlare15 lightAttachObject [_bomb15, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare14;




_bomb1="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_1" select 0), (getmarkerPos "bombmkr_1" select 1), 200];
_bomb1 setDir 90; _bomb1 setVelocity [300,0,-200];

_misFlare1 = "#lightpoint" createVehicle (position _bomb1);
_misFlare1 setLightBrightness 0.3;
_misFlare1 setLightAmbient[1.0, 1.0, 1.0];
_misFlare1 setLightColor[1.0, 0.2, 0.2];
_misFlare1 lightAttachObject [_bomb1, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare15;



_bomb2="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_2" select 0), (getmarkerPos "bombmkr_2" select 1), 200];
_bomb2 setDir 90; _bomb2 setVelocity [300,0,-200];

_misFlare2 = "#lightpoint" createVehicle (position _bomb2);
_misFlare2 setLightBrightness 0.3;
_misFlare2 setLightAmbient[1.0, 1.0, 1.0];
_misFlare2 setLightColor[1.0, 0.2, 0.2];
_misFlare2 lightAttachObject [_bomb2, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare1;




_bomb3="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_3" select 0), (getmarkerPos "bombmkr_3" select 1), 200];
_bomb3 setDir 90; _bomb3 setVelocity [300,0,-200];

_misFlare3 = "#lightpoint" createVehicle (position _bomb3);
_misFlare3 setLightBrightness 0.3;
_misFlare3 setLightAmbient[1.0, 1.0, 1.0];
_misFlare3 setLightColor[1.0, 0.2, 0.2];
_misFlare3 lightAttachObject [_bomb3, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare2;



_bomb4="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_4" select 0), (getmarkerPos "bombmkr_4" select 1), 200];
_bomb4 setDir 90; _bomb4 setVelocity [300,0,-200];

_misFlare4 = "#lightpoint" createVehicle (position _bomb4);
_misFlare4 setLightBrightness 0.3;
_misFlare4 setLightAmbient[1.0, 1.0, 1.0];
_misFlare4 setLightColor[1.0, 0.2, 0.2];
_misFlare4 lightAttachObject [_bomb4, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare3;



_bomb5="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_5" select 0), (getmarkerPos "bombmkr_5" select 1), 200];
_bomb5 setDir 90; _bomb5 setVelocity [300,0,-200];

_misFlare5 = "#lightpoint" createVehicle (position _bomb5);
_misFlare5 setLightBrightness 0.3;
_misFlare5 setLightAmbient[1.0, 1.0, 1.0];
_misFlare5 setLightColor[1.0, 0.2, 0.2];
_misFlare5 lightAttachObject [_bomb5, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare4;



_bomb6="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_6" select 0), (getmarkerPos "bombmkr_6" select 1), 200];
_bomb6 setDir 90; _bomb6 setVelocity [300,0,-200];

_misFlare6 = "#lightpoint" createVehicle (position _bomb6);
_misFlare6 setLightBrightness 0.3;
_misFlare6 setLightAmbient[1.0, 1.0, 1.0];
_misFlare6 setLightColor[1.0, 0.2, 0.2];
_misFlare6 lightAttachObject [_bomb6, [-5,0,0]];
sleep 1;

deleteVehicle _misFlare5;


_bomb7="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_7" select 0), (getmarkerPos "bombmkr_7" select 1), 200];
_bomb7 setDir 90; _bomb7 setVelocity [300,0,-200];

_misFlare7 = "#lightpoint" createVehicle (position _bomb7);
_misFlare7 setLightBrightness 0.3;
_misFlare7 setLightAmbient[1.0, 1.0, 1.0];
_misFlare7 setLightColor[1.0, 0.2, 0.2];
_misFlare7 lightAttachObject [_bomb7, [-5,0,0]];
sleep 1;
deleteVehicle _misFlare6;


_bomb8="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_8" select 0), (getmarkerPos "bombmkr_8" select 1), 200];
_bomb8 setDir 90; _bomb8 setVelocity [300,0,-200];

_misFlare8 = "#lightpoint" createVehicle (position _bomb8);
_misFlare8 setLightBrightness 0.3;
_misFlare8 setLightAmbient[1.0, 1.0, 1.0];
_misFlare8 setLightColor[1.0, 0.2, 0.2];
_misFlare8 lightAttachObject [_bomb8, [-5,0,0]];
sleep 1;
deleteVehicle _misFlare7;


_bomb9="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_9" select 0), (getmarkerPos "bombmkr_9" select 1), 200];
_bomb9 setDir 90; _bomb9 setVelocity [300,0,-200];

_misFlare9 = "#lightpoint" createVehicle (position _bomb9);
_misFlare9 setLightBrightness 0.3;
_misFlare9 setLightAmbient[1.0, 1.0, 1.0];
_misFlare9 setLightColor[1.0, 0.2, 0.2];
_misFlare9 lightAttachObject [_bomb9, [-5,0,0]];
sleep 1;
deleteVehicle _misFlare8;



_bomb10="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_10" select 0), (getmarkerPos "bombmkr_10" select 1), 200];
_bomb10 setDir 90; _bomb10 setVelocity [300,0,-200];

_misFlare10 = "#lightpoint" createVehicle (position _bomb10);
_misFlare10 setLightBrightness 0.3;
_misFlare10 setLightAmbient[1.0, 1.0, 1.0];
_misFlare10 setLightColor[1.0, 0.2, 0.2];
_misFlare10 lightAttachObject [_bomb10, [-5,0,0]];
sleep 1;
deleteVehicle _misFlare9;


sleep 1;
deleteVehicle _misFlare10;

	{
	if((currentWaypoint OpfChop1)=3) then
		{
		OpfChop1 SetCurrentWaypoint [OpfChop1,4];
		sleep 0.5;
		};
	};

	{
	if((currentWaypoint RadarGuards)=1) then
		{
		RadarGuards SetCurrentWaypoint [RadarGuards,2];
		sleep 0.5;
		};
	};


	{
	if((currentWaypoint t721)=5) then
		{
		t721 SetCurrentWaypoint [t721,6];
		sleep 0.5;
		};
	};


	{
	if((currentWaypoint sideBaseGuards1)=1) then
		{
		sideBaseGuards1 SetCurrentWaypoint [sideBaseGuards1,2];
		sleep 0.5;
		};
	};

	{
	if((currentWaypoint OpfAPbmp1)=1) then 
		{
		OpfAPbmp1 SetCurrentWaypoint [OpfAPbmp1,2];
		sleep 0.5;
		};
	};

};

};

exit;

Share this post


Link to post
Share on other sites

Erm I haven't downloaded and tested it for myself but a single '=' usually means the value becomes what you tell it to be, the way I read it is that you need a double '==' as that is pretty much 'is equal to?'.

Also have you checked the arma2.rpt file? or do you have -showScriptErrors enabled? as both of these can help you find the errors in your scripts when it doesnt give a message on screen.

Share this post


Link to post
Share on other sites

Yes i want it to check for "equal to". thanks, i will also enable the error message. thanks, I am learning. I will see if that fixes it.

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  

×