• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Behind unit detect + Change Hotkey for Attack

Status
Not open for further replies.
Level 7
Joined
Jul 20, 2009
Messages
295
Hello,

1) I would like to know how I could detect if a unit is behind another?
E.g. a unit facing 90 degrees, another unit is somewhere 225-315 degrees behind that unit. Check if that is true.

2) I would also like to know how I could change the hotkeys for attack,move,patrol,stop just like that in The Chosen Ones (Found in Hosted Projects) and! the hero has the attack in a spellbook, how is that possible?

Thanks +reps for the helper(s).
 
Level 7
Joined
Jul 20, 2009
Messages
295
There is no way the hotkeys are in 'gameplay constants' nor 'interface' as I've checked before and just did now.

Edit: The hero has his attack + defense shown, and in the position of the attack is found a spellbook, once opened it shows the Attack Icon in it.
so a) the Attack button must be somewhere, b) how has the Attack button position been changed, c) how was the hotkey for the attack and other original buttons changed.
 
Level 7
Joined
Jul 20, 2009
Messages
295
The hotkeys can be changed via a file in your warcraft iii folder called 'customkeys.txt'

Nice, never knew about this.
Though I want the hotkeys to be changed in this map only. Is there a way to do this?

Edit: I found a source that helped me out with detecting when a unit is behind another.

I just need info about whether I can change the hotkeys of attack/stop etc.. for a particular map and not the whole of wc3 maps.

Thanks.
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
Nice, never knew about this.
Though I want the hotkeys to be changed in this map only. Is there a way to do this?

Edit: I found a source that helped me out with detecting when a unit is behind another.

I just need info about whether I can change the hotkeys of attack/stop etc.. for a particular map and not the whole of wc3 maps.

Thanks.

Game Interface
 
Level 7
Joined
Jul 20, 2009
Messages
295

Great, much friendlier to interpret and change to one's desire.
I got a request for you if that's alright?
Is there a way you could detect a friendly unit infront of an attacking unit and if that is true, the attacking unit does something (e.g. does a critical strike)
So, conditions, friendly unit infront, attacked unit is an enemy.
Actions, critical damage.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You use the even and odd properties of sine or cosine to translate angle into a comparable quantity of how close something is to the required angle. In a real program, the use of a complex conditional case statement or of a lookup table would probably be faster but since the JASS interpreter is so slow anyway, the time spent computing sine and cosine of an angle is meaningless.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
One way of doing it is that you make a custom ability, based on channel.
The ability must have target type "Unit or point". Then you trigger the effects. If the ability is used on a unit, then order the caster to attack the unit(target order). If there is no target unit, then it must be a point order, thus you order the caster to attack(attackmove) to that point.
 
Level 4
Joined
Jul 20, 2012
Messages
83
commandstrings.txt works and there's no Text - Hotkey in constants nor interface...
I have attack button removed from my map and put a spellbook with another actions instead... what I did about removing the attack button is that every unit in Object Editor has a field called "Combat - Attack 1/2 - Show UI" check it, but if you want to have it like that and are using Animate Dead, Charm or some abilities that let you control other units that you want you have to check that Show UI thing for every possible-clickable-playable unit in there to maintain the system...
 
Status
Not open for further replies.
Top