• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Adding/Changing Ability data fields?

Status
Not open for further replies.
Level 5
Joined
Dec 15, 2010
Messages
115
Is this possible? I was attempting to make a custom hero and I wanted a self cast armor ability that increases armor and grants a health regeneration bonus (Think Spiked Carapace only with the HP regen instead of reflect damage), there are no base abilities, as far as I could find, that have both of those fields making it impossible for me.

Is there a way to add/change them?
 
Level 5
Joined
Nov 30, 2010
Messages
184
You can use triggers to help you achieve this. All you need is a base skill. Let's say... Devotion aura. This immediately settles the armor part. Change the skill so that it only affect your hero. For the regen part, use a trigger that adds extra regen when devotion aura is skilled. It should be easy to do this. Use periodic event for the event and use ability comparison for the condition.
You could also give the hero unholy aura when the devotion aura is skilled(unholy aura gives both up regen and movement speed so remember to remove the speed.
When devotion aura is level 2 use the action set skill level of unholy aura to 2

Give rep points to those who have helped you ^^
 
Level 5
Joined
Dec 15, 2010
Messages
115
I was afraid of that : / Thanks a bunch though I will look in to it.

Edit: I'm still a little confused about commands, like I am not sure where/what the new stats ones are. For example when I made a new hero, as terrible as I am, I was able to make a trigger that limited that type of unit to 1 to prevent making a ton of them, but I am at a loss of what to do here.

I get what the first reply is saying perfectly, I just don't know which trigger commands handle it.
 
Last edited:
Level 5
Joined
Nov 30, 2010
Messages
184
Sorry. I just joined hive so I did not know that. Also, I see a lot of other people doing that.

Also if you need help making this skill, I'll be glad to help you make it ^^
 
Level 5
Joined
Dec 15, 2010
Messages
115
Also if you need help making this skill, I'll be glad to help you make it ^

That would be nice since I am a n00b at this. Now when I made the simple unit limit trigger I just did Action > Player > Limit training of (Hero) to 1 for Player 1. (I can add more for other players if I ever bother letting others use the map).

But I don't see a "Add stat to" kind of thing, so I am assuming they are not so obvious like the above. My question is what triggers handle this?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This will give 4 hp regeneration per second per ability level:


  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
  • Untitled Trigger 049
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to *your ability*
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to group
      • Set i1 = (Level of *your ability* for (Target unit of ability being cast))
      • Trigger - Turn on Untitled Trigger 050 <gen>
      • Custom script: call SaveInteger( udg_Hash , GetHandleId(GetTriggerUnit()) , StringHash("level") , udg_i1)
  • Untitled Trigger 050
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) has buff *your ability's buff*) Equal to True
            • Then - Actions
              • Custom script: set udg_i1 = LoadInteger( udg_Hash , GetHandleId(GetEnumUnit()) , StringHash("level") )
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (4.00 x (Real(i1))))
            • Else - Actions
              • Unit Group - Remove (Picked unit) from group
              • Custom script: call FlushChildHashtable( udg_Hash , GetHandleId(GetEnumUnit()))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


You need the following variables:

i1 (integer)
Hash (hashtable)
group (unit group)
 
Level 5
Joined
Dec 15, 2010
Messages
115
This will give 4 hp regeneration per second per ability level:

<Triggers>

You need the following variables:

i1 (integer)
Hash (hashtable)
group (unit group)

o_O

Thanks dude, I would of never figured that one out. I would ask for an explanation so I could do stuff like this myself in the future, but I think it's beyond me at them moment : /

Thanks again. One question though, I would assume I have to do this 3 times one for each level? (Increasing the HP regen for each rank)
 
Level 5
Joined
Dec 15, 2010
Messages
115
ok I actually went to do this (Since I couldn't earlier) and I am still a little confused since I can't get all of those options since some seem to crash the editor : /

Sorry to be a complete idiot at this.
 
Last edited:
Level 5
Joined
Dec 15, 2010
Messages
115
I named the variables the same thing you did for the sake of making it easier. I am not sure how you posted them (The triggers) on the forums, but idk how so I took some screen shots of it.

http://tinypic.com/r/i6z2bo/7

(1) It says the same, but the create hashtable thing isn't a "?". I have no idea if this effects it or not.

http://tinypic.com/r/25psh15/7

(2) & (3) Doesn't match up with yours, I did something wrong.

http://tinypic.com/r/28i3ll5/7

(3), (4), (5), (6), (7) Again, they don't match I did something wrong.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
The first isn't really a problem. :p

2./3(2)./6./7. What Maker intended for you to do was to use a global group variable. So just create one and replace (Last create group) with your own.

3(1). It's supposed to get the level of the ability you're using for this. You got the level of the unit instead. Just go down one from there.

4. Use Picked unit instead of Triggering unit. Don't forget to change the line below this one as well.

5. This one is a bit tricky. When you set the life, you'll have to go to Arithmetic in order to add. Then just put the correct values.

Also, to make your life easier, you can easily copy triggers by right clicking on the trigger name and do Copy as Text. (The Trigger Name I'm talking about is below "Trigger Functions:".) When you copy the text into here, just use the trigger tags. (Looks like a gear icon on the top of posting messages.)
 
Level 5
Joined
Dec 15, 2010
Messages
115
Hmm I got it all squared away now exactly but the ability isn't receiving the life regen bonus for whatever reason.
 
Level 5
Joined
Nov 30, 2010
Messages
184
I looked at the triggers and thought of learning it too as it seems useful. However, I do not know what the hashtables for. It seems redundant. Can you tell me what it does?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Hmm I got it all squared away now exactly but the ability isn't receiving the life regen bonus for whatever reason.

Post the triggers.

I looked at the triggers and thought of learning it too as it seems useful. However, I do not know what the hashtables for. It seems redundant. Can you tell me what it does?

The hashtable is for saving data. It's very easy to save integers, effects, booelans and so on for later use. Since data is keyed with parent- and child keys, it's not likely that one accidentally overwrites the needed data.
 
Level 5
Joined
Dec 15, 2010
Messages
115
Post the triggers.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
      • Player - Limit training of Battlemaster to 1 for Player 1 (Red)
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Create starting units (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Melee Game - Enforce victory/defeat conditions (for all players)
  • Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Armor
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to group
      • Set i1 = (Level of Dark Armor for (Target unit of ability being cast))
      • Trigger - Turn on Trigger 002 <gen>
      • Custom script: call SaveInteger( udg_Hash , GetHandleId(GetTriggerUnit()) , StringHash("level") , udg_i1)
  • Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) has buff Dark Armor ) Equal to True
            • Then - Actions
              • Custom script: set udg_i1 = LoadInteger( udg_Hash , GetHandleId(GetEnumUnit()) , StringHash("level") )
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (4.00 x (Real(i1))))
            • Else - Actions
              • Unit Group - Remove (Picked unit) from group
              • Custom script: call FlushChildHashtable( udg_Hash , GetHandleId(GetEnumUnit()))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
You will have to forgive the generic uncreative unit/ability names since I'm actually figuring those out last.
 
Level 5
Joined
Dec 15, 2010
Messages
115
Still no luck even with the change : /

Oh well idk at this point. Thanks you very much for your time, this site is very friendly.
 
Level 5
Joined
Dec 15, 2010
Messages
115
Here's a test map.

I'm a little confused, in the map you sent me it appears to be just like the normal inner fire ability (You target the unit you want to give the buff to or autocast it). What I meant was a self passive buff (Like Spiked Carapace) where instead of the "Armor + Damage Reflect" it would be "Armor + HP Regen". Although basing it off Spiked Carapace itself makes more sense now that I think about it, but it still doesn't have the regen aspect.

That's why I was attempting to base it off of devotion aura, since half the stuff is already there (You can change the range to zero to remove the aura effect and make it self only), it just didn't have an HP regen field.

Again, sorry for being so terrible : / Must be annoying at this point.
 
Level 5
Joined
Dec 15, 2010
Messages
115
Then add the +armor as a passive ability in hidden spell book.

Sorry for being terrible again, but how do I do that exactly? How can I tie it to the unholy aura buff?
 
Last edited:

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
There is one more simple way to do it. A trigger:
[trigger=My Trigger]
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Undead Crypt Lord - Spiked Carapace
Actions
Unit - Add Item Life Regeneration to (Triggering unit)[/trigger]

I think that there's no easier way to do it. When the Hero gains that skill, he will simply get ability Life Regeneration, which will increase the unit's health regeneration =)
"Life Regeneration" is an Item ability, you can make a new one to balance it out.
Tested it and works ^^
 
Level 5
Joined
Dec 15, 2010
Messages
115
There is one more simple way to do it. A trigger:
[trigger=My Trigger]
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Undead Crypt Lord - Spiked Carapace
Actions
Unit - Add Item Life Regeneration to (Triggering unit)[/trigger]

I think that there's no easier way to do it. When the Hero gains that skill, he will simply get ability Life Regeneration, which will increase the unit's health regeneration =)
"Life Regeneration" is an Item ability, you can make a new one to balance it out.
Tested it and works ^^

Alright this works wonders, I got one last question (Sorry :( ) Is there anyway to increase it with levels? I attempted increasing the items levels, but it doesn't effect it.
 
Level 8
Joined
Apr 8, 2009
Messages
499
.... use inner fire and set targets to self only?

unless i'm mistaken, inner fire gives a set armor bonus. health regeneration and % damage bonus (which can be set to 0)....

perfect base right? not sure if it was ment to be a passive/active ability tho...
 
Status
Not open for further replies.
Top