• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Trigger] Increasing a heros health using upgrades/triggers

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
  • Increase Heroes Constitution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Increase Constitution
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current lumber) Greater than or equal to 1
        • Then - Actions
          • Player - Add -1 to (Owner of (Triggering unit)) Current lumber
          • Set HERO_Constitution[(Player number of (Owner of (Triggering unit)))] = (HERO_Constitution[(Player number of (Owner of (Triggering unit)))] + 1)
          • Player - Set the current research level of Increase Constitution to (HERO_Constitution[(Player number of (Owner of (Triggering unit)))] + 1) for (Owner of (Triggering unit))
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) for 1.00 seconds the text: You've insufficient...
To me, this seems like a working trigger. Maybe it's just the upgrade I'm using, although everything there seems fine aswell. I know this is a place for triggers but I had might aswell post this up

The upgrade was originally Animal War Training. Can anyone tell me why this wouldn't work?

Increase Constitution Upgrade Data

Data - Effect 1
Data - Effect 1 - Hit Point bonus - Increment
Data - Effect 1 - Hit Point Bonus - Base
Data - Effect 2 - None
Data - Effect 3 - None
Data - Effect 4 - None
Stats - Applies to all units - True
Stats - Class - None
Stats - Gold Base - 0
Stats - Gold Increment - 0
Stats - Levels - 100
Stats - Lumber Base - 0
Stats - Lumber Increment - 0
Data - Race - Human
Stats - Time Base - 0
Stats - Time Increment - 0
Stats - Transfer with Unit Ownership - True
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
um this adds one then sets it to that plus 1.
Set HERO_Constitution[(Player number of (Owner of (Triggering unit)))] = (HERO_Constitution[(Player number of (Owner of (Triggering unit)))] + 1)
Player - Set the current research level of Increase Constitution to (HERO_Constitution[(Player number of (Owner of (Triggering unit)))] + 1) for (Owner of (Triggering unit))
Eg first cast will set it to level 2, second to level 3 etc. You probably did not mean the extra +1 when setting the upgrade level.

Make sure the hero is configured to be affected by the upgrade in his data. I do not think all units sufices.
 
Level 7
Joined
Dec 8, 2008
Messages
243
Ah, I see. Here's guessing I make the hero effected by the upgrade in the unit's data? And how will it always increaes by 2? I've set it to only increase by 1.

[edit] kk, I added it to Techtree - Upgrades used, and it didn't work. Any suggestions?
 
Ah, I see. Here's guessing I make the hero effected by the upgrade in the unit's data? And how will it always increaes by 2? I've set it to only increase by 1.


you havent read DSG's explanation do you?

you set HERO_Constitution to HERO_Constitution +1 and then you set upgrade level to HERO_Constitution + 1 so basically you added 1 for two times...
basically: Upgrade level = Hero_con* + 1 (hero_con* == hero_con + 1)

just set upgrade level to HERO_Constitution since you already added 1 to HERO_Constitutionn...
 
Level 7
Joined
Dec 8, 2008
Messages
243
you havent read DSG's explanation do you?

you set HERO_Constitution to HERO_Constitution +1 and then you set upgrade level to HERO_Constitution + 1 so basically you added 1 for two times...
basically: Upgrade level = Hero_con* + 1 (hero_con* == hero_con + 1)

just set upgrade level to HERO_Constitution since you already added 1 to HERO_Constitutionn...

Doh, I see now. But I still can't get it to work. The heroes health isn't increasing when I trigger it to.
 
Doh, I see now. But I still can't get it to work. The heroes health isn't increasing when I trigger it to.

I tried to make it and it worked for me...

are you sure you set a value to hit point bonus base and increment? base is the bonus at level 1 and increment will be the bonus on the next levels...

and have you set a default value for the Hero_Con in the variable manager?
 
Level 7
Joined
Dec 8, 2008
Messages
243
Kk, never mind. Got it to work. I had so much going on in my starting trigger that it took awhile for the ability to set itself to what it is.
 
Status
Not open for further replies.
Top