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

[Solved] Editing Unit Range - May be bug?

Status
Not open for further replies.
Level 4
Joined
Jul 27, 2015
Messages
29
Hello
I've been creating a spell that temporarily increases a unit's range using some of the new functions added to the GUI that let you retreive/edit the fields in a unit's object editor data.
  • Unit - Set Unit: UNIT's Weapon Real Field: Attack Range ('ua1m')at Index:0 to Value: ((Unit: UNIT's Weapon Real Field: Attack Range ('ua1m') at Index:0) - REAL)
The above is an example of how I'm using it, changing a unit's attack range to it's current range minus/plus some value

What I noticed is the 'ua1m' field doesn't seem to be correct, if you hit ctrl+d in the object editor you can see range field is actually 'ua1r' (see below)
hiveUpload1.png

hiveUpload2.png


Also maybe worth noting is this is actually an Integer field in the Object editor, but the attack range doesn't come up under Integer fields in the GUI editor (see below)
hiveUpload3.png

So I decided to convert the trigger to custom text to see if I could manually put the correct field in and thats when I found that the GUI editor's action refers to what looks to me like some constant defined outside of the World editor
hiveUpload4.png


I'm pretty stuck here, any ideas? I think it's just a bug with the editor and I will have to use an old work around like morphing but it's a shame as I'd love to use the new functions :c
 
Level 5
Joined
Oct 16, 2007
Messages
67
Range is a funny field.
First, you have to set Index 1 for attack 1 and Index 2 for attack 2 instead of 0 and 1.
Second, you don't put the range you want into it but the difference. So if you set the Value to 100 it will increase the attack Range by 100. With -100 it will reduce the attack range by 100. I'm unsure what happend at 0 :D
 
Level 4
Joined
Jul 27, 2015
Messages
29
Thanks for the response Lartin, I'll give that a try when I get back to my PC ^^
It hadn't occured to me to change the index as it has been 0 and 1 in other triggers I've used 🤪

Edit 1: So I tried out the changes you suggested and they got the system working which is great, thanks for that!
However the unit is also losing huge amounts of armour which is something I'll look into further.

Edit 2: Armour loss was caused by interactions with another of my triggers, I've fixed it so I can confirm the above solution works - shame the solution is just knowing the action is configured unintuitively
 
Last edited:
Level 5
Joined
Oct 16, 2007
Messages
67
The max range is also affected by the max acquisition range, the max acquisition range will be the range displayed in the tooltip in game. So even if you set the range to 1000 if the mar is 500, 500 is the range the unit will say.
While true for Units created or preplaced this is wrong in this case. It will increase the range, however it will not attack at willl in this range. By setting target acquisition range to the current range the auto attack is reanabled for the whole range.

Edit: If you read the range field 0 is attack 1 and 1 is attack 2.
 
Status
Not open for further replies.
Top