Shouldn't CharacterGetStat be under the IF? It's not an action.
I don't think you can directly check level either, whatever the name is. You could check Experience though.
I'm not sure it would work as an IF check considering CharacterGerStat() shouldn't return a boolean value, but I could be wrong. I'll have to give it a shot. It should be checking what _Char's Level is and then setting the local variable _Level to that float.
Is "Level" the actual name of the CHARACTERSTAT? It's the only thing I can see that might be the issue after a quick glance at your code.
I have no idea, actually. I've tried a bunch of things. Level, Strength, Intelligence, Act, ActPart, etc. They all return a value of 0.
Wasn't able to find a list of possible values for the stats anywhere except the Modifiers.txt under the modifier type "Character" entry and none of those seem to work either.
Also, what exactly are you going for? For the enemy to heal on taking damage? Or is this just a test script?
My girlfriend and I got a bit inspired by your work with Scales and adding the telekinesis skills so we started playing around with the system to try and create some interesting depth with stances.
It's just a test script for now to try to see if certain OnHit abilities can be created.
The big picture was to have new Stances that improve in function for each turn you have them active. Self-escalating buffs that, in this instance, provide large damage bonuses but also large defense/resist negatives. (Turn 1 improves damage by 5%, crit by 3% but also gives -10% to all resistances. Turn 2 improves on this, bigger damage increase and resist decrease, etc.) We were trying create berserker type stances.
Overall this was pretty easy to achieve by writing a quick state machine to check against things like CharacterHasStatus(__Me, STANCE, Boost_ThrillOfBattle) and then CharacterConsume each new buff to override the previous as long as __ME had the Thrill of Battle stance toggled on.
But then we got to thinking that by turn 4 increasing/decreasing stats isn't really... interesting. That's where the test script comes into play. We created some on hit events that trigger OnDamage(_,_,_Char,_) and cause the NPC to consume a damaging effect to basically act as bonus damage or effects. Basically, by turn 4 any time a player with Thrill of Battle's fourth buff hit an NPC, the NPC would consume a self-damage potion for additional damage and by turn 5 the player had a 30% chance to self-heal for 5%.
This all works just fine, so we took it a step further and that's where we've hit this snag.
We were trying to create a range of scaling damage effects based on level. Something like:
OnDamage
If (_playerLevel <= 5)
Consume DamageRank1
Else if (_playerLevel >= 6)
Consume DamageRank2
And that's where the snag shows up. CharacterGetStat only returns a value of 0 when passed the Level parameter. Not sure if we're using CharacterGetStat incorrectly or we're passing the incorrect parameter for CHARACTERSTAT and I wasn't able to find a list of valid parameters for it at all.
... Ahaha.. ha.. Bit of a long post, sorry.
Edit:
//CharacterHeal(_Char, _Level) //not sure what this is for?
I've been using the CharacterHeal() function as a debug log of sorts so I can see when things fire off or not and to check the value of a float since I can't get any of the text display functions to work correctly either, haha.
Edit2:
Just tried using CharacterGetStat() in an IF and only seems to returns "True" and not a value or any kind of function like "if _float == characterstat", so I'm not sure how it could be used like that.
Also tried checking using AirResistance and "AirResistance" under ACTIONS, neither parameter works and returns a value of 0 when it should have been 39 or perhaps 0.39. Neither pass an IsGreaterThen(_stat, 1) or IsGreaterThen(_stat, 0.1) IF check.Scrolled up and took a look at SniperHF's code and it totally works.
Using a Level 11 character:
IF "c1&(c2|c3)"
CharacterGetStat(_Level, _Char, Level)
IsLessThen(_Level, 10)
IsEqual(_Level, 10)
THEN
CharacterHeal(_Char, 1)
ELIF "c1&c2"
CharacterGetStat(_Level, _Char, Level)
IsGreaterThen(_Level, 10)
THEN
CharacterHeal(_Char, 10)
ENDIF
So yeah, apparently it needs to be put under an IF block in conjunction with further checks apparently. Weird.
Mystery solved though, even passing the Level parameter works fine and fires off the ELIF correctly. This opens up quite a bit of range for things we're trying to implement now.
Thanks for all the help. =)