Jump to content
Sign in to follow this  
Coladebote

Associate smoke to object

Recommended Posts

Hi guys:
With this little code, a burning object with a column of smoke appears on the map. When a house in ruins is used, the effect is achieved, because the fire comes from inside the cabin.

The problem arises when it comes to smoke rising from the wreckage of a downed vehicle or helicopter. The smoke does not come out from the vehicle, but from one of its sides, which is very little credible.

Is there a way to join or associate the fire with the object?

This I use to create a battle environment on stage. It is very good to cross a burning vehicle on a road, but the smoke should come from inside the vehicle and not be generated outside.

Help is appreciated. Thanks.

 

CODE:

if (!isServer) exitWith {};

_markerstr = createMarker ["PROPS_1",[13413.9,6621.1]];
_markerstr setMarkerShape "ICON";
_height = 0.407013;
_vehicle = createVehicle ["Land_d_House_Small_02_V1_F", (getMarkerPos "PROPS_1"),[],0,"NONE"];
_dir = 0; 
_vehicle setDir _dir;
_vehicle setVehicleVarName "PROPS_1"; PROPS_1 = _vehicle;
_vehicle enableSimulation false;

_markerstr = createMarker ["SMOKE_1",[13417.9,6622.26]];
_markerstr setMarkerShape "ICON";
_height = 0.896061;
[] spawn
{
	private _fire = "test_EmptyObjectForSmoke" createVehicle getMarkerPos "SMOKE_1";
	sleep 900;
	deleteVehicle _fire;
};
[] spawn
{
sleep 1500;
deleteVehicle PROPS_1;
}

NOTE:
I use two different map positionings to try and unite both elements. I have tried with the same positioning and the result does not improve.

Share this post


Link to post
Share on other sites

@Coladebote,

Try the alt-syntax of createVehicle,

private _fire = createVehicle ["test_EmptyObjectForSmoke", getMarkerPos "SMOKE_1", [], 0, "CAN_COLLIDE"];

Have fun!
 

smoke_effect={
	if !isServer exitWith {};
	params [["_pos", [0,0,0]], ["_time", 900], ["_mark", ""], ["_effect", ["Land_d_House_Small_02_V1_F", "test_EmptyObjectForSmoke"]], ["_code", {{deleteVehicle _x} forEach _this}], ["_arr", []]];

	if !(_mark isEqualTo "") then {(createMarker [_mark, _pos]) setMarkerShape "ICON"};
	{private _veh= createVehicle [_x, _pos, [], 0, "CAN_COLLIDE"]; _arr pushBack _veh}forEach _effect;
	[_arr, _time, _code] spawn {
		params ["_arr", "_time", "_code"];
		sleep _time;
		_arr spawn _code
	};
	_arr
};


EXAMPLES:
Your coordinates, default params

[[13413.9,6621.1]] call smoke_effect

10 second test,

[(player modelToWorld [0, 20, 0]), 10, "FIRE"] call smoke_effect

Hunter wreck (smoke and fire)

[
	(player modelToWorld [(random 100), (random 100), 0]),
	600,
	"Hunter Wreck",
	["Land_wreck_hunter_f", "test_EmptyObjectForFireBig", "test_EmptyObjectForSmoke"]
] call smoke_effect

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello again: Issue resolved satisfactorily. The help from wogz187 has been prodigious. With a few slight changes in one line of the code, the problem has been solved, as indicated:

 

///////////////////////////////////////////////////////////////////////////////////////////

// PROPS 1 

///////////////////////////////////////////////////////////////////////////////////////////

if (!isServer) exitWith {};

///////////////////////////////////////////////////////////////////////////////////////////

//ORIGINAL CODE

_markerstr = createMarker ["PROPS_1",[13135.8,7675.32]];
_markerstr setMarkerShape "ICON";
_height = 0;
_vehicle = createVehicle ["Land_Wreck_Ural_F", (getMarkerPos "PROPS_1"),[],0,"NONE"];
_dir = 0; 
_vehicle setDir _dir;
_vehicle setVehicleVarName "PROPS_1"; PROPS_1 = _vehicle;
_vehicle enableSimulation false;

_markerstr = createMarker ["SMOKE_1",[13135.8,7675.32]];
_markerstr setMarkerShape "ICON";
_height = 0;
[] spawn
{
	private _fire = "test_EmptyObjectForFireBig" createVehicle getMarkerPos "SMOKE_1";
	sleep 900;
	deleteVehicle _fire;
};
[] spawn
{
sleep 1500;
deleteVehicle PROPS_1;
};

//MODIFIED CODE

_markerstr = createMarker ["PROPS_2",[13162,7650.31]];
_markerstr setMarkerShape "ICON";
_height = 0;
_vehicle = createVehicle ["Land_Wreck_Ural_F", (getMarkerPos "PROPS_2"),[],0,"NONE"];
_dir = 0; 
_vehicle setDir _dir;
_vehicle setVehicleVarName "PROPS_2"; PROPS_2 = _vehicle;
_vehicle enableSimulation false;

_markerstr = createMarker ["SMOKE_2",[13162,7650.31]];
_markerstr setMarkerShape "ICON";
_height = 0;
[] spawn
{
	private _fire = createVehicle ["test_EmptyObjectForFireBig", getMarkerPos "SMOKE_2", [], 0, "CAN_COLLIDE"];
	sleep 900;
	deleteVehicle _fire;
};
[] spawn
{
sleep 1500;
deleteVehicle PROPS_2;
};

ORIGINAL CODE RESULT

https://gyazo.com/be4e588cd42305fa4727d90cba027888

 

RESULT OF MODIFIED CODE

https://gyazo.com/fc13edb559f232e06d8378f6df43f08f

 

TEST MISSION

https://drive.google.com/file/d/1WTqzyuEYn64JZXeAMs4JAXyKiu3dG-1D/view?usp=sharing

 

It works perfectly in the editor and on the dedicated server.

 

Thanks, guys. Today I will sleep more peacefully.

 

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  

×