Jump to content
Sign in to follow this  
Khalashnikovf

Nuclear Explosion - Physics Improved

Recommended Posts

Hey. First off all, holy shit this is a really good nuclear weapon addon. The most real I've ever seen. Forget about the other mods who are just for eyekandy. Your mod is actually scary.

Anyway, on to my problem: When I try your demo mission everything works well.

Than I try to include the nuke in my sandbox using radio commands for placing the objects and the trigger. And I can set the nuke destination and the nuke explodes. But when it does the explosion visuals happen, and after about 5-10s when the smoke lies low the mushroom cloud is gone, there is no more smoke from the explosion and the funniest thing: the explosion destruction is spreading very very slowly. There is a circle spreading out from the epicentre destroying buildings but it's slow. It takes about 15s for the destruction to spread from centre of cherno to the edge. The rain doesn't start, and there is only a little bit of dust falling. And I have a good computer. I have included preload module, day movie module, and functions module. (i5, 670gtx)

So: cloud pillar dissapears too fast, explosion is too slow. No rain, only a little dust falling.

Here's what I have done in more detail:

I copied the lk map into my mission. I added entries for description and init into the ones found inside my mission folder.

I ran into some problems when importing descriptions, because some entries already existed. (I am using a script which usses lkscripts, so I had to rewrite

class CfgSounds

class incoming
{
	name = "incoming"; // Name for mission editor
	sound[] = {\lk\sound\incoming.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};

Than I set a radio command with these scripts:

Radio juliet trigger

[] exec "MapClick.sqs"; hint "Click on the map to select target location.";

mapclick.sqs

onMapSingleClick "_pos exec ""ArtMarker.sqs"""

artmarker.sqs

_Marker = createmarker ["ArtTgt1", _this]
_Marker setMarkerType "Destroy"
_Marker setMarkerColor "ColorRed"
_Marker setMarkertext  "ARTILLERY TARGET"

tgt1 = "Sign_Danger" createVehicle (getMarkerPos "ArtTgt1")

~60

deleteVehicle tgt1

deleteMarker "ArtTgt1"

radio hotel

nul = [tgt1,12,true,30,true,true] execvm "lk\nuke\nuke_countdown.sqf";

I've just ripped these scripts from some other script pack I dont remember. I'm not very good at arma2 editing, you see. I've only just started yesterday.

I than added function, preload, and day movie effect modules.

Here's my init

//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: TODO: Author Name
//////////////////////////////////////////////////////////////////
// -- nuke --

waitUntil {player == player};
ShockpushPreLoad = compile preprocessFileLineNumbers "lk\nuke\shockpush.sqf";
ShockWavePreLoad = compile preprocessFileLineNumbers "lk\nuke\shockawe.sqf";
StaticPreLoad = compile preprocessFileLineNumbers "lk\nuke\shockaweStatic.sqf";
NukePreLoad = compile preprocessFileLineNumbers "lk\nuke\nuke.sqf";
IncomingPreLoad = compile preprocessFileLineNumbers "lk\nuke\nuke_incoming.sqf";
BuildingListPreload = compile preprocessFileLineNumbers "lk\nuke\coverableBuildings.sqf";

nukeNumber = 0;
markerFalloutCounter = 0;


execVM "BTK\Cargo Drop\Start.sqf";

if isserver then {
 private "_t";
 _t = paramsarray select 0;
 if (_t == 99) then { _t = random 24 };
 skiptime ((_t - daytime + 24) % 24);
};

execVM "briefing.sqf";


// ---US SUPPORT SCRIPT-------------------------------------------------------------
setPitchBank = compile preprocessfile "lkscripts\tomahawk\setPitchBank.sqf";
player execVM "lkscripts\Dscripts\respawn_player.sqf"; // infinite loop, controls respawning
//player addeventhandler ["Killed", {_this execVM "lkscripts\Dscripts\respawn_player.sqf"}]; // would rather use event handler

if ( (!isServer) && (player != player) ) then
{
waitUntil {player == player};
waitUntil {time > 10};
};
if !(isnull player) then {
null = [] execvm "briefing.sqf";
if (playerSide == west) then {null = [] execVM "lkscripts\menu\close_menu.sqf"};
};
// ---US SUPPORT SCRIPT----------------------



// Execute the mission settings script
[] execVM "mission_settings\init.sqf";

// Force your desired view distance and grass level at the start of the mission
// players can still change it client-side through the script
setViewDistance 2000;
setTerrainGrid 50;

I have a sneaky suspicion that the problem has something to do with preloading, since the explosion is so slow. But I have no idea.

Another interesting thing: when playing on my mission and viewing the explosion from a heli there was this graphical glitch where the rushing smoke wasn't being drawn under my heli, while on your mission it was.

I'm looking forward to hearing from you. Cheers!

Share this post


Link to post
Share on other sites

First of all, I must thank you for this awesome mod you've made. It is so much better than the other nuclear weapon mods out there, because it's not just eyekandy. The explosion is actually terrifying.

But now here's my problem:

When I try to import your script into my mission the nuclear weapon doesn't function properly. It explodes on set target, but the explosion is broken. After the nuke explodes, and the initial light/smoke in the first 2/5seconds goes, the mushroom cloud/pillar dissapears just about 5 seconds later. So it's defenitely too short. And a funny thing is, the explosion happens, and goes, but than after the smoke settles the destruction is spreading very very slowly. A circle going from the epicentre, destroying buildings and vehicles is moving slowly and destroying everything in its path. For example from centre of cherno to the edge it takes about 10-20 seconds. After that, there is no rain and only very little ashe downfall. And a radiation zone doesn't get marked on the map.

Another funny thng thats' happening is that there is a graphical glitch on my mission where there isn't on yours. I fly in a heli, about 2km away from the blast and under the heli on my mission the rushing dust isn't being drawn while it is on your demo mission.

In short: explosion too fast, no pillar of smoke, destruction too slow, no rain, little ashe, no radiation zone on map.

EDIT i have checked it out again, and maybe it's not that the destruction is too slow, but the blast animation is too fast and a bit bugged. And I think there is no dust rushing along the ground.

ALSO, importantly, the pillar of smoke dissapears after the initial blast for some reason, where in your missin it stays.

ANOTHER OBSERVATION: the game pauses/freezes for about 5s at the moment the nuke hits. after that, the smoke/effects seem to be going at a fast forward speed.

Also, my computer is good enough.(i5, 670gtx)

If I try your mission, however everything works fine.

here's what i did when i was importing your mod:

First I copied the lk and gig_scud folder to my mission folder.

Than I imported the text from your init and desctription .sqs into mine. I encountered my first problem here: some entries already existed in my description.sqs because a mod I have already uses lkscripts. (they are in a different folder) So I had to replace the old

class CfgSounds and 	
class incoming
{
	name = "incoming"; // Name for mission editor
	sound[] = {\lk\sound\incoming.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};

Than I went into the game editor and used some radio triggers to place the objective markers like so:

radio juliet

[] exec "MapClick.sqs"; hint "Click on the map to select target location.";

MapClick.sqs

onMapSingleClick "_pos exec ""ArtMarker.sqs"""

ArtMarker.sqs

_Marker = createmarker ["ArtTgt1", _this]
_Marker setMarkerType "Destroy"
_Marker setMarkerColor "ColorRed"
_Marker setMarkertext  "ARTILLERY TARGET"

tgt1 = "Sign_Danger" createVehicle (getMarkerPos "ArtTgt1")

~60

deleteVehicle tgt1

deleteMarker "ArtTgt1"

radio hotel (the condition = this - does this matter? i do not know)

nul = [tgt1,12,true,30,true,true] execvm "lk\nuke\nuke_countdown.sqf";

So now the nuke lands at the point I have determined with the map. I have ripped these scripts of off some mod. I've only been using arma2 editor for 2 days so I dont know how to make my own.

Than I placed a functions module and a preload module and a day movie effect module. I didn't change anything on them.

Here's my init

//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: TODO: Author Name
//////////////////////////////////////////////////////////////////
// -- nuke --

waitUntil {player == player};
ShockpushPreLoad = compile preprocessFileLineNumbers "lk\nuke\shockpush.sqf";
ShockWavePreLoad = compile preprocessFileLineNumbers "lk\nuke\shockawe.sqf";
StaticPreLoad = compile preprocessFileLineNumbers "lk\nuke\shockaweStatic.sqf";
NukePreLoad = compile preprocessFileLineNumbers "lk\nuke\nuke.sqf";
IncomingPreLoad = compile preprocessFileLineNumbers "lk\nuke\nuke_incoming.sqf";
BuildingListPreload = compile preprocessFileLineNumbers "lk\nuke\coverableBuildings.sqf";

nukeNumber = 0;
markerFalloutCounter = 0;


execVM "BTK\Cargo Drop\Start.sqf";

if isserver then {
 private "_t";
 _t = paramsarray select 0;
 if (_t == 99) then { _t = random 24 };
 skiptime ((_t - daytime + 24) % 24);
};

execVM "briefing.sqf";


// ---US SUPPORT SCRIPT-------------------------------------------------------------
setPitchBank = compile preprocessfile "lkscripts\tomahawk\setPitchBank.sqf";
player execVM "lkscripts\Dscripts\respawn_player.sqf"; // infinite loop, controls respawning
//player addeventhandler ["Killed", {_this execVM "lkscripts\Dscripts\respawn_player.sqf"}]; // would rather use event handler

if ( (!isServer) && (player != player) ) then
{
waitUntil {player == player};
waitUntil {time > 10};
};
if !(isnull player) then {
null = [] execvm "briefing.sqf";
if (playerSide == west) then {null = [] execVM "lkscripts\menu\close_menu.sqf"};
};
// ---US SUPPORT SCRIPT----------------------



// Execute the mission settings script
[] execVM "mission_settings\init.sqf";

// Force your desired view distance and grass level at the start of the mission
// players can still change it client-side through the script
setViewDistance 2000;
setTerrainGrid 50;

I also tried using just the init from your mission, but there was no change.

I think, since the explosion does happen, I must have broken something in the importing, and not the triggering/object placing. I have a sneaky suspicion the problem might be preloading, since the blast/destruction happens slowly.

I'm looking forward to your reply,

cheers!

Edited by iZver

Share this post


Link to post
Share on other sites

there was on thing i didn´t like: all trees are standing around like nothing happens....

so i scripted a bit by myself:

you need those lines:

_dist=(1.754411*((_kT)^(1/3)))*1000; //_kT= Bomb in kT

_ArrayT=(nearestObjects [_pos, [], _dist]); //_pos= Position of detonation
ArrayT=[];
{if (typeOf _x == "") then {ArrayT set [count ArrayT, _x];};} forEach _ArrayT;

place it for example in the init.sqf/nuke_countdown.sqf (it causes a lag of 1 sec + because of the huge data,but that shouldn´t be a problem at the start of the mission or on loadingscreen)

so now i changed the shockawe.sqf a bit:

if (!isServer) exitWith {};

_pos = _this select 0;
_kT = _this select 1;
_playersInvicibility = _this select 2;

deletemarkerlocal "nukemarker";

AllArray = [];
timeAfter = 0;
plus = (1.5 + random 1);

[color="#FF0000"]// Shockwave affect
_t=[_pos,_kT,_playersInvicibility] spawn sw2;

//Trees
_t=_pos spawn tree;[/color]


// Instant waporazing of any vehicle or unit in closest area to Blast
[_pos,_kT] spawn StaticPreLoad;
_array = _pos nearObjects ["Motorcycle",((ln(_kT)+1) * 100)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Car",((ln(_kT)+1) * 100)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["StaticWeapon",((ln(_kT)+1) * 150)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Tank",((ln(_kT)+1) * 50)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Ship",((ln(_kT)+1) * 150)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Air",((ln(_kT)+1) * 100)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Man",((ln(_kT)+1) * 200)];
{deleteVehicle _x;} forEach _array;
_array = _pos nearObjects ["Thing",((ln(_kT)+1) * 600)];
{_x setDamage 1;} forEach _array;





while {shockWaveSpreadDistance < (shockDistance - 1)} do {
heatPlus = ln(heatDistance - heatWaveSpreadDistance)*((ln(_kT)+1)*88)/20;
if (heatPlus > 0) then {heatWaveSpreadDistance = heatWaveSpreadDistance + heatPlus; };
if (heatWaveSpreadDistance >= (heatDistance - 1)) then {heatWaveSpreadDistance = (heatDistance);};
shockWaveSpreadDistance = shockWaveSpreadDistance + ln(shockDistance - shockWaveSpreadDistance)*((ln(_kT)+1)*41)/20;
//hintSilent format ["Heatwave: %1 \n Shockwave: %2",heatWaveSpreadDistance,shockWaveSpreadDistance];
sleep 0.05;
};
while {timeAfter < radTime} do
{
	plus = (1.5 + random 1);
	sleep plus;
	timeAfter = timeAfter + plus;
};

i added two functions: tree and sw2 (you need to compile them etc. of course):

tree:

{_x setDamage 1;}forEach ArrayT;

sw2:

_pos = _this select 0;
_kT = _this select 1;
_pI = _this  select 2;


AllArray = nearestObjects [_pos,["Man","Air","Motorcycle","Car","Tank","Ship","StaticWeapon"], 30000];
{[_x,_pos,_kT,false,_pI] spawn ShockpushPreLoad;} forEach AllArray;

Tested with All in Arma :)

file.html

I found a script error too....

in nuke.sqf you spawn a function called wind....but the name is reserved...

so you have to change it e.g. wind2 in nuke.sqf and in nenvi.sqf

EDIT:

It seems to be more or less synchron to an 1kT explosion, otherwise it takes to long to finish the forEach command.

I will try to make the script faster...

I also found out that not only trees are affected...

Also fences and light power poles are knockt over :)

Edited by theone

Share this post


Link to post
Share on other sites

soo nice this thread i wish i could use that in dayz (only the effects)

Share this post


Link to post
Share on other sites

Long time I was gone. Many people asking me about porting it to Arma 3.

Well, since my original part of script is only physical part I need to wait once someone make particles etc.

And it would be really awesome if some will already implement my math of counting size of Explosion and mushroom cloud.

Will update first topic soon with more information what is need to be done. I already tried my script in Arma 3 and it work EVEN much better with PhysX system.. Cars were rolling like in real, but there will be ALOT of work with covering system, new vehicles, etc. Once I will get some free time to spare, will definitively look on it and ALSO finish my original work to perfect stage :)

Share this post


Link to post
Share on other sites

Hi,

i've pasted all script filles from your test mission to my arma 3 mission. Everything works pretty nice but i got one problem. Explosive effect doesn't show what i got to do? Thanks for the answer.

And my another question is - what i can safely delete from this script what's not necessary in nuke effect? Cuz 17mb it's too much for my mission. ;d

Edited by watcherhell

Share this post


Link to post
Share on other sites

Good to hear you're still working on it thanks for this!!

Share this post


Link to post
Share on other sites

I would love to use this script in my next Arma 3 short movie. How is progress going with it. Movie credits and hugs to those who finish this script for Arma 3. The explosion looks awesome and terrifying in Arma 2. It is already in my manuscript so please please please with sugar on top, continue the awesomeness of this nuclear detonation :)

