wld427 1705 Posted July 19, 2008 I am trying to script a chemical weapons effect ad an ammo type for a howitzer int he upcoming Project RACS addons. What we have are GP, HE, and Frag shells. I want to add a chemical shell with the effects similar to that of the script in Evolution support console. But i want it as an ammo type. So how would one right a smke shell to start with? then turn it into a killer fog? Below is my ammo config. If somone has a solution and needs the addon for testing Please PM me and i will send you the beta <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgAmmo { class ShellCore; // External class reference class ShellBase : ShellCore {}; class PLQ86_155mm_Frag : ShellBase { hit = 120; indirectHit = 125; indirectHitRange = 85; typicalspeed = 290; thrustTime = 0.5; thrust = 150 explosive = 0.8; cost = 300; model = "\ca\Weapons\shell"; }; class PLQ86_155mm_GP : ShellBase { hit = 2850; indirectHit = 10; indirectHitRange = 10; typicalspeed = 400; explosive = 0.8; cost = 300; model = "\ca\Weapons\shell" }; class PLQ86_155mm_HE : ShellBase { hit = 850; indirectHit = 20; indirectHitRange = 20; typicalspeed = 400; explosive = 0.8; cost = 300; model = "\ca\Weapons\shell" }; }; Share this post Link to post Share on other sites
charonos 0 Posted July 20, 2008 You won't have another chance than to use scripts, there is no ammo type in the game that simulates anything close to chemical damage, it is all direct/indirect hit damage that the engine processes for ammunition types. And why not use a script? I have no time to test it and it might not work with ammo, but you could try to "attach" a "killed" or "hit" EH to the shell and upon impact (destruction) the script will be called. Sometimes EHs refuse to work with object/ammo types though, you need to test it. Using a smokeshell for the artillery might not work because the smokeshell never gets destroyed (therefore also no EH would be called) and the smoke will be released right after the smokeshell is "shot". So you have to stick to normal types of shells with really small hit values like 1 or lower to focus more on the secondary chemical effect. Good Luck! Share this post Link to post Share on other sites
wld427 1705 Posted July 21, 2008 well i found a script in OFPEC to use that simulates the chemical effect. but how do i make it where the shell "splashes" below are the scripts i found <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; THE CHAIN OF COMMAND (CoC) ;*************************************************** ; TACTICAL NUCLEAR WEAPON PARTICLE SIMULATION ;*************************************************** ; Internal addon script. *DO NOT MODIFY*. ; ;---------------------------------------- ;The Chain of Command, denoir ;http://www.thechainofcommand.net/ ;----------------------------------------- ; Version 1.0 ; Dependencies: none ; OFP Version Required: 1.91 _null = "scalar bool array string 0xfcffffef" _pos = _this _x = _pos select 0 _y = _pos select 1 _i = 0 _gray = [[0.4,0.9,0.4,0.5],[0.6,0.9,0.6,1],[0.4,0.9,0.4,0.7], [0.65, 0.9, 0.5, 0]] #loop _sizeX = 30 _lifetime = 360 _size1 = random _sizeX _size2 = 30 _size = [_size1, _size2] _color = _gray _shape = "cl_basic" _v0 = 4 _vel = [(random (4*_v0))-_v0, (random (4*_v0))-_v0, random 1] drop [_shape, "", "Billboard", 2, _lifetime, [_x, _y, random(4)], _vel, 0, 0.2, 0.157, 0.01, _size, _color, [0], 0.1, 0.2, "\DSF_RUSOPFOR\scripts\effectchem.sqs", "", ""] _vel = [(random (4*_v0))-_v0, (random (4*_v0))-_v0, random 1] drop [_shape, "", "Billboard", 2, _lifetime, [_x, _y, random(4)], _vel, 0, 0.2, 0.157, 0.01, _size, _color, [0], 0.1, 0.2, "\DSF_RUSOPFOR\scripts\effectchem.sqs", "", ""] _vel = [(random (4*_v0))-_v0, (random (4*_v0))-_v0, random 1] drop [_shape, "", "Billboard", _lifetime, _lifetime, [_x, _y, random(4)], _vel, 0, 0.2, 0.157, 0.01, _size, _color, [0], 0.1, 0.2, "", "", ""] _i = _i + 1 ~0.5 #skip ?_i < 250: goto "loop" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; ***************************************************** ; ** Operation Flashpoint Script File ; ***************************************************** ;hint format ["%1", _this] #LocateUnit ;~0.1 _near = NearestObject _this _object = "EmptyDetector" createvehicle _this #Checks _dist = _near Distance _object DeleteVehicle _object ;?_dist > 10 : Goto "LocateUnit" ?_dist > 10: exit ?_near In _near : Goto "KillSpecial" #KillUnit ;hint format ["%1",name _near] _near setdammage ((getdammage _near) +0.34) ;Goto "LocateUnit" goto "exit" ;_near = nearestObject _object ;_distance = _near distance _object ;?_distance < 15:vehicle player setdammage ((getdammage vehicle player) +0.04) #KillSpecial _list = crew vehicle _near "_x setdammage ((getdammage _x) +0.24)" foreach _list _near setdammage ((getdammage _near) +0.2) ~0.6 #Exit Exit Share this post Link to post Share on other sites
charonos 0 Posted July 21, 2008 Well like i said, use Eventhandlers! Attach this Eventhandler to your firing howitzer: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> NAMEOFYOURHOWITZER addeventhandler ["fired",{_this execVM "Shellcheck.sqf"}]; and then use this script (i called it shellcheck.sqf) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _shell = nearestobject [_this select 0,_this select 4]; _shellpos = getpos _shell; while {alive _shell} do { if (format ["%1",getpos _shell] != "scalar bool array string 0xe0ffffef") then {_shellpos = getpos _shell}; sleep 0.0001; }; [_shellpos] exec "NAMEOFYOURSMOKESCRIPT"; where the impact position of the shell will be passed to your smoke script. If i were you i would convert denoir's sqs script (with his permission of course) into an sqf script, they excute faster generally. EDIT: I have not been able to attach EHs to ammo, that would be more elegant. Maybe try to confirm that with own tests in case i had a bug in my tests. Hope that helped you. Share this post Link to post Share on other sites