Change unit's range?

pandamoniuma

New Member
Reaction score
9
Is there anyway to change a unit's range without morphing the unit or giving it a research tech like long rifles (because researches arent reversible as far as I know)

Basically I have a unit that I want to be able to equip weapons of different ranges, like a sword or a bow.

I cannot morph the unit because the abilities he has are added through triggers, and morphing him would remove those abilities, and if i added them again the cooldown would be reset

is there some other way to change a unit's range?

Thank you
 

Curo

Why am I still playing this game...?
Reaction score
109
I think there is some sort of ability associated with long rifles, not just an upgrade. Not 100% sure, but it's worth checking out.
 

Vassilev

New Member
Reaction score
39
As far as I know, I don't think there is...

You could use the Replace Unit trigger though, but that can be quite irritating to the player as the group (ctrl + 1, 2, 3) he gave to the unit will be cancelled and the unit will stop.

As for swapping the abililties for each different weapon, I suggest using a variable which tracks when a spell is used and do not add the spell to the new weapon if the "cooldown timer" is still counting

Example:
1)
Unit picks up the item
Replace the Unit Type
If Weapon1Timer is not greater than 0 then,
add ability to the new unit

2)
Unit casts the ability of weapon 1
Set Weapon1Timer + 4


3) Every 1 second of game time
Set Weapon1Timer - 1


Well, that's roughly a Non-MUI way to do it >.<"
Im sure you can make it MUI but you gotta use vJASS
 

pandamoniuma

New Member
Reaction score
9
you know i thought of something like that vassilev, what i would do is still add the ability, but give some unit requirement called like "Cooldown", which would basically be a dummy unit that i give to the player when the spell is ready

but really its a lot of quirkiness, and i dont like the removing the hotkey ctrl 1 and 2 thing

what im doing right now, altho it has problems, im basically giving the unit a fairie fire ability that has duration .01, when he casts fairie fire, i create a dummy unit that fires an arrow

but im having problems getting the animation right, getting him to stay in place when hes supposed to, face the right direction (he can still cast fairie fire if hes holding position facing the opposite way) so its a real pain in the ass, thats why i wanted to know if there was an easier way
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You can give the unit 99999 attack range, then a very low Acquisition Range. As far as I know, acquisition range will always limit the attack range (i.e. attack range is always <= acquisition range). And acquisition range can be altered with triggers I think :)

I've tested this before, but it doesn't work. = /
 

darkbeer

Beer is Good!
Reaction score
84
I cannot morph the unit because the abilities he has are added through triggers, and morphing him would remove those abilities, and if i added them again the cooldown would be reset

i think its possible to morph the unit and maintain the cooldown:, you can make an ability permanent using

Code:
CustomScript: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'a000')

if you morph the unit now with the morph abilities i think the cooldowns and abilities should stay ( but im not totally sure, never tried xD)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top