Custom Hero - Custom Skill, Trigger Integer Variable error

Slayerxx

You can change this now in User CP.
Reaction score
3
Hey all, So This custom hero i started a while ago, i have come back to i reviewed what i had did and most of it is good though here is the issues.

So i started work on the Second Skill - "Change Hero Attack Stance" as the name suggests it changes the attack stance, in this case it switch's the hero "Human - Arthas" to hero "Human - Arthas(frostmourne)" these to models are the base for each attack stance.

The ability it self works fine, it switches the hero's back and forth, with the right hp and manna xp etc Percentage, though here is the issues. If a skill is level 0-1 (eg not learnt or has one point in it) It will carry over right when the attack stance is changed, (replacing the unit, and resetting sats). Though when any skill has is level 2 or more, when you change attack stance the level of the unit will change, but the skill will reset to level 1 and the excess points, are added to unspent, hero point counter.

For example, I train, and level my hero to level 2, taking my 1st point, in attack stance, and 2nd, in Devotion Aura. When i change my attack stance my skills, level will all carry over and level correctly. Now i now level to 3, and point a point, in Devotion Aura. leaving, my Skills at 0/1/2/0. When i change my attack stance, It changes the unit, and carrys the learnt skills over, and health and mana percentages. though now i will be level 4 with 1 unspent skill point, and my skills will be 0/1/1/0.

First here is all my custom trigger data.

Trigger - Set Spells
Trigger:
  • Set Spells
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Arthas - Slow Strong
    • Actions
      • Set Hero_Level = (Hero level of (Trained unit))
      • Set Hero_Spells[0] = Holy Light
      • Set Hero_Spells_Level[0] = 0
      • Set Hero_Spells[1] = Attack Stance Change
      • Set Hero_Spells_Level[1] = 0
      • Set Hero_Spells[2] = Devotion Aura
      • Set Hero_Spells_Level[2] = 0
      • Set Hero_Spells[3] = Resurrection
      • Set Hero_Spells_Level[3] = 0
      • Set USlow_Strong_Hero = (Trained unit)
      • Unit - Create 1 Arthas - Fast Weak for (Owner of (Trained unit)) at ((Position of (Trained unit)) offset by (100.00, 100.00)) facing Default building facing degrees
      • Set UFast_Weak_Hero = (Last created unit)
      • Unit - Remove (Last created unit) from the game
      • Wait 2.00 seconds
      • Game - Display to (All players) the text: Use The Lever To Te...
      • Cinematic - Ping minimap for (All players) at (Position of Lever 0000 <gen>) for 5.00 seconds


Trigger - Hero Level
Trigger:
  • Hero Level
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Leveling Hero) Equal to UFast_Weak_Hero
        • Then - Actions
          • Set Hero_Level = (Hero level of (Leveling Hero))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Leveling Hero) Equal to USlow_Strong_Hero
        • Then - Actions
          • Set Hero_Level = (Hero level of (Leveling Hero))
        • Else - Actions


Trigger - Spell Levels
Trigger:
  • Spell Levels
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learning Hero) Equal to USlow_Strong_Hero
        • Then - Actions
          • -------- Hero Skill 0 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Holy Light
            • Then - Actions
              • Set Hero_Spells_Level[0] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Attack Stance Change
            • Then - Actions
              • Set Hero_Spells_Level[1] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Human Paladin - Devotion Aura
            • Then - Actions
              • Set Hero_Spells_Level[2] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 3 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Human Paladin - Resurrection
            • Then - Actions
              • Set Hero_Spells_Level[3] = (Learned skill level)
            • Else - Actions
          • Set USlow_Strong_Hero = (Learning Hero)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learning Hero) Equal to UFast_Weak_Hero
        • Then - Actions
          • -------- Hero Skill 0 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Human Paladin - Holy Light
            • Then - Actions
              • Set Hero_Spells_Level[0] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Attack Stance Change
            • Then - Actions
              • Set Hero_Spells_Level[1] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Human Paladin - Devotion Aura
            • Then - Actions
              • Set Hero_Spells_Level[2] = (Learned skill level)
            • Else - Actions
          • -------- Hero Skill 3 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Learned Hero Skill) Equal to Human Paladin - Resurrection
            • Then - Actions
              • Set Hero_Spells_Level[3] = (Learned skill level)
            • Else - Actions
          • Set UFast_Weak_Hero = (Learning Hero)
        • Else - Actions


Trigger - Change Stance (Believe Issue is here somewhere)
Trigger:
  • Change Stance
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Attack Stance Change
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Casting unit) Equal to UFast_Weak_Hero
        • Then - Actions
          • Unit - Replace (Casting unit) with a Arthas - Slow Strong using The old unit's relative life and mana
          • Hero - Set (Last replaced unit) Hero-level to Hero_Level, Hide level-up graphics
          • Set USlow_Strong_Hero = (Last replaced unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[0] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for USlow_Strong_Hero: Human Paladin - Holy Light
              • Unit - Set level of Hero_Spells[0] for USlow_Strong_Hero to Hero_Spells_Level[0]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[1] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for USlow_Strong_Hero: Attack Stance Change
              • Unit - Set level of Hero_Spells[1] for USlow_Strong_Hero to Hero_Spells_Level[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[2] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for USlow_Strong_Hero: Human Paladin - Devotion Aura
              • Unit - Set level of Hero_Spells[2] for USlow_Strong_Hero to Hero_Spells_Level[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[3] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for USlow_Strong_Hero: Human Paladin - Resurrection
              • Unit - Set level of Hero_Spells[3] for USlow_Strong_Hero to Hero_Spells_Level[3]
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Casting unit) Equal to USlow_Strong_Hero
        • Then - Actions
          • Unit - Replace (Casting unit) with a Arthas - Fast Weak using The old unit's relative life and mana
          • Hero - Set (Last replaced unit) Hero-level to Hero_Level, Hide level-up graphics
          • Set UFast_Weak_Hero = (Last replaced unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[0] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for UFast_Weak_Hero: Human Paladin - Holy Light
              • Unit - Set level of Hero_Spells[0] for UFast_Weak_Hero to Hero_Spells_Level[0]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[1] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for UFast_Weak_Hero: Attack Stance Change
              • Unit - Set level of Hero_Spells[1] for UFast_Weak_Hero to Hero_Spells_Level[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[2] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for UFast_Weak_Hero: Human Paladin - Devotion Aura
              • Unit - Set level of Hero_Spells[2] for UFast_Weak_Hero to Hero_Spells_Level[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Hero_Spells[3] for (Casting unit)) Greater than 0
            • Then - Actions
              • Hero - Learn skill for UFast_Weak_Hero: Human Paladin - Resurrection
              • Unit - Set level of Hero_Spells[3] for UFast_Weak_Hero to Hero_Spells_Level[3]
            • Else - Actions
        • Else - Actions


I Started, A new Trigger set using Game Cache though stopped as i thought i had the issue solved. I tried. Different reference types for setting and assigning skill levels, and such.

If required, i can add a link for map download. Thanks You
 

Solu9

You can change this now in User CP.
Reaction score
216
Is there a reason to why you don't use Metamorphosis or Bear Form to change the stances?
It will make your "Stance Change" spell more than trivial to create.


If you insist on triggering it all.

  • Hero - Learn skill for USlow_Strong_Hero: Human Paladin - Holy Light
  • Unit - Set level of Hero_Spells[0] for USlow_Strong_Hero to Hero_Spells_Level[0]
The strong hero already has the Holy Light ability right?
Have you tried to remove the first line (from what I just linked) and simply set the spell level?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top