Edited by Plaindog

Share this post


Link to post
Share on other sites

How can i trigger this from mission system?

actually ive this added to a mission

_this = createTrigger ["EmptyDetector", [8570.69,11134.2,0.001]];
_this setTriggerActivation ["LOGIC", "PRESENT", false];
_this setTriggerType "SWITCH";
_this setTriggerStatements ["nul = [nukepos,1,true,10,true] execvm ""lk\nuke\nuke_countdown.sqf"";", "", ""];
nukepos = _this;

this only drops small bombs in a radius about 200m but no countdown and nuke. If i choose detonation from the commanding menu (radio) all works.

Share this post


Link to post
Share on other sites

Cant get this work ingame :icon_frown: only from Menu.

this works perfect with Editor/Preview

_this = createTrigger ["EmptyDetector", [9999.6504, 10477.816, -6.3177333]];
_this setTriggerArea [10000, 10000, 0, true];
_this setTriggerActivation ["LOGIC", "NOT PRESENT", false];
_this setTriggerType "SWITCH";
_this setTriggerStatements ["this", "nul = [nukemarker1,16,true,30,true,true,true,20] execVM ""lk\nuke\nuke_countdown.sqf"";", ""];
_trigger_3 = _this;

_vehicle_0 = objNull;
if (true) then
{
 _this = createVehicle ["HeliHEmpty", [12344.854, 15504.232, -17.615116], [], 0, "CAN_COLLIDE"];
 _vehicle_0 = _this;
 _this setVehicleVarName "nukemarker1";
 nukemarker2 = _this;
 _this setPos [12344.854, 15504.232, -17.615116];
};

but ingame nothing happens, someone know how i can trigger the nuke and countdown?

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  

×