Jump to content
  • 0

Spawning FIRE


CartoonrBOY

Question

I have been trying got get fire spawning on the server when it starts but to no avail. I have tried spawning the fire objects (cars) within the server files and the mission file as map additions. Does anyone have an idea why this isn't working?

waitUntil {!isNil "dayz_animalCheck"};

sleep 60;

if (isServer) then {

_vehicle_69 = objNull;
if (true) then
{
  _this = createVehicle ["SKODAWreck", [6665.3789, 2531.5535,0], [], 0, "CAN_COLLIDE"];
  _vehicle_69 = _this;
  _this setDir 150.43945;
  _this setPos [6665.3789, 2531.5535,0];
  PVDZE_obj_Fire = [_this,3,time,false,false];
  publicVariable "PVDZE_obj_Fire";
};

};

It will not even spawn the vehicles and I have no clue why. Can anyone help? Thanks in advance...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
hey i found this should help you.

dzWMs.jpg

Some men just want to watch the world burn…

To make something burn via BIS_Effects_Burn we’ll need this code in our init.sqf:

BIS_Effects_Burn=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";

Then to set something on fire we’ll use this command, either in a trigger or from it’s init or via a script:

[object, intensity, time, lifecheck, fade] spawn BIS_Effects_Burn;

Object: the name of the object that the fire will be attached to.
Intensity: the intensity of the fire.  Recommended to use values between 0.7 and 10, higher values may be used if desired though.
Time: the time that the fire started.  Use the global variable time.  This is used to keep effects synced for JIP players.
Lifecheck: if this is true then the unit will only burn as ling as it is dead (!alive unit).  Set to false to burn things like buildings and gamelogics.
Fade: if true then the fire will die down over time, eventually dying out.  Set to false if you want it to keep burning (affected by rain too).

If you want to kill a fire you can delete the object it is attached to.

Hint: you can attach a gamelogic to a moving object via the attachto command, and then make the gamelogic burn that way you can kill the fire without deleting the object.

Examples:
To make a gamelogic named mygamelogic burn forever with a big fire:

[mygamelogic,10,time,false,false] spawn BIS_Effects_Burn

same with medium sized fire:

[mygamelogic,5,time,false,false] spawn BIS_Effects_Burn

To make a gamelogic burn and have the fire fade over time:

[mygamelogic,10,time,false,true] spawn BIS_Effects_Burn

To make it smoke, with no visible flame you can use an intensity of 3 or lower:

[mygamelogic,3,time,false,false] spawn BIS_Effects_Burn
Link to comment
Share on other sites

  • 0

Thank you so much - trying that out. I think perhaps it's the init command I was missing. You can see I already have the code but despite several variations it refused to ignite. I still don't understand why the vehicles weren't spawning at all...

 

The code already exists within the isDedicated section of the compiles file though?

Link to comment
Share on other sites

  • 0

Hi,

I too have the line:

BIS_Effects_Burn = compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";

in my compiles.sqf.
 

Originally, I have used a combination of the above as I could not seem to easily get the function BIS_Effects_Burn to work when creating the object in my AI mission files.

I use a modified version of DZMS on my testserver. To spawn a burning object nearby a mission location inside the DZMS mission file (e.g. SM1.sqf) I used the code below:

_coords = [_x,_y,_z]; 
_wrecktype = "MQ9PredatorWreck";
_spawnFire = true; 
_fadeFire = false; 
_crashdir = floor(random 360); 
_crashpos = [_coords, 50, 100, 0, 0, 0, 0] call BIS_fnc_findSafePos; 
_crash = createVehicle [_wrecktype, _crashpos, [], 0, "CAN_COLLIDE"]; 
_crash setDir _crashdir; 
_crash setVehicleLock "LOCKED"; 
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_crash]; 
if (_spawnFire) then {
    PVDZE_obj_Fire = [_crash, 4, time, false, _fadeFire]; 
    publicVariable "PVDZE_obj_Fire"; 
    _crash setVariable ["fadeFire",_fadeFire,true]; 
    }; 

The problem I found was I think with this section of code:
 

PVDZE_obj_Fire = [_crash, 4, time, false, false];
publicVariable "PVDZE_obj_Fire";
_crash setVariable ["fadeFire",false,true];

So far, I have not been able to make this JIP compatible, if I logged out and in again there was no fire or smoke any more on the wreck.

To get around this for the moment I use the below code in my init.sqf.

if (!isDedicated) then {
	_crasharray = ["MQ9PredatorWreck"];
	_crashtype = allmissionobjects "MQ9PredatorWreck";
	{
	if (typeOf _x in _crasharray) then {
		dayzFire = [_x,4,0,false,false];  
		nul=dayzFire spawn BIS_Effects_Burn;		
		};
	} forEach _crashtype;
};

Thank you Tech_Support as I figured out how to use BIS_Effects_Burn with the setVehicleInit command in the DZMS files like so:

_crash setVehicleInit "[this,4,time,false,false] spawn BIS_Effects_Burn;";
processInitCommands;

This though seems to have the same problem with logging, as when I log out and in again the object is no longer burning and I am still having to use the above section in the init.sqf.

I am probably missing something here, but this seems the only way I can get it to work at the moment.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...