• 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.

Spell Book Cancelling ?

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
How to detect the Event ?
I tried with detecting the Issued Order ID with this trigger;
  • Untitled Trigger 002
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: if GetIssuedOrderId() == 851976 then
      • Custom script: call BJDebugMsg("Cancel")
      • Custom script: endif
But apparently, the trigger above just detect "Cancellation" from Upgrades, not by Spell Book cancelling.

Is there any other way ?
 
Level 4
Joined
Aug 26, 2012
Messages
123
Maybe you know more, but can you detect when a unit opens her spellbook?
If yes, then
-set the "OpeningSpellbook" to true,

after that
- event: A unit press cancel
- cond: OpeningSpellbook is true
- act: --Just act what you want--

(If no, then for now I don't know, but no matter how hard it is, don't give up!)
 
Level 7
Joined
Jan 30, 2011
Messages
267
well, as far as i know its impossible to detect if someone closes spellbook, building menu, hero ability menu etc.
you would have to trigger the whole thing (means using kind of a dummy unit instead of a spellbook)

EDIT: can you explain pls why exactly you want to detect when someone closes spellbook? maybe we can find another solution then
 
This can be done, but is extremely unhandy.
Basically, you do this:

1)Create a dummy spellbook with ONLY TWO SPELLS (and that is another dummy ability, based off berserk, most likely, plus the 'real' spellbook)

2)Make berserk based ability have a hotkey that is not used anywhere else (I use "P" since it is not used in my map anywhere else)

3)Make the real spellbook ability have a hotkey that is not used anywhere else (I use "L" since it is not used in my map anywhere else)

3) Force UI hotkey "P" and "L" 10 times a second.

4) When you open your first spellbook (dummy one), the spell based on berserk will fire as well as your real spellbook, so there you have 'open' detection.

5) When you close your spellbook via esc or the button, it will go back to the previous one, which means the berserk based ability gets activated again. This detects that the spellbook is closed, therefore, use a trigger that forces the player to press ESC when 'berserk' order string is executed by that unit. Notice that this trigger must be turned off while the spellbook is closed.
 
Status
Not open for further replies.
Top