System Bonus (unit state modification)

Discussion in 'Systems and Snippets' started by Cohadar, Nov 25, 2008.

  1. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    I updated(fixed) the Attack and Move Speed plugin.

    Maximum attack speed bonus is 400% <-- this is true

    EDIT:
    Maximum move speed bonus is 100 <-- not true, I made error while testing.
    Maximum move speed bonus is limited by gameplay constants
    So if units speed is say 300 and gameplay says 522 max bonus is 522-300 = 222
     
  2. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    How did you find that?

    I haven't found any limit to how much move speed I can give with a single Move Speed Bonus ability. I tested with a unit with 25 default move speed and could add all the way up to 522 move speed to it.

    Additionally, using SetUnitMoveSpeed() on a unit that has been buffed by the Move Speed Bonus ability, the unit's move speed will be set to UnitMoveSpeed + MoveSpeedBonus (instead of just UnitMoveSpeed which I thought initially). With a bonus of let's say 522, you can set the unit's move speed to 0, and it will still run at 522 move speed.

    It doesn't affect your system much (if at all), but thought I could report my findings anyway.
     
  3. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    Version 1.3
    Removed textmacros, using struct interfaces now.
    Much better because you can now use Bonus variables.
    Believe it or not it is backwards compatible.


    Make Item Move Speed Ability and set bonus field to 200
    than give it to some unit
    than do:
    JASS:
    
    set current = R2I(GetUnitMoveSpeed(whichUnit))
    set default = R2I(GetUnitDefaultMoveSpeed(whichUnit))
    call BJDebugMsg(I2S(current-default))


    and tell me what it prints.
     
  4. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    It prints 200

    Here's the map if you want to check. Select unit and press esc to check it's move speed bonus.
     
  5. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    I was testing the speed on Bloodmage (speed 300) and since default move capacity in wc3 is 400 the bonus was cut off. :banghead:

    Remember to set your max speed to 522 in gameplay constants people....
     
  6. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    Hmm... Could this also be used to add attack range in-game? Just asking...
     
  7. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    I thought that might be what happened. I really don't get why it's not 522 by default.

    Only if you know about any ability that adds attack range. I don't think it exists.
     
  8. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    Might it be possible to use the upgrade, for rifleman, as a base for it?
     
  9. Sevion

    Sevion The DIY Ninja

    Ratings:
    +423 / 0 / -0
    Wow, Cohadar, this is really nice. Would you mind if I used this in EGUI in place of the other system I had?
     
  10. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    I've very little experience with upgrades, but as far as I know upgrades need to be specified for every unit in the object editor.
    They can't be removed either, so you couldn't use Cohadar's system for this. It requires you to be able to remove abilities every time you change the bonus.
     
  11. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    Ah, alright. Was just wondering.
     
  12. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    Of course not, tell me if you need anything else.
     
    • Like Like x 1
  13. Andrewgosu

    Andrewgosu The Silent Pandaren Helper Staff Member

    Ratings:
    +711 / 0 / -0
    This is amazing and quite useful in the right hands!

    Approved.
     
  14. Joker(Div)

    Joker(Div) Always Here..

    Ratings:
    +86 / 0 / -0
    Can you remove bonuses?
     
  15. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    Yeah, you can. The examples are misleading, as you don't really add bonuses on top of what is already there.

    set Bonus_Life[whichUnit] = 4 // will set the unit's life to base life + 400 life (DELTA = 100)
    set Bonus_Life[whichUnit] = 0 // will set the unit's life to base life (DELTA = 100)
     
    • Like Like x 1
  16. Blackrage

    Blackrage Ultra Cool Member

    Ratings:
    +25 / 0 / -0
    Nice system +rep

    Edit: For some reason the rep sign doesn't show up on you account.
     
  17. waaaks!

    waaaks! Zinctified

    Ratings:
    +256 / 0 / -0
    im looking for systems like these lately, and lots of them fail, and sometimes they have bugs, i hope this perfectly works as i needed
     
  18. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    Is it possible to add negative movement speed?
     
  19. Frozenhelfir

    Frozenhelfir set Gwypaas = Guhveepaws

    Ratings:
    +56 / 0 / -0
    JASS:
    //  EXAMPLES:
    //       * set Bonus_Life[whichUnit] = 4    // will add 400 life (DELTA = 100)
    //       * set Bonus_Armor[whichUnit] = 10  // will add 10 armor (DELTA = 1)
    //       * set Bonus_Damage[whichUnit] = 5  // will add 25 damage (DELTA = 5)
    //       * set Bonus_Evasion[whichUnit] = 4 // will add 20% evasion (DELTA = 5%)


    Does the system become ineffecient if I set damage delta = 1 (so I can set damage to whatever I want), and then need to add 500 damage to a unit or some large number? I made something for my map to do this here, but I think I'll probably use this if it has the same functionality and efficiency for high numbers. Meh, yours probably has better efficiency anyway...
     
  20. Gwypaas

    Gwypaas hook DoNothing MakeGUIUsersCrash

    Ratings:
    +50 / 0 / -0
    How would I modify this system so it supports bigger values? I've tried doing this but no success.

    JASS:
    //! external ObjectMerger w3a AItg A8T0 anam "Bonus Damage" Iatt 1 5   ansf "(binary 0)"
    //! external ObjectMerger w3a AItg A8T1 anam "Bonus Damage" Iatt 1 10  ansf "(binary 1)"
    //! external ObjectMerger w3a AItg A8T2 anam "Bonus Damage" Iatt 1 20  ansf "(binary 2)"
    //! external ObjectMerger w3a AItg A8T3 anam "Bonus Damage" Iatt 1 40  ansf "(binary 3)"
    //! external ObjectMerger w3a AItg A8T4 anam "Bonus Damage" Iatt 1 80  ansf "(binary 4)"
    //! external ObjectMerger w3a AItg A8T5 anam "Bonus Damage" Iatt 1 160 ansf "(binary 5)"
    //! external ObjectMerger w3a AItg A8T6 anam "Bonus Damage" Iatt 1 320 ansf "(binary 6)"
    //! external ObjectMerger w3a AItg A8T7 anam "Bonus Damage" Iatt 1 640 ansf "(binary 7)"
    //! external ObjectMerger w3a AItg A8T8 anam "Bonus Damage" Iatt 1 1280 ansf "(binary 8)"
    //! external ObjectMerger w3a AItg A8T9 anam "Bonus Damage" Iatt 1 2560 ansf "(binary 9)"
    //! external ObjectMerger w3a AItg A8Ta anam "Bonus Damage" Iatt 1 5120 ansf "(binary 10)"
    //! external ObjectMerger w3a AItg A8Tb anam "Bonus Damage" Iatt 1 10240 ansf "(binary 11)"
    Added the binary 8, 9, 10 and 11

    JASS:
        set Damage = BinaryBonus.create('A8T0', 10, 5)

    Made it use 12 instead of 8

    But this doesn't work, when I try to add more then 1,000 then it just start on ~100 again instead of continuing to increase.

    Someone please tell me what I do wrong :) Also, if you can tell me what I do wrong then also tell me how I can lift the max bonus damage to ~30,000 - 40,000.
     

Share This Page