Jump to content
Sign in to follow this  
Deathcon5

attach flare to an object?

Recommended Posts

I am working on a mission that has a cruise missile strike.. about 15 of them. I am wanting to attach a flare to each LGB that I have coming in at a high rate of speed to simulate a cruise missile. It should look the same, at least at night anyway. But I wanted to have a "flame" or light attached to it to give it that streak across the sky before it hits the target. Anyway, I can't get the flare to attach to the bomb. I am a newb at scripting so can someone check this for some simple mistake, or will the flares just not attach?

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

_misFlare3 = "F_40mm_white" createVehicle [(getmarkerPos "bombmkr_13" select 0), (getmarkerPos "bombmkr_13" select 1), 200];

_misFlare3 attachTo [_bomb3, [-10,0,0]]  

exit;

Thanks, you guys are great!

Share this post


Link to post
Share on other sites

_misFlare3 attachTo [_bomb3, [-10,0,0]][color="Red"];[/color]

EDIT: In my testing I found that the semicolon didnt actually help, maybe its just a flare problem? You could probably get around this by spawning a light on the bomb? lightAttachObject

Edited by Andy455

Share this post


Link to post
Share on other sites

Thanks for the tip. I got a decent effect with the light. The only thing is that there isn't that bright point of light like you get with the flare. It still looks pretty nice. I had to delete the light or the light just sits on the ground after the explosion permanently. Here it is if anyone wants to play around with it. Just place your marker about 250 meters west of the target. Now to make it for 15 bombs... :)

_bomb3="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_13" select 0), (getmarkerPos "bombmkr_13" 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 2;
deleteVehicle _misFlare3;

exit;

Share this post


Link to post
Share on other sites

If the light is supposed to disappear on explosion then this is a better option:

_bomb3="Bo_GBU12_LGB" createVehicle [(getmarkerPos "bombmkr_13" select 0), (getmarkerPos "bombmkr_13" 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]];

waitUntil {!alive _bomb3}; //Changed
deleteVehicle _misFlare3;

Share this post


Link to post
Share on other sites

nice that's much more precise..

I have 1 new problem. I hosted a MP game so my friend and I could test out the mission and it spawned 2 bombs for each of the 15 markers. Which isn't that big of a deal but when 5 players are on that will mean 5 for each. I have had this problem before and looked it up and I tried using isServer and it just did nothing (0 bombs). Will that only work on dedicated servers?

My syntax:

if (isserver) then {

CODE HERE

};

Share this post


Link to post
Share on other sites
nice that's much more precise..

I have 1 new problem. I hosted a MP game so my friend and I could test out the mission and it spawned 2 bombs for each of the 15 markers. Which isn't that big of a deal but when 5 players are on that will mean 5 for each. I have had this problem before and looked it up and I tried using isServer and it just did nothing (0 bombs). Will that only work on dedicated servers?

My syntax:

if (isserver) then {

CODE HERE

};

Try

if(isServer) then { ... };

If that doesn't work, then the script is probably only being executed on clients, and you'll need to change that.

Share this post


Link to post
Share on other sites

i got the script to drop the bombs with the isServer in there. 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

Hello

I hope this is the correct thread to ask my question.

I would like to create a red day/night signal flare: as the flare goes upwards it should leave a red smoke trail and continue to "smoke" as it gradually falls to the ground.

I have an invisible "H" called "flare". I have a trigger which does the following: flare1="F_40mm_Red" createVehicle [getPos flare select 0, getPos flare select 1, 300]; flare2="SmokeShellRed" createVehicle [getPos flare select 0, getPos flare select 1, 300];

This produces a Flare and Smoke Shell at 300m above "flare". The Smoke Shell of course falls to the ground. I've tried using "flare2 attachto [flare1, [-10,0,0]]" but that doesn't appear to work because I don't know how to create and attach flare2 at the same time :banghead:.

Many thanks for helping.

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  

×