HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Advanced Spell Creating (Trigger Based)

02-10-2003, 02:10 PM#1
Darky28
Advanced Spell Creating (Trigger Based)

Problems:
1: Spells with no target
Can be abused by repeatingly hit the spell button, (or shortcut) so the trigger starts but the spell is not cast.

2: Spells who have a cast range with targets a point
Your hero casts for example blizzard at a point. Blizzard has a cast range of 800 so if your hero is more than 800 away from the targeted point it first runs there and then casts the spell BUT the damn trigger already started right after you gave the command. So its way too early

3: Spells who have a cast range and targets a unit
Same Problem as above... if you wanna stormbolt someone and your hero is out of range the hero first tries to come into cast range and then throws the stormbolt. The damn trigger started right after you gave the command so its too early.



Solutions:
For 1: Just put this into your trigger:
Code:
Cinematic - Disable user control for Player 1
Wait 0.4 seconds
Cinematic - Enable user control for Player 1
With this trick you disallow the player to abort the already clicked spell. The spell runs, and use the mana.

For 2: For this problem there's actually a Work around but its only possible with JASS. The solution lies in 3 parts:

1) as soon as the blizzard command is given you create an invisible flying unit at the targeted point. Set the variable Blizzard (boolean initially false) to true.
Then create a trigger which checks if the hero who cast the spell is in range of the newly created unvisible unit.

2) A second trigger checks if the variable "Blizzard" is true and set it to false if you abort the spell by making an action other than blizzard (this trigger also deletes the temporary trigger and invisible unit)

3) The trigger which checks if the hero is in range, is the actuall Spell Trigger. Here you remove the invisible unit and do your spell stuff. At the end you set the variable "blizzard" to false and delete the trigger completly

For 3:
Same as for 2 exept you dont create a invisible unit. You pass the targeted unit for the temporary trigger.

I have a testmap for this if you're interrested. Please post here if you wanna see the testmap

Greetings Darky26
02-19-2003, 12:16 AM#2
STURMguy22
I would like to see the test map, but does it have tooltips in it so i can understand it a little better?