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

Level up stat increase skill

Status
Not open for further replies.
Level 5
Joined
Dec 3, 2012
Messages
117
Not sure how to explain this, but if you've played TBR you'll know what I'm talking about. On this new RPG I'm working on I want the hero (on levelup) to get 3 stat points spendable on either str/agi/int, whatever the player wants, but I can't seem to figure out how to do this...
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
i have no idea what TBR is but i can think of a couple ways to do this.

trig 1
event
unit gains lvl
condition
unit = ur hero
actions
set tempInt = 0
unit add ability agi up
unit add ability str up
unit add ability int up

trig 2
event
ability is cast
conditions
ability being cast equal to agi up
actions
set tempInt = tempInt + 1
give unit tome of agi + 1
if tempInt = 3
then
remove the three abilities
else
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
It may be more efficient space-wise to create a spell book which has those 3 abilities. Using specific ability adds attribute. When 0 attribute points are left, you remove spellbook.
Also you may not want to set tempInt to 0 when unit levels up, but set it as tempInt = (tempInt + 3), so when unit levels up while it did not spent all bonus attribute points, those leftovers won't get deleted.
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
the tempInt is an integer variable. By changing its value every time a unit casts "bonus str/agi/int" abilities, it will increase (or decrease) its value by 1. Then by checking what value it has you can easily find out if bonus stat abilities were used 3 times or not.
(if you did not check how many times unit cast any bonus ability, he may use it infinitely)

There are many types of variables and you will need to use them a lot in your triggers. You should look at this page http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/ to get a basic idea what they are for and how do they work
 
Level 5
Joined
Dec 3, 2012
Messages
117
I have one more question. I used the unit skill berserk as a base skill seeing as its a single click ability, but now when I click str, agi, or int it all goes to int, I can also see the cooldown on int if I click str or agi, did I use a wrong base ability, or how do I fix that :eek:
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
I have one more question. I used the unit skill berserk as a base skill seeing as its a single click ability, but now when I click str, agi, or int it all goes to int, I can also see the cooldown on int if I click str or agi, did I use a wrong base ability, or how do I fix that :eek:

Use Channel instead, then change the order id. Stats to Visible and untick Disable Other Abilities.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
to explain more on y u have to use channel.

each ability has a base order id. its what gets called when looking up what ability was cast.
when u make three abilities from the same ability they all have the same base order id thus the first one is casted.

channel is a special ability u can change its base order id. just make sure to change the base order id of channel for each ability ( do not make them the same ) and it will work.
 
Level 5
Joined
Dec 3, 2012
Messages
117
Thanks guys, that worked :) But as usual, yet again another problem has arisen.
I used the spellbook way Nichilus described and as soon as the attribute points have been spent, the spellbook is removed, only when that happens (Either after the last skill, or the spellbook vanishing) my hero gets stuck, cant move an inch...
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
Every Channel ability has "Data - Disable Other Abilities" - turn that to "false".
It may be that your Bonus ability has disabled other abilities/commands and then you removed the spell book, effectively pausing the unit.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
These stat systems are boring and flawed. You always dump into your prime attribute because it makes you the most effective.

I advise thinking of an alternative system, such as restricting the amount of single stat dumping that can occur.
 
Last edited:
Level 30
Joined
Nov 29, 2012
Messages
6,637
Maybe you can try this trigger on my project but you'll need to make the skills Agility, Strength and Intelligence.

  • Attribute System
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Strength
        • Then - Actions
          • Hero - Modify Strength of (Triggering unit): Add 1
          • Unit - Remove 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 Agility
        • Then - Actions
          • Hero - Modify Agility of (Triggering unit): Add 1
          • Unit - Remove 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 Intelligence
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 1
          • Unit - Remove Intelligence from (Triggering unit)
        • Else - Actions
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
Maybe you can try this trigger on my project but you'll need to make the skills Agility, Strength and Intelligence.

  • Attribute System
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • ((Learned Hero Skill) Equal to Strength ) or (((Learned Hero Skill) Equal to Intelligence ) or ((Learned Hero Skill) Equal to Agility ))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Strength
        • Then - Actions
          • Hero - Modify Strength of (Triggering unit): Add 1
          • Unit - Remove 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 Agility
        • Then - Actions
          • Hero - Modify Agility of (Triggering unit): Add 1
          • Unit - Remove 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 Intelligence
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 1
          • Unit - Remove Intelligence from (Triggering unit)
        • Else - Actions

You don't need the first condition below the event cause it also detects on the if/then/else conditions.
 
Level 5
Joined
Dec 3, 2012
Messages
117
can u post triggers for spellbook

First Trigger
Event
Unit - A unit Gains a level.

Conditions
Triggering Unit is in Units owned by Player 1 RED = True

Actions
Set "A1Red = APRed +4
Unit - Add "Attribute Points" (Spellbook) to Triggering Unit

Attribute Triggers
Event
A unit begins casting an ability

Conditions
Ability being cast equal to Strength

Actions
Hero - Modify STR of Triggering unit; Add 1
Set APRed = APRed -1

if conditions
APRed equal to 0
then actions
Unit - Remove Attribute Points (Spellbook) from Triggering unit.


Now, all those attribute triggers are the same, except for the condition to the corresponding skill, and adding the right attribute.
 
Level 5
Joined
Dec 3, 2012
Messages
117
Maybe you can try this trigger on my project but you'll need to make the skills Agility, Strength and Intelligence.

  • Attribute System
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Strength
        • Then - Actions
          • Hero - Modify Strength of (Triggering unit): Add 1
          • Unit - Remove 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 Agility
        • Then - Actions
          • Hero - Modify Agility of (Triggering unit): Add 1
          • Unit - Remove 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 Intelligence
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 1
          • Unit - Remove Intelligence from (Triggering unit)
        • Else - Actions

This way only 1 stat point can be chosen per level, or can you set skill points per level somewhere ?
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
This way only 1 stat point can be chosen per level, or can you set skill points per level somewhere ?

Yes, you can set the number of skill points you can receive but in level 1 it is really set in 1 skill point but when you level up it will do.... Here's the trigger for setting the skill points...

  • Hero - Modify unspent skill points of (Leveling Hero): Set to 4 points
Mine I set it 4, you can change yours.:grin:

Well, you want 3... so here....

  • Hero - Modify unspent skill points of (Leveling Hero): Set to 3 points
 
Level 5
Joined
Dec 3, 2012
Messages
117
Works fine for me too, only problem I discovered is that with this trigger, if you level up twice or more at once, you won't get twice the stat points, but just once, as the triggering sees it as leveling up once :(

Any systems to prevent units from being able to level up twice? like when a unit levels up once, cap that xp so it can't gain more ?
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Works fine for me too, only problem I discovered is that with this trigger, if you level up twice or more at once, you won't get twice the stat points, but just once, as the triggering sees it as leveling up once :(

Any systems to prevent units from being able to level up twice? like when a unit levels up once, cap that xp so it can't gain more ?

Oh, this will do the trick. I have notice that set will only set the skill points gained to 3 even how many times you level up, so the best solutions is this:

  • Hero - Modify unspent skill points of (Leveling Hero): Add 3 points
Add because everytime you level up it will add and not set it again to 3 when you level up.
 
Level 5
Joined
Dec 3, 2012
Messages
117
Oh, this will do the trick. I have notice that set will only set the skill points gained to 3 even how many times you level up, so the best solutions is this:

  • Hero - Modify unspent skill points of (Leveling Hero): Add 3 points
Add because everytime you level up it will add and not set it again to 3 when you level up.

This is what I already have, my problem is that if you gain 2 or more levels at once it won't give you the full points.

For example, my level 1 unit just became level 7, using 1 tome of 3k exp, yet only has 6 skill points, instead of the intended 24
 
Level 5
Joined
Dec 3, 2012
Messages
117
3 * 7 = 21 ...

umm u also want it tht lets say unit is lvl 6 then lvls to 7 u want it to gain 21 more points ?
if so do this
  • Hero - Modify unspent skill points of myHero: Add ((Hero level of myHero) x 3) points
or just 3 points per lvl ?

4 Points per level, which is why I came out on 24 (3 added points from triggers and 1 naturally from lvl up)
 
Level 5
Joined
Dec 3, 2012
Messages
117
u did not answer my question tho. do u want 4 points per lvl like this... hero is lvl 5. he lvls to lvl 6. he gains 4 points ( 3 from trigger 1 naturally). or do u want it like this ... hero is lvl 5. he lvls to 6. he gains 4 per lvl of hero so 4 * 7 = 28 points for tht lvl ? also can u post the triggers u r using


Ah, like that, didn't understand your question, no 5 to 6 is 4 points.

  • Unit - A unit gains a level
  • Conditions
  • ((Triggering Unit) is A hero) equal to true
  • Actions
  • Hero - modify unspent skill points of (triggering unit): Add 3 points
So, it all works fine if a hero would never ever level up more than once instantly.

And

  • Unit - A unit learns a skill
  • Actions
  • If all conditions are true
  • if - Conditions
  • (Learned Hero Skill) Equal to Strength
  • Then - Actions
  • Hero - Modify strength of (triggering unit): add 1
  • unit - remove Strength from (triggering unit)
Same with agi and int
 
Status
Not open for further replies.
Top