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

Chat message opens spell for triggering player.

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2020
Messages
80
Hello,

Is it possible from an event where you can force a player into casting a spell?

For example the player types -clear, the ability begins so the player now has the AOE selection opened and then the player selects the area that they want cleared from trees.

I know you can trigger a unit to cast a spell, it's the point before that where the player is basically made to direct where the spell is being cast.

Hope that makes sense!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
You can catch when an ability button is pressed using this (Added in Patch 1.31+):
  • Events
    • Game - Button for ability Shadow Strike and order Night Elf Warden - Shadow Strike pressed.
And you can force a hotkey using this:
  • Actions
    • Game - Force Player 1 (Red) to press the key A.
So when you type -clear, you can force the Hotkey for your "Clear" ability to be pressed.

Note that the forcing hotkey action will have a delay on bnet so it's kind of crappy...

This can also be done using Mouse events. An example of this: Modular Mouse Spells v1.2

Furthermore, you can use OSKey to gain access to all of the keyboard hotkeys: [vJASS] - OSKeyLib

This could allow you to skip the -clear command entirely, and use a hotkey instead. Same goes for the need of an ability/forcing hotkey, as you can use the Mouse events to mimic this behavior.
 
Last edited:
Level 7
Joined
Apr 17, 2017
Messages
316
An almost instant way would be extracting that aoe spell texture, save it as a model then when the player types something move the model to the position of the mouse then if the player left clicks anywhere on the map pick all trees inside that radius and destroy them.
 
Level 5
Joined
Mar 24, 2020
Messages
80
You can catch when an ability button is pressed using this (Added in Patch 1.31+):
  • Events
    • Game - Button for ability Shadow Strike and order Night Elf Warden - Shadow Strike pressed.
And you can force a hotkey using this:
  • Actions
    • Game - Force Player 1 (Red) to press the key A.
So when you type -clear, you can force the Hotkey for your "Clear" ability to be pressed.

Note that the forcing hotkey action will have a delay on bnet so it's kind of crappy...

This can also be done using Mouse events. An example of this: Modular Mouse Spells v1.2

Furthermore, you can use OSKey to gain access to all of the keyboard hotkeys: [vJASS] - OSKeyLib

This could allow you to skip the -clear command entirely, and use a hotkey instead. Same goes for the need of an ability/forcing hotkey, as you can use the Mouse events to mimic this behavior.

I'll give this a go! Cheers Uncle.
 
Status
Not open for further replies.
Top