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

Having trouble with my ability learning system

Status
Not open for further replies.
Level 1
Joined
Nov 2, 2009
Messages
2
Hey all, been messing with the editor for a couple months now, in the midst of a large project currently. My problem here is that the ability learning system i've devised doesn't work and i can't think why.

Here is an example, perhaps someone could shed light on the problem?

  • Warrior Levelling
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Leveling Hero) Equal to Warrior
    • Actions
      • Set WarriorLevel = (WarriorLevel + 1)
      • Wait 0.01 seconds
      • If (WarriorLevel Equal to 3) then do (Unit - Add Last Stand (WARRIOR) to Warrior) else do (Do nothing)
      • Wait 0.01 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WarriorLevel Equal to 5
        • Then - Actions
          • Unit - Remove Dodge (WARRIOR, rank1) from Warrior
          • Wait 0.01 seconds
          • Unit - Add Dodge (WARRIOR, rank2) to Warrior
        • Else - Actions
          • Do nothing
"Warrior" and "WarriorLevel" are both variables, their original values are declared at map initialisation.

Any ideas? :sad:
 
Level 3
Joined
Mar 7, 2009
Messages
45
Hmm have you tried to set warrior(variable) to the hero if not then nothing happens
EDIT: like Set Warrior=(last created unit) or something
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Are those unit or hero abilities?

For unit abilities, it's like this:

  • Untitled Trigger 092
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set Temp_Integer_1 = (Temp_Integer_1 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer_1 Equal to 3
        • Then - Actions
          • Unit - Add Abolish Magic to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_1 Equal to 5
            • Then - Actions
              • Unit - Remove Aerial Shackles from (Triggering unit)
              • Unit - Add Ancestral Spirit to (Triggering unit)
            • Else - Actions
 
First off all, yes remove the waits and the "Do Nothing" thing, they just slow down the trigger.

Secondly why you remove the ability? Just increase its level by 1 with this:
  • Unit - Increase level of <Ability> for <Unit>

yes this would work but make sure it detects the max level of the ability, because otherwise, idk if it still does or not but that use to make the game crash if it got the ability level higher than the actual level, or it bugged the ability

if then multiple functions work great, your system just needs redesigned, you don't need any variables for this at all.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
Do nothing means ... nothing :) and nothing i an action ... and the computer "read" it ...

If you don't believe just do NOT use it.I agree to the 99% of the cases it is not needed...but some time it IS.
It's just the same as some times the wait 0.00 action is needed.

I won't put any effort to pursue you...but you can always try to find out what i mean by yourself.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I wonder what situation that "needed" Do Nothing....

You really do?Then what about this?
  • Player Group - Pick every player in Players and do (If ((Name of (Picked player)) Equal to reason3) then do (Game - Defeat (Picked player) with the message: You are a champion!) else do (Do nothing))
I know this can be done with if/then/else but if someone want to do it this way what would you put there?
 
Status
Not open for further replies.
Top