OpenXcom Forum
Modding => OXCE Support => OpenXcom Extended => OXCE Support Y-scripts => Topic started by: Nord on September 14, 2023, 08:37:11 pm
-
Hi. I have a pair of questions:
1. Which ScriptHook is used when fire damage ignites a unit? (So we can influence this process?)
2. Which ScriptHook is used for stun damage from standing in smoke?
Because "HitUnit", as i see, does not work.
Thanks.
-
`damageUnit` is thing you look for.
-
`damageUnit` is thing you look for.
Are you sure? Because when fire bullet hits energy shield, and shield reduces bullet power to 0 (shield script uses hitUnit), a unit still become burning.
-
Ok, I do not read carefully, my aswer was for fire and smoke environment damage (env fire catching is not scripted yet).
For handing fire during hit, there is special hook `damageSpecialUnit`that is repressible for this and other "post processing" of unit hit.
-
Ok, I do not read carefully, my aswer was for fire and smoke environment damage (env fire catching is not scripted yet).
For handing fire during hit, there is special hook `damageSpecialUnit`that is repressible for this and other "post processing" of unit hit.
Aha, seems that my saved "verbose log" is outdated. Thanks, going to make new one.
-
Well...
How do i can forbid unit to burn?
"unit.setFire 0;" does nothing.
Sorry for doubleposting.
-
Setting this you set fire that was "before" this hook call, as right after this hook engine code call `unit.setFire X` and override that you set there.
Whole point of this hook is expose `fire` variable that allow you to alter it for engine and it will be set on unit.
-
Setting this you set fire that was "before" this hook call, as right after this hook engine code call `unit.setFire X` and override that you set there.
Whole point of this hook is expose `fire` variable that allow you to alter it for engine and it will be set on unit.
Ok, thanks.
So, if i want to prevent my unit from start burning, this script hook will not help me?
Then as i understand, ignition of units standing in fire is hardcoded?
-
So, if i want to prevent my unit from start burning, this script hook will not help me?
This script can help you.
But instead of using setFire yourself, you should just set the value of the output parameter(s) that will then call setFire for you.
What you're doing now:
1. game calculates duration of fire to be for example X = 7
2. you call setFire 0
3. game calls setFire X (7)
What you should be doing instead:
1. game calculates duration of fire to be for example X = 7
2. you change X from 7 to 0
3. game calls setFire X (0)
Then as i understand, ignition of units standing in fire is hardcoded?
yes, Yankes said above that the catching on fire from environment is not scripted yet
only hits by projectiles and explosions are scripted
you can still make the armor fire-proof, and the unit will not catch on fire then
-
...
What you're doing now:
1. game calculates duration of fire to be for example X = 7
2. you call setFire 0
3. game calls setFire X (7)
...
Ok, i dont understand that. One thing missing: what is "X" from this example in the terms of script? Maybe you mean "BattleUnit.setFire" in the "newTurnUnit" script hook?
-
In terms of script, it is the 6th input/output parameter of the "damageSpecialUnit" hook, called "fire".
The one highlighted in the screenshot.
-
So, command will be
set fire 0;
Have tried. Did not work.
-
Can you paste the whole script?
And also describe in which scenario did you test it?
-
I just tried this and it works without problems:
extended:
scripts:
damageSpecialUnit:
- offset: 88 # Script to disable setting units on fire by projectiles and explosions
code: |
set fire 0;
return;
I sprayed my rookies with Autocannon Incendiary rounds and none of them caught on fire.
-
Thanks, maybe i did something wrong. Will try again.