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

[JASS] WHY?? (UnitAddAbility problem)

Status
Not open for further replies.
So, I tried creating a sight range system which modifies a sight range of unit using the Scope ability(Sight bonus) with binary method.

I tried adding some ability to a unit (via code) and it seems that it can only add one ability of its own at a time(e.g I add a Sight Bonus with 512 bonus for 10 times, 9 next lines fail)


everybody got a suggestion?
 

Attachments

  • Sight Range v1.0.w3x
    23.9 KB · Views: 53
Level 19
Joined
Aug 8, 2007
Messages
2,765
What a strange mess.

whats strange?
when an item is equipped, all abilities are added to hero. when unequipped, all are removed. thats why claw of attac kand shit need tobe stackable
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The sight range ability is like the life bonus and mana bonus ability, meaning it possesses the same bug:

You can set the first level value to 0, level 2 to x. Add the ability to the unit, set to level 2, remove the ability from the unit. The unit will have an additional sight range of -x.

That bug however is not very stable. Morphing the unit will remove the bonuses/mess it up.

Also sight range is capped at 1800, anyway.

edit: And different sight range abilities do stack.
 
well theres your issue.

Only item abilities are stackable

Nuh uh, some can't be stacked. Though technically they can be overwritten to be higher/lower so technically they do stack... Still nuh uh.

Also testing this, will post map shortly/answer.

Edit: Nope the limit is still hardcoded as usual sadly... That is 1800. Sure there's workarounds, but it would have been cool if stacking them was a workaround itself. Yeah they can be stacked however not over 1800.
 

Attachments

  • testetst.w3x
    16.6 KB · Views: 50
Status
Not open for further replies.
Top