-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookoff - Adds heating effect to cookoff #8685
Conversation
Makes tanks that cook-off actually heat up on IR.
https://community.bistudio.com/wiki/setVehicleTIPars says local effect |
It seems the whole thing is called and then immediately checked for locality, so I don't suspect it'll be an issue. https://github.com/acemod/ACE3/blob/master/addons/cookoff/XEH_postInit.sqf#L4-L9 |
I'm unsure what's going on here then, as the code states that the script shouldn't even start unless the vehicle is local. Does it still do all the smoking and flame effects otherwise? And, if so, I know it's been said to avoid |
No, use CBA Custom Events for any network "execution". |
Do it in |
This sends an event across the network every 1/4 second. in |
Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>
((_tiPars select 1) + (_intensity * 0.004))/1.002, | ||
((_tiPars select 2) + (_intensity * 0.01))/1.005 | ||
] | ||
]] call CBA_fnc_globalEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raises a global event from globally executed script now I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this should be called locally now. This function is run per client
What's the logic behind the math here? Refering to this part:
Lots of magic hard coded numbers here. |
The center value is the tracks/tires, while the other two are the engine and the cannon barrel, so at the outset it stands to reason that the thing having smoke exit from it and the thing with all the ammo burning inside of it would heat up faster than the tires/treads, so that's why the first and last values are equally heated up while the second one heats up more slowly. The second half of the numbers is so as to 1) not be immediately just set to max, 2) not have a linear increase in the values as the heating would taper off, instead having a curve as it gets closer and closer to max, and 3) the math (by always going slightly more than half the distance with fixed values) allows for it to actually hit a maximum level, rather than just only get asymptotically close. The numbers don't correlate to any real world data other than 'I think when it's belching fire, it should at least look like it has been warmed up some' followed by 'I'm sure it'll be glowing on sensors in short order', and how I feel would best correlate to how quickly a tank would heat up by cooking off. |
_obj setVehicleTIPars [ | ||
((_tiPars select 0) + (_intensity * 0.01))/1.005, | ||
((_tiPars select 1) + (_intensity * 0.004))/1.002, | ||
((_tiPars select 2) + (_intensity * 0.01))/1.005 | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vectorAdd
will be faster than doing select
three times.
_obj setVehicleTIPars [ | |
((_tiPars select 0) + (_intensity * 0.01))/1.005, | |
((_tiPars select 1) + (_intensity * 0.004))/1.002, | |
((_tiPars select 2) + (_intensity * 0.01))/1.005 | |
]; | |
_obj setVehicleTIPars (_tiPars vectorAdd [ | |
(_intensity * 0.01) / 1.005, | |
(_intensity * 0.004) / 1.002, | |
(_intensity * 0.01) / 1.005 | |
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
math is different
(current + add) / 1.05
vs
current + (add/ 1.05)
}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound]] call cba_fnc_addPerFrameHandler; | ||
|
||
private _tiPars = getVehicleTIPars _obj; | ||
_obj setVehicleTIPars [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments as to what the magic numbers indicate
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
When merged this pull request will: