Hi everyone!
last time ive modded was in april, everything worked fine then with the tags.
Ive started to play again with one of my mods and it stopped working, ive testen alot of possible issues i could imagein, ive also reverted to the OXCE version i used back in the day without luck.
Since i cannot image what might got wrong i kindly ask for help.
This is a little submod of mine for xpiratez. I REALLY DISLIKE hurting animals, even in video-games, therefor i made this mod which renders dogs, which would normaly die, unconscious.
The issue i see is that the tag i add to the BattleUnit STR_DOGG_TERRORIST (Tag: UNIT_LIVES_FOREVER: 1) is not available within the script-sections "damageUnit"-event.
To test this i debugged the value, also ive tested that script again by hard setting the UNIT_LIVES_FOREVER to the value of 1, which then triggered the desired effect correctly.
What might be wrong here?
Shouldnt the value for the tag always be 1 on the script in case the damaged BattleUnit is a STR_DOGG_TERRORIST?
The unit type is correct, the script gets triggered but the units tag value is always 0
Debug unit: BattleUnit(type: "STR_DOGG_TERRORIST" race: "STR_DEMON" id: 1000002 faction: Hostile hp: 25/25)
Another test i made was changing the units race to see if any changes i made via "units:" are applied, result is that changes apply
Here is the script:
units:
- type: STR_DOGG_TERRORIST
race: STR_DEMON
tags:
UNIT_LIVES_FOREVER: 1
extended:
tags:
BattleUnit:
UNIT_LIVES_FOREVER: int
scripts:
damageUnit:
- offset: 1
code: |
# Inits
var int stunSummed;
var int liveForever;
var int armorForever;
var int unitCurrStun;
var int unitMaxStun;
# Load game values into variables
unit.getStun unitCurrStun;
unit.getStunMax unitMaxStun;
# DEBUG TEST
#unit.setTag Tag.UNIT_LIVES_FOREVER 1;
# Fetch unit-tag
unit.getTag liveForever Tag.UNIT_LIVES_FOREVER;
# DEBUG
debug_log "UNIT: " unit;
debug_log "LF_STATE: " liveForever;
# Check if this unit shouldnt die
if gt liveForever 0;
# Transfer health-damage to stun-damage
if gt to_health 0;
set to_stun to_health;
set to_health 0;
add stunSummed to_stun;
add stunSummed unitCurrStun;
# Never overstun
if gt stunSummed unitMaxStun;
set to_stun unitMaxStun;
end;
end;
# Never bleed
if gt to_wound 0;
set to_wound 0;
end;
end;
return;
Ive installed only xpirates and my submod.
Any help would be appriciated!
Thanks