• 🏆 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!

Setting up the Attributes of a Hero per level up

Status
Not open for further replies.
Level 4
Joined
May 16, 2009
Messages
61
Is there a way I can set up the heroes I make so that they have unique attribute gains per level while using only one veterancy?

So while Hero1 may gain only 1.9 str, 2.2 agil, and 2.7 int
Hero 2 gains 2.9 str, 1.2 agil, and 1.7 int

I ask this because I made a trigger that shows the stacks each buff has on a unit however I had to use If checks to remove Strength, Agility, and Intelligence attributes because the trigger editor only allows us to specify behaviors not buffs and so I do not want to make an If check to exclude the veterancy for EVERY SINGLE hero in my map

If not is there any way to exclude attributes and veterancies from a list of behaviors a unit has without specifying each in an If check
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
the trigger editor only allows us to specify behaviors not buffs
This is not true... You can use the Catalog natives to detects what scope a data element is.
If not is there any way to exclude attributes and veterancies from a list of behaviors a unit has without specifying each in an If check
Yes there is... You use the Catalog natives to do this.

Code:
native string CatalogEntryScope (int catalog, string entry);
catalog is an integer reference to the specific catalog the data is in.
entry is just the reference string to the data you want the scope of.

The returned value is a string which is unique for each scope within a single catalog.
A scope is the super element of all catalog entries and is itself an entry in the catalog. You will find the parent of a lot of entries is also it's scope. It is impossible to declare new scopes as far as I know (they interact with the game enigne in a hard coded way).
 
Level 4
Joined
May 16, 2009
Messages
61
So how do I use that? Would it be like
  • General - For each integer Variable from 1 to Total Behaviors with increment 1, do (Actions)
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Catalog Behaviors entry (Catalog Catalog entry at index Variable) scope) != CBehaviorVeterancy
        • Then
  • Do Something
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
Catalog Catalog entry at index Variable
Replace that with the behaviour entry identifier string from the unit's behaviour list. (not real code but idea).

Thus you..
1. Itterate through all behaviours effecting a unit.
2. Test the behaviour scope on every itteration.
3. If the behaviour scope passes, you display it or do whatever.
 
Status
Not open for further replies.
Top