• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Units spawned by spell.

Status
Not open for further replies.
Level 11
Joined
Dec 13, 2008
Messages
1,047
Ok, so I want a trigger where when a hero casts a spell (owned by a specific player), units/heroes will spawn in a different place. This is what I have so far, but it doesn't seem to work:
  • Ragnaros Dark Iron Dwarves
    • Events
      • Unit - A unit owned by Player 8 (Pink) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
    • Actions
      • Wait 1.00 seconds
      • Unit - Remove (Triggering unit) from the game
      • Wait 1.00 seconds
      • Unit - Create 1 Majordomo Executus for Player 8 (Pink) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
Also, I want it where if someone has cast this spell before you have, then this whole trigger wont occur. I do not know how to do this.

Anyone who can help me with this will get +rep and my thanks!! :thumbs_up:
 
Level 9
Joined
Nov 28, 2008
Messages
704
That spell should work, although the Remove unit may not work because you have waits.

If you want to only allow the spell to be cast once you can simply do Trigger - Turn Off (This Trigger). If you wanted to be perfect and remove the spell itself, there is some JASS code I could give you.
 
Level 4
Joined
Jun 12, 2009
Messages
57
Change the remove triggering unit with casting unit and remove the waits.

also add this before the turn off trigger
JASS:
Custom script: call RemoveLocation(udg_Majordomo Executus)

This fixes any leaks that would occur. Also to remove the trigger just use this and add it to the end of your trigger

  • Actions
    • Trigger - Turn off (This Trigger)
 
Level 9
Joined
Apr 25, 2009
Messages
468
  • << Your Trigger >>
    • Events
      • Unit - A unit owned by Player 8 (Pink) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Remove (Casting unit) from the game
      • Wait 1.00 seconds
      • Unit - Create 1 Majordomo Executus for Player 8 (Pink) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
ok, so i changed some things but it still isnt working. this is what i have.

  • Ragnaros Dark Iron Dwarves
    • Events
      • Unit - A unit owned by Player 8 (Pink) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
    • Actions
      • Game - Display to (All players) the text: The Iron Dwarves an...
      • Unit - Create 1 Majordomo Executus for Player 8 (Pink) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
      • Unit - Remove (Casting unit) from the game
      • Trigger - Turn off Ragnaros Dark Iron Dwarves <gen>
I am having a hero cast the spell, could this be the problem? Does it have to be a UNIT, or is a unit and hero the same thing in World Editor?
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
a player is casting it and no, the message does not appear. nothing works on the trigger. the hero does not dissapear (the one that is casting the spell), no hero appears in the region, nor does the message appear.
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
Ok.....it still isnt working!!! This is what I have:

  • Ragnaros Dark Iron Dwarves
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
      • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
    • Actions
      • Game - Display to (All players) the text: The Iron Dwarves an...
      • Unit - Create 1 Majordomo Executus for Player 8 (Pink) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
      • Unit - Remove (Casting unit) from the game
      • Trigger - Turn off Ragnaros Dark Iron Dwarves <gen>
Is there another way I can do this? Like can I do something similar to this by a building or something? cuz basically i want something where the players need to choose which race they wanna be, and when they choose that then certain heroes and units spawn at a certain point. And obviously this isnt working at the moment.
 
Level 9
Joined
Apr 25, 2009
Messages
468
You must add Loop Conditions...
Scroll down and use the "And - Multiple Conditions" in Condition
 
Level 10
Joined
Aug 15, 2008
Messages
720
Replace Player 8 (Pink) with Owner of (Triggering Unit) so that option is accessible to all players - Do the same thing with action create 1 Majo...

Also Casting unit fails for me, best thing to use is (Triggering Unit) So replace (Casting Unit) with (Triggering Unit).

Also don't forget about leaks.
 
Level 6
Joined
Sep 15, 2006
Messages
136
Try this:

Ragnaros Dark Iron Dwarves
Events
Unit - A unit begins casting an ability
Conditions
(Owner of (Casting unit)) Equal to Player 8 (Pink)
(Ability being cast) Equal to Black Iron Dwarves and Ragnaros
Actions
Game - Display to (All players) the text: The Iron Dwarves an...
Unit - Create 1 Majordomo Executus for Player 8 (Pink) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
Unit - Remove (Casting unit) from the game
Trigger - Turn off this trigger
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
Jesus christ....it still isnt working:
  • Ragnaros Dark Iron Dwarves
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
    • Actions
      • Game - Display to (All players) the text: The Iron Dwarves an...
      • Unit - Create 1 Majordomo Executus for (Triggering player) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
      • Unit - Remove (Triggering unit) from the game
      • Trigger - Turn off Ragnaros Dark Iron Dwarves <gen>
WHY?!?! :cry:

The condition
  • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
is all one thing. The spell is called Black Iron Dwarves and Ragnaros
 
Level 6
Joined
Sep 15, 2006
Messages
136
Nothing is working or only a part?
Does the casting unit disappear, or the new unit or the text appear?

Ah, and erase the underlined part:
Conditions
And - All (Conditions) are true
Conditions

(Ability being cast) Equal to Black Iron Dwarves and Ragnaros

And replace this: Unit - Remove (Triggering unit) from the game
for this: Unit - Remove (Casting unit) from the game

And put first the action that removes the caster and then the one that creates the new unit.

If nothing continues to work, try by replacing all things by variables.
If truly nothing continues to work, your last hope is to do it with JASS, but it's a very simple spell, it must work with GUI...
Can be that something makes the spell impossible to cast?
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
None of the trigger is working. No unit is spawned, no unit is removed, nor does a message appear, even after the changes that were suggested by many people:

  • Ragnaros Dark Iron Dwarves
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Black Iron Dwarves and Ragnaros
    • Actions
      • Game - Display to (All players) the text: The Iron Dwarves an...
      • Unit - Create 1 Majordomo Executus for (Triggering player) at (Center of Majordomo Executus <gen>) facing 90.00 degrees
      • Unit - Remove (Casting unit) from the game
      • Trigger - Turn off Ragnaros Dark Iron Dwarves <gen>
Is there an alternative to what I am trying to achieve?
 
Level 6
Joined
Sep 15, 2006
Messages
136
Try to make a new canvas map and only make the spell trigger, the two units and the region, it MUST work.

If it work in a new map, means that something in the other is blocking it, if it don't work in the new map can be a problem of your editor.

Anyway if it don't works in a new map I'll try to do it for you.
 
Level 10
Joined
Aug 15, 2008
Messages
720
Trigger solutions posted before works, "And" is fully unnecessary.
Begins casting an ability fails sometimes best thing to do is Unit starts the effect of ability.

And I said Casting unit is useless, BEST thing is (Triggering Unit) unless trigger contains multiple casters.

As I said all of those solutions works, It's NOT problem in trigger, it's problem in your spell or something, trigger is good.

Also What type of spell you use for that Dark Iron and Ragnaros? I prefer slam/warstomp/thunderclap for such spells.
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
i was using berserk cuz i read somewhere about using self-buff abilities for stuff like this but ill try to use a different ability. i will let you know how it goes.
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
fixed it!!! it was the spell. i used warstomp as the base spell and it worked perfectly!!! I am giving +rep to several people for helping me.
 
Status
Not open for further replies.
Top