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

[Trigger] Problem with new attributes system

Status
Not open for further replies.
Level 8
Joined
Mar 24, 2011
Messages
353
Hi, I do not like the "attributes" system that Warcraft makes available. Why do I need 4 attributes: Body, Agility, Mind and Spirit. not just 4. Ok I worked on a system but I'm having trouble making it work. Probably something is missing or is the case of one of those "rare" bugs of the trigger editor. For simplicity I'll just talk about 1 attribute and 1 class with something it would have to "do" since the other attributes would just repeat the same "loop" with different data.
Simply the "ability" of Item Life Bonus, does not update to the level corresponding to the "amount" of "charges" remaining on an Item (item only represents 1 panel) of when Body would my char have understood? and the ability is in the char.

I find it very difficult to explain this, especially in English which is not my natural language. So I'll attach a map with a basic system of it here.

Why does the "life bonus" level not update the same number of "charges" as the other unit's item? What am I doing wrong in the system?
 

Attachments

  • Bugged System.w3x
    17.4 KB · Views: 30
Level 13
Joined
May 10, 2009
Messages
868
As far as I know, "Item Life Bonus" ability does not support multiple levels, which means you can only use its level 1 field. Also, you don't need a spell book for hiding it as it doesn't display its icon by default.
 
That are a lot of levels: you could do it simlear to custom stat. It creates skills giving bonuses based on 2^x, then add/remove all skills needed to gain the value you want.
61 = 32 + 16 + 8 + 4 + 1.

Other way is to use tombs.

Or abuse a bug for life/Manabonus gaining value of 1 level but losing the value of current level.
 
Level 8
Joined
Mar 24, 2011
Messages
353
That are a lot of levels: you could do it simlear to custom stat. It creates skills giving bonuses based on 2^x, then add/remove all skills needed to gain the value you want.
61 = 32 + 16 + 8 + 4 + 1.

Other way is to use tombs.

Or abuse a bug for life/Manabonus gaining value of 1 level but losing the value of current level.

I do not understand anything at all about Jass. :goblin_cry:

Tombs?
Bug for life/mana?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Bug for life/mana?
The life and mana abilities actually do support multiple levels, just they do not support changing level. Changing level of the ability does not change the amount of life/mana given to reflect the new level. However removing the ability will correctly remove the amount given by the abilities current level. The result is one can exploit the lack of changing level support to permanently modify a units maximum life and mana.

Say one has a life bonus that adds 1 life at level 1 and 0 life at level 2. If one performs the sequence...
Add Ability -> Set Ability Level to 2 -> Remove Ability
The unit will have permanently gained 1 maximum life. Works for maximum mana as well. The resulting life gain is functionally equivalent to as if the unit was given tomes of maximum health. No other item ability types seem to be missing changing level support as far as I am aware.
 
I do not understand anything at all about Jass.
Doable in GUI.
Here a GUI version supporting upto 127 showing the concept.
It is based on the number system with the base of 2 (this has the benefit that you have a skill or you have it not). Each skill has the double value of its previous.
To add the actual value, loop them from big to small and add the needed ones ( bigger then a wantedValue and reduce the wantedValue)
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The skills gained. --------
      • -------- Migth be a good idea to preload them in the real project. --------
      • Set Skill[0] = ATK (1)
      • Set Skill[1] = ATK (2)
      • Set Skill[2] = ATK (4)
      • Set Skill[3] = ATK (8)
      • Set Skill[4] = ATK (16)
      • Set Skill[5] = ATK (32)
      • Set Skill[6] = ATK (64)
      • -------- The value of each skill. --------
      • Set Skill_Value[0] = 1
      • Set Skill_Value[1] = 2
      • Set Skill_Value[2] = 4
      • Set Skill_Value[3] = 8
      • Set Skill_Value[4] = 16
      • Set Skill_Value[5] = 32
      • Set Skill_Value[6] = 64
      • Set Skill_Last = 6
  • Bonus
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
    • Conditions
    • Actions
      • Set wantedValue = (Integer((Substring((Entered chat string), 2, 6))))
      • Set wantedTarget = some Unit
      • Trigger - Run Skill Update <gen> (ignoring conditions)
  • Skill Update
    • Events
    • Conditions
    • Actions
      • -------- The code updating current bonus. --------
      • -------- Does not support negative values. --------
      • For each (Integer Skill_Loop) from 0 to Skill_Last, do (Actions)
        • Loop - Actions
          • -------- The saved values are ascending,but we need to access the data from big to small. --------
          • Set current = (Skill_Last - Skill_Loop)
          • -------- When the wanted value is greater equal to the Value of the current skill, add it and reduce wanted Value --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • wantedValue Greater than or equal to Skill_Value[current]
            • Then - Actions
              • Set wantedValue = (wantedValue - Skill_Value[current])
              • Unit - Add Skill[current] to wantedTarget
            • Else - Actions
              • Unit - Remove Skill[current] from wantedTarget
 
Status
Not open for further replies.
Top