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

Cast spells inside a spellbook via trigger

Status
Not open for further replies.
Level 8
Joined
Nov 20, 2011
Messages
202
Hi all,
iam trying to cast a spell inside a spellbook via trigger. I found a way to cast an ability which has no target, but i need also a way for other targettypes.
So anybody got here an idea, how to cast a not targetless spell inside a spellbook via trigger?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Ordering your unit to use a unit/point targeted ability that's in the spell book doesn't work?

You'd need to pick a random unit, or point for the ability to be cast on/towards.
 
Level 13
Joined
Mar 29, 2012
Messages
542
You can do this by forcing player to press a key
e.g.
  • Game - Force Player 1 (Red) to press the key R
Here i have a test map. In the map, when you test, if you quickly select the hero and open the spellbook, after 3 seconds, the hero will cast the Roar ability automatically. The hotkey of Roar ability is "R", in the test trigger, i force the player 1 (owner of hero) to press "R". The problem is, i can't open the spellbook via trigger... :/
 

Attachments

  • Experiment.w3x
    16.4 KB · Views: 46
Level 13
Joined
Mar 24, 2013
Messages
1,105
Well, following what ofel says, you just need to open the spellbook with the same action, Force them to press B for spell(b)ook and then the ability you desires hotkey.

But try to see if you can just order your unit to cast the ability outright...
 
Level 6
Joined
Oct 1, 2012
Messages
166
I'm afraid there's not much you can do about it.

Yet, I once did this somehow. If your unit has so many skills, that there's no room for a new one, you can always give a new one to it, so that IssueTargerOrder() will work and a player won't see anything wrong in his interface.

The pros? It works. The cons? You need to fill your unit with skills. Another con is that if you remove any of the filler skills, the dummy skill used for your trigger casts will show up in its place. If you add another skill as a filler, the dummy will still be there and the filler will be invisible. Trying to remove the dummy skill, then adding a new one and then adding the dummy again won't work (I tried), so, if you wish to manipulate your unit's skills, you'd need as many dummy cast skills as there will be times of your manipulating the unit's skills.

I know it's kinda weird idea, but the only one I managed to work out. Hope I helped :)
 
Status
Not open for further replies.
Top