Advanced Item Range Increment System

Status
Not open for further replies.
Level 4
Joined
Aug 19, 2009
Messages
81
Okay i got a problem here because i want this but i dont know if its even possible:

I want to make it so that when a hero picks up a certain item (a gun, a throwing axe, everything ranged) the hero suddenly becomes ranged and gets a missile type that fits the item.

Example: Melee hero picks up a gun. He now have 800 range and has the rifleman missile type and a attack bonus. When the hero then drops the item he is again melee.

I have tried my best to try and make this work. I thought a changed orb could do it if i did it so it attacked ground ranged instead of air. It didn't work. Then i tried through triggers to enable/disable the Long Rifles upgrade and giving it to the hero but that didn't work either.

Is this impossible or can it be done in JASS or something? Please help!
 
Level 4
Joined
Aug 19, 2009
Messages
81
Well i have seen maps with such replacing where you equip the weapon and then its a new hero with same stats and such but i dont want it like that as the hero is supposed to be able to equip multiple items at a time.
 
Level 11
Joined
May 26, 2009
Messages
760
There is a way. Make two upgrades. The first one has a positive range bonus value. The second one has a negative range bonus value. I used +25 and -25. Set the levels of the upgrades to a top value, I suggest not much higher than 1 000. I tried 10 000 and it makes the WE lag a lot.

Sample triggers below.

  • Plus25
    • Events
      • Player - Player 1 (Red) types a chat message containing + as An exact match
    • Conditions
    • Actions
      • Player - Set the current research level of +25 range to ((Current research level of +25 range for Player 1 (Red)) + 1) for Player 1 (Red)
  • Minus25
    • Events
      • Player - Player 1 (Red) types a chat message containing - as An exact match
    • Conditions
    • Actions
      • Player - Set the current research level of -25 range to ((Current research level of -25 range for Player 1 (Red)) + 1) for Player 1 (Red)
In theory it should work to set the max research level as the triggers are activated which would allow us to keep increasing the max research level thus never hitting a cap, but I couldn't make it work.
  • Player - Set the max research level of -25 range to ((Max research level of -25 range for Player 1 (Red)) + 1) for Player 1 (Red)
  • Player - Set the max research level of +25 range to ((Max research level of +25 range for Player 1 (Red)) + 1) for Player 1 (Red)
Pro: You may increase/decrease range.
Con: Limited amount of increases/decreases unless one gets that max research level going.

The dilemma is that the only thing that can increase units' range is an upgrade and upgrades cannot be degraded once upgraded.
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
Just tried something and it works to some degree.
Hero needs to be effected by a Range Decrease Upgrade and a Range Increase Upgrade.
Increase by 1
Decrease by -1
1000 levels for both.
  • Increase Range
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Insert all your increase range items in here)
    • Actions
      • Player - Set the current research level of Test+ to (Integer((Current life of (Item being manipulated)))) for (Owner of (Triggering unit))
  • Decrease Range
    • Events
      • Unit - A unit Loses an item
      • Unit - A unit Pawns an item (to shop)
    • Conditions
    • Actions
      • Player - Set the current research level of Test- to (Integer((Current life of (Item being manipulated)))) for (Owner of (Triggering unit))
      • Player - Set the current research level of Test+ to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of Test- to 0 for (Owner of (Triggering unit))
Sadly once you sell or lose the first item your range wont increase unless the Range + Upgrade increases.
 
Last edited:
Just tried something and it works to some degree.
Hero needs to be effected by a Range Decrease Upgrade and a Range Increase Upgrade.
Increase by 1
Decrease by -1
1000 levels for both.

1000 is definetly not enough. If you take for example the standard hero range - 600 - then the first time the item is aquired, the upgrade is set to 600, the next time it would have to be set to 1200 - 200 over the limit, meaning that the hero will get only a range of 400 with the second equip and then 0 for all following.

I have tested a bit with Orb abilities, that allow the activation of attacks, but sadly warcraft always prefers the melee attack over the ranged. A last, but probably useless solution would be to use the uproot ability which can also change the attack indices, but then the heroes would have to stand still for using a ranged weapon.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It must have a well-coordinated trigger
That saves items, damages, stats, and such
You can't just use the Trigger action replacement just like that, well, it's a LOOONG work to do ;D
But for Level, I don't think you need to save it in a variable because, a replacement of unit will still take its previous EXP along with it
Example Human turns to Dragon
Human has 1800 EXP while Dragon has 0
If you use Replace unit action, that Dragon will get 1800 EXP, automatically
I think I've done this method, not sure about items, whether you have to save it or not
 
Level 12
Joined
Apr 4, 2010
Messages
862
It must have a well-coordinated trigger
That saves items, damages, stats, and such
You can't just use the Trigger action replacement just like that, well, it's a LOOONG work to do ;D
But for Level, I don't think you need to save it in a variable because, a replacement of unit will still take its previous EXP along with it
Example Human turns to Dragon
Human has 1800 EXP while Dragon has 0
If you use Replace unit action, that Dragon will get 1800 EXP, automatically
I think I've done this method, not sure about items, whether you have to save it or not

  • Unit - Replace lol1 with lol2
Items, exp, skills(yes, it will, unless... the units' abilities is different), stats, armor, damage, blah blah.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Replacement unit, just like demon hunter. Is probably the only working solution, but has the big disadvantage that you have to create a new hero type for all possible ranges.

Demon Hunter -> Demon Form
This is not a replacement method, it's more to Metamorphosis, more like change in state through ABILITY

Replacing a unit is done in Trigger Editor, not Object Editor
Therefore, it's different from one another
 
Level 12
Joined
Apr 4, 2010
Messages
862
Demon Hunter -> Demon Form
This is not a replacement method, it's more to Metamorphosis, more like change in state through ABILITY

Replacing a unit is done in Trigger Editor, not Object Editor
Therefore, it's different from one another

You should try using crow form and avatar while u are in metamorphosis. (spam it constantly for 5 times)
See wut will happen.
 
Status
Not open for further replies.
Top