1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Altering Hero Stats For Noobs

Discussion in 'Trigger (GUI) Editor Tutorials' started by Faith, May 1, 2013.

  1. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    ALTERING STATS FOR NOOBS
    ~Created by Archange1
    REQUIREMENTS
    • A medium-level understanding of the World Editor
    • Understanding of the creation of basic Events, Conditions, and Actions
    • The ability to read and process information
    • An idea of what you want to do in your map
    CREDITS
    • Chaosy
    • PurgeandFire111
    INTRODUCTION


    The purpose of this tutorial is to show you how to add stats from a hero using a variety of methods.

    This is different from the normal green text that you'll see next to a hero's stats.

    This is a PERMANENT bonus.



    Despite the title, I WILL be showing other methods of doing such things with simple ease.

    I'll also be explaining how to remove stats and possibly re-add the stat points to the hero.



    OVERALL DIFFICULTY - EASY
    [/tr]




    METHOD ONE - Adding Stats Using Hero Abilities METHOD TWO - Adding Stats Using Dialog Buttons
    ~Method Difficulty - EASY ~Method Difficulty - EASY
    With this method, every time an ability is learned by the hero, their chosen stat will increase by X,

    with X being a number of your choosing to increase the stats by.



    To start, you'll want to create 3 dummy abilities based off of Attribute Bonus.

    The base ability doesn't HAVE to be attribute bonus, simply one that can be 'hidden'.



    Next, set the max level of each ability to the game's max hero level divided by 3.


    If you don't set the max level high enough, some stat points may be lost.

    To avoid this, have enough total available levels to exceed the maximum hero level.


    Next you'll create a trigger similar to this, changing values as needed.

    • Stat Gain
      • Events
        • Unit - A unit Learns a skill
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Learned Hero Skill) Equal to Gain Strength
            • (Learned Hero Skill) Equal to Gain Agility
            • (Learned Hero Skill) Equal to Gain Intelligence
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Learned Hero Skill) Equal to Gain Strength
          • Then - Actions
            • Hero - Modify Strength of (Triggering unit): Add X
            • Unit - Remove Gain Strength from (Triggering unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Learned Hero Skill) Equal to Gain Agility
              • Then - Actions
                • Hero - Modify Agility of (Triggering unit): Add X
                • Unit - Remove Gain Agility from (Triggering unit)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Learned Hero Skill) Equal to Gain Intelligence
                  • Then - Actions
                    • Hero - Modify Intelligence of (Triggering unit): Add X
                    • Unit - Remove Gain Intelligence from (Triggering unit)
                  • Else - Actions



    Now let me explain this a little bit.

    This part is used for making sure the trigger isn't fired every time a unit gains an ability.



    • Or - Any (Conditions) are true
      • Conditions
        • (Learned Hero Skill) Equal to Gain Strength
        • (Learned Hero Skill) Equal to Gain Agility
        • (Learned Hero Skill) Equal to Gain Intelligence



    It saves on memory a little bit, but really isn't required.

    This next part is used for ensuring it's choosing the correct stat.



    • (Learned Hero Skill) Equal to Gain Stat



    That part IS required, so don't miss it.

    After that, we go through the actualy setting of the stats, and the removal of the ability.



    • Then - Actions
      • Hero - Modify Stat of (Triggering unit): Add X
      • Unit - Remove Gain Stat from (Triggering unit)



    Now, obviously here, "Stat" is the stat that you want to increase.

    It corresponds to the ability you used to trigger the increase.



    If you want to be able to SUBTRACT stats from the hero, simply change "Add" to "Subtract" like the example below.



    • Hero - Modify Stat of (Triggering unit): Subtract X



    If you want to refund the Attribute Point back to the hero create the following action.



    • Hero - Modify unspent skill points of (Triggering unit): Add 1 points



    You'll need to associate this with a seperate ability, likely just a copy with a different name/description.
    This method is STRICTLY an example, and can easily be improved upon.

    It's used more to show you the things to consider when making your own system.


    This system essentially does the same thing as method one,

    without tying up the option to use hero abilities.


    It creates a simple dialog with four buttons allowing you to gain stats a different way.



    The downside to this is it requires more than one trigger to function.




    To start, you should create a few variables that I've listed for you below.



    Name Type Array
    Hero Unit False
    Dialog Dialog False
    DialogButton Dialog Button False
    AttPointInt Integer False




    After creating all the variables, you'll need to configure your dialog similar to this.



    • DialogCreate
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • Set Hero = Paladin 0001 <gen>
        • Dialog - Clear Dialog
        • Dialog - Hide Dialog for Player 1 (Red)
        • Dialog - Change the title of Dialog to (Available Attribute Points: + (String(AttPointInt)))
        • Dialog - Create a dialog button for Dialog labelled Strength
        • Set DialogButton[1] = (Last created dialog Button)
        • Dialog - Create a dialog button for Dialog labelled Agility
        • Set DialogButton[2] = (Last created dialog Button)
        • Dialog - Create a dialog button for Dialog labelled Intelligence
        • Set DialogButton[3] = (Last created dialog Button)
        • Dialog - Create a dialog button for Dialog labelled Cancel
        • Set DialogButton[4] = (Last created dialog Button)



    "Hero" is the unit you want to gain the stats.

    You don't have to set it here, but keep in mind it will be used later.



    Next you want to create the trigger that will show the dialog.

    Again, this is a really simple version, and can easily be improved upon.



    • Dialog Show
      • Events
        • Player - Player 1 (Red) skips a cinematic sequence
      • Conditions
      • Actions
        • Dialog - Show Dialog for Player 1 (Red)



    With this, when the trigger player presses ESC then the dialog will be shown.

    It's really as simple as that, although you can put more into it.



    Now, before we go into the dialog buttons, we'll need to create a counter.

    The example below is an EXTREMELY basic counter but it works well enough.



    • PointTracking
      • Events
        • Unit - A unit Gains a level
      • Conditions
        • ((Triggering unit) is A Hero) Equal to True
      • Actions
        • Set AttPointInt = (AttPointInt + 1)



    Every time your hero gains a level, they'll get one more point to spend.



    Next you'll want to create the handle for the buttons.

    This will make the dialog buttons actually do something when they're clicked.



    • Dialog Activate
      • Events
        • Dialog - A dialog button is clicked for Dialog
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to DialogButton[1]
            • AttPointInt Greater than 0
          • Then - Actions
            • Set AttPointInt = (AttPointInt - 1)
            • Hero - Modify Strength of Hero: Add 1
            • Dialog - Hide Dialog for Player 1 (Red)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clicked dialog button) Equal to DialogButton[2]
                • AttPointInt Greater than 0
              • Then - Actions
                • Set AttPointInt = (AttPointInt - 1)
                • Hero - Modify Agility of Hero: Add 1
                • Dialog - Hide Dialog for Player 1 (Red)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Clicked dialog button) Equal to DialogButton[3]
                    • AttPointInt Greater than 0
                  • Then - Actions
                    • Set AttPointInt = (AttPointInt - 1)
                    • Hero - Modify Intelligence of Hero: Add 1
                    • Dialog - Hide Dialog for Player 1 (Red)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Clicked dialog button) Equal to DialogButton[4]
                      • Then - Actions
                        • Dialog - Hide Dialog for Player 1 (Red)
                      • Else - Actions



    This will work, but I must express that this is only a BASIC model of the function.




     
    Last edited: May 21, 2013
  2. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    ~Reserved
     
    Last edited: May 10, 2013
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,609
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    There I am!
    Since the trigger is simple I couldn't find something wrong there.

    And you know which tutorial I suggested you to link.

    Great job so far... sadly creating it made me sleep xd

    edit: tell me the problem on steam I might have a solution
     
    Last edited: May 1, 2013
  4. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
  5. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    But when noobs see the word Jass, they run screaming into their holes.
    This is specifically for them, otherwise I would have done some improving upon the systems.
     
  6. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Glory to the noobs!:grin:

    On to topic, very useful for those NOOBS who dont know how to do that. But still helps a little for those that know still.
     
  7. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    It looks really nice right now (aesthetically and writing-wise). I think I need just a few points of clarification though:

    - Why do you need to base it off Attribute Bonus? Couldn't it work with basing it off of channel? If it is for convenience (as in, you have to modify fewer fields), then you may want to mention that.

    Er, actually that is about it.

    As for some suggestions (if you end up using that reserved post, or extending the tutorial), I think it would be really cool to cover adding attributes such that they show up as "+ 5" in the command card. For example, when you get claws of attack, it'll show up as "+ 11" damage (or something similar) in green text next to the unit's attack damage. You can achieve this with item abilities. See this system for a reference:
    http://www.wc3c.net/showthread.php?t=107940
    You don't actually have to delve in the code, but if you look in the object editor you can see how the item abilities work.

    However, that is a bit complicated. Again, you don't have to, but it would be a cool tutorial since I haven't seen anyone cover it yet. I don't remember what items they base it off of, but you basically just add one to the unit and they'll keep the stat bonus. (remove it to remove the bonus) You don't have to make the ones like bonusmod does it (with +2, 4, 8, 16, etc.. bonuses), you can just show an example with maybe +5 or +10 for a certain stat.

    All things considered, this tutorial looks approvable in its current state. :)
     
  8. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    So they're scared? No!!!
     
  9. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    It doesn't HAVE to be, simply another ability that can be hidden from the command card.
    Even tho the system removes the ability after learning it, sometimes lag will cause it to temporarily appear in the command card.
    That, and it may push or pull other ability icons around if it's not hidden.

    In any case, I updated the comment there. :)

    Isn't that what the Attribute Bonus ability does? Or did I just misunderstand you... ;p

    Although, it could be useful for altering damage & armor that way, rather than using auras.
    I think I might include that.

    Grazie! <3

    EDIT: I also added a tutorial and another system to the list, as they both could be used to create something similar to this.
     
  10. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Oh I see. I didn't notice that attribute bonus had that field.

    Yeah, it does. I didn't test it before. But the issue I have is that I don't see the point of the trigger. The attribute bonus ability gives the stats, but then you remove it and modify the stat with the trigger. (and thus, it loses the +3 green part next to the stat) So I don't see why the ability "middle-man" has to be there aside from being learned.

    Although, that also implies that the trigger can be considered a middle man. Since the spell is hidden, you shouldn't have to go through that process, right? *Unless you don't want it to have that green text. Then I understand.

    I hope you understand the source of my confusion. Do you have a test map?
     
  11. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    Yeah the whole point is to eliminate that gross green text. :p

    It makes it easier for ORPG's namely, which is what I happen to be working on.
    It happens to be a dumbed-down version of the system I'm using.

    The purpose is to avoid having to seperate the stat bonus that WOULD show up in green text from Attribute Bonus, from item stat bonuses.

    This makes it a permanent addition to the hero instead of just a temporary +X next to the stat.
    As it's not temporarily given to the hero, it can be saved / loaded a whole lot easier without having to mess around with saving the levels of each ability.

    As for a test map, I can give you an earlier version of my ORPG before I improved on the system. It's fairly close to this now.
    I'd prefer to give it to you in PM tho, so just let me know if you'd like it.
     
  12. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Ah, no need. I see what you mean now, and it makes sense.

    You may want to mention that in the tutorial, just to people will be clear why you go through the process of having the dummy ability + the trigger. :)

    Also, is this finished or WIP?
     
  13. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    Okay, I updated the introduction with that.
    This tutorial is finished, although if you had any more suggestions I would be more than happy to add them. :)

    I would like to point out that posting a tutorial about something so basic was pretty embarassing!
    But I got enough questions about this kind of thing I figured it would be a good idea. x)
     
  14. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Approved. :D

    And no worries about the tutorial being about a simple subject. As long as it is useful (which it is), then it is fine.
     
  15. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    Lol thank you. :)
    I appreciate the suggestions you've given!
     
  16. dart_vaider

    dart_vaider

    Joined:
    Jul 18, 2011
    Messages:
    15
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Request form #DH156C

    INQUIRY
    On the subject of the proceeding of "METHOD ONE - Adding Stats Using Hero Abilities", derived from the tutorial topic "Altering Hero Stats For Noobs", submitted by user designation "Archange1".

    Is the specification of that method to be executed once, and only once, for each heroic statistic, when learned, or is it intended to be a repeating action with multiple iterations for each heroic ability score?
     
  17. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    Shit.. I thought I was fancy.

    In method one, the stat only goes up by ONE every time you level the ability. However, there are as many levels as you need for each ability, so you could increase the hero's stats as many times as you need.
    The value of the increase, which is one in my example, could easily be changed.

    Not sure if that's what you were asking, but let me know if you still need help. :)
     
  18. dart_vaider

    dart_vaider

    Joined:
    Jul 18, 2011
    Messages:
    15
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Indeed, you have provided an answer to my query.

    However I believe there is a problem with the aforementioned "Method One".
    The trigger states that after learning said ability, for example "Strength Gain", the Strength value of the hero is incremented and the ability is removed. This would entirely remove the ability, barring any future possibility for advancing its levels.
    Therefore the hero will only be able to increase his strength once.
     
  19. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    No that's not true.
    When you remove the ability, it doesn't remove the option to learn it because it's a hero ability.
    What it does is removes the current value of the ability on the unit, without altering the unit's ability to learn said ability. c;
     
  20. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,641
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    laugh at For Noobs part xD
    nice tutorial :)