Hey
@Kva3imoda I hope you don't mind but I can't seem to solve this on my own and I think we should ask for help
So hey guys, this is a request for help from 2 modders (Kva and I) who aren't that good with skill-crafting!
Kva's Recombiner unit is supposed to de-spawn if you leave it alone for a short while (10+ seconds). To do this it has 2 skills which it applies to itself upon spawning...
- a KILL skill which watches for a STAT to be '0'
- a WATCHER skill which watches for the PLAYER to be nearby and, it he/she is, adds to the STAT to keep it greater than '0'
I think I have narrowed the problem down to 2 areas: one is the STAT and how it behaves, and the other is the STAT WATCHER skill and why it isn't incrementing the STAT.
1. The STAT 1.A. In the GUTS combatlog, if you start the STAT with a default value of '0' you can see the KILL skill apply the KILL affix immediately (I put the kill effects into an affix so I could monitor their application) and after 5 seconds (the "TIME_TO_HEAL" duration in the affix) the unit dies.
1.B. If you start the stat with a value of '1' the KILL affix does not apply the KILL affix (so the KILL skill including the STATWATCHER part seems to be working properly). The STAT is supposed to decrement itself to '0' after 5 seconds, so that the KILL skill can apply the affix (as in 1.A. above). But the KILL affix never gets applied, which means the STAT did not decrement itself to '0'.
Here is the latest code for the STAT. Hoping someone can critique this pls...
Spoiler (hover to show) [STAT] <STRING>NAME:itemcombiner_watcher_stat <INTEGER64>UNIQUE_GUID:7528896369854758345 <TRANSLATE>DISPLAYNAME:recombiner_stat <STRING>TYPE:TYPE_INT <FLOAT>DEFAULTVALUE:1 <FLOAT>MAXVALUE:1 <FLOAT>INCREMENTVALUE:-1 <FLOAT>DURATION:5 <BOOL>REFRESHES:true [/STAT]
2. The STAT WATCHER/Incrementer Skill This skill uses a looping 10m-range damage shape to check if the PLAYER unit is nearby (EVENT_UNITHIT). If it "sees" the PLAYER the Recombiner uses the skill to apply an ADD STAT affix on itself which increments the STAT by '1'.
The damage shape loops once every second, so even if you start the STAT with default value '0', it should increment to '1' after 1 second if the WATCHER SKILL is working properly (the PLAYER is "seen" and the ADD STAT affix is applied). But since the KILL affix gets applied after 5 seconds (see 1.A. above) I have to assume the WATCHER SKILL is defective somehow. Also, in the combatlog, I never saw the INCREMENTING affix get applied.
I am also hoping someone could critique the components of the WATCHER/INCREMENTER skill...
2.A. The Damage Shape Layout Spoiler (hover to show) [Layout] <INTEGER>VERSION:4 <UNSIGNED INT>COUNT:3 [OBJECTS] [BASEOBJECT] [PROPERTIES] <STRING>DESCRIPTOR:Timeline <STRING>NAME:Timeline1 <INTEGER64>ID:-6122014641013321250 <INTEGER64>PARENTID:-1 <BOOL>LOOPS:true <BOOL>START ON LOAD:false <STRING>NAME:Timeline1 [TIMELINEDATA] <INTEGER64>ID:-6122014641013321250 [TIMELINEOBJECT] <INTEGER64>OBJECTID:-6122014636718353954 [TIMELINEOBJECTEVENT] <STRING>OBJECTEVENTNAME:Enable [TIMELINEPOINT] <FLOAT>TIMEPERCENT:0 <STRING>INTERPOLATION:Linear [/TIMELINEPOINT] [/TIMELINEOBJECTEVENT] [TIMELINEOBJECTEVENT] <STRING>OBJECTEVENTNAME:Disable [TIMELINEPOINT] <FLOAT>TIMEPERCENT:0.5 <STRING>INTERPOLATION:Linear [/TIMELINEPOINT] [/TIMELINEOBJECTEVENT] [/TIMELINEOBJECT] [/TIMELINEDATA] [/PROPERTIES] [/BASEOBJECT] [BASEOBJECT] [PROPERTIES] <STRING>DESCRIPTOR:Damage Shape <STRING>NAME:DamageEffect <INTEGER64>ID:-6122014636718353954 <INTEGER64>PARENTID:-1 <STRING>MAX RADIUS:0,10 <BOOL>ENABLED:true <STRING>UNITTYPE:PLAYER <STRING>ALIGNMENT:GOOD <BOOL>DOT:false <INTEGER>LOOPS:true [/PROPERTIES] [CHILDREN] [/CHILDREN] [/BASEOBJECT] [/OBJECTS] [/Layout]
2.B. The Skill .DAT Spoiler (hover to show) [SKILL] <STRING>NAME:RECOMBINER_WATCHER_SKILL <STRING>ACTIVATION_TYPE:PASSIVE <STRING>TARGET_ALIGNMENT:GOOD <STRING>TARGET:SELF <FLOAT>TURNRATEOVERRIDE:-1 <BOOL>CAN_BE_SILENCED:0 <INTEGER64>UNIQUE_GUID:8955473621436648416 <BOOL>DONT_TARGET_SMASHABLES:true <BOOL>DONT_STOP_ON_DEATH:true <FLOAT>FINDTARGETANGLE:360 [LEVEL1] [EVENT_START] <STRING>FILE:media/skills/REMCOMBINER/RECOMBINER_WATCHER_SKILL.layout [/EVENT_START] [EVENT_UNITHIT] [AFFIXES] <STRING>TARGET:SELF <STRING>AFFIX:RECOMBINER_WATCHER_AFFIX [/AFFIXES] [/EVENT_UNITHIT] [EVENT_UNITHIT] <STRING>FILE:media/skills/arbiter/flameaura/strike.layout <BOOL>NOSTEALEFFECTS:true <BOOL>ATTACHTOTARGET:true [/EVENT_UNITHIT] [/LEVEL1] [/SKILL]
and finally the
2.C. Incrementing Affix Spoiler (hover to show) [AFFIX] <STRING>NAME:RECOMBINER_WATCHER_AFFIX <INTEGER>RANK:0 <INTEGER>MIN_SPAWN_RANGE:0 <INTEGER>MAX_SPAWN_RANGE:100 <FLOAT>DURATION:-1 <INTEGER>WEIGHT:0 <INTEGER>SLOTS_OCCUPY:0 [EFFECT] <STRING>NAME:itemcombiner_watcher_stat <STRING>ACTIVATION:DYNAMIC <STRING>DURATION:INSTANT <STRING>TYPE:ADD STAT <FLOAT>MIN:1 <FLOAT>MAX:1 <FLOAT>CHANCE:100 [/EFFECT] [/AFFIX]
Any help would be greatly appreciated!