• 🏆 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!

Repick Trigger

Status
Not open for further replies.
Level 2
Joined
May 22, 2006
Messages
14
I made a cool looking and effective unit selection trigger, but as my map grew, I realized that I needed a repick trigger. I tried several triggers but I think I'm in way over my head so I come to you guys.

So this is my class selection trigger (or 108 triggers to be exact...)

Events:
Unit - A unit owned by Player 1 (Red) Acquires an item

Conditions:
(Item-type of (Item being manipulated)) Equal to |cffffcc00Scout|r

Actions:
Item - Remove (Item being manipulated)
Unit - Explode (Triggering unit)
Unit - Create 1 Scout for (Owner of (Triggering unit)) at (Center of Red Spawn <gen>) facing 0.00 degrees
Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Red Spawn <gen>) over 2.00 seconds
Special Effect - Create a special effect at (Center of Red Spawn <gen>) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl

--------------------------------------------------------------------

But as you might guess, this isnt as simple as a unit-enters-region and no matter what I've tried I can't seem to make it work. What I want is a trigger that waits 25 seconds after map start (I have a little intro), then the player types "-repick", all units that that player owns die, and another unit is spawned in the region next to the shop. Any help on this is welcome and thanks for solving my past questions

-Nine.
 
Level 11
Joined
Aug 25, 2006
Messages
971
First of all, the effect leaks. This means that even though it seems to go away, its still sitting in your memory hording space. You need to use the Destroy Special Effect action to remove this problem.


First you need this
  • AllowRepick
    • Events
      • Time - Elapsed game time is 25.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn on Repick <gen>
Then this. (This trigger is turned off by default)-- To do that uncheck 'Initially on'
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Set Temp_Group = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in Temp_Group and do (Unit - Kill (Picked unit))
      • Unit Group - Destroy unit group Temp_Group
      • -------- Replace 'Shop' with the actual shop building. --------
      • Set Temp_Point = (Position of Shop)
      • -------- Replace 'Footman' with the type of unit you actually want. --------
      • Unit - Create 1 Footman for (Triggering player) at Temp_Point facing Default building facing (270.0) degrees
      • Point - Remove Temp_Point
This should do what you want. (If I'm not mistaken)
 
Level 2
Joined
May 22, 2006
Messages
14
Well here's my trigger that I got to work with help from you.

  • Events
    • Player - Player 1 (Red) types a chat message containing -repick as An exact match
  • Actions
    • Trigger - Turn off Red Revival <gen>
    • Set Unit_repick = (Units owned by Player 1 (Red))
    • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit - Kill (Picked unit))
    • Unit Group - Remove all units of (Units owned by Player 1 (Red)) from Unit_repick
    • Unit - Create 1 Class Selector for Player 1 (Red) at (Random point in Red Repick <gen>) facing Default building facing degrees
    • Camera - Pan camera for Player 1 (Red) to (Center of Red Repick <gen>) over 2.00 seconds
    • Trigger - Turn on Red Revival <gen>
    • Trigger - Turn off (This trigger)
It works great, but I ran into a little problem with my respawn trigger:

  • Events
    • Unit - A unit owned by Player 1 (Red) Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Not equal to Class Selector
    • (Unit-type of (Triggering unit)) Not equal to Sentry Ward
    • (Unit-type of (Triggering unit)) Not equal to Stasis Trap
    • ((Triggering unit) is A structure) Equal to False
  • Actions
    • Game - Display to Player Group - Player 1 (Red) for 8.00 seconds the text: You are dead! Pleas...
    • Set Unit = (Unit-type of (Triggering unit))
    • Wait 7.50 seconds
    • Camera - Pan camera for Player 1 (Red) to (Center of Red Spawn <gen>) over 2.00 seconds
    • Unit - Create 1 Unit for Player 1 (Red) at (Center of Red Spawn <gen>) facing 0.00 degrees
    • Special Effect - Create a special effect at (Center of Red Spawn <gen>) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
So I turn off my respawn trigger and everything works fine, but when I repick while one of my unit has died in combat, it respawns and I get my repick, so I end up with two units. Any suggestions?
 
Status
Not open for further replies.
Top