• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] is there a reason why this trigger isn't working?

Status
Not open for further replies.
Level 3
Joined
May 12, 2008
Messages
28
  • Farmer Spawn
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farmer
    • Actions
      • Unit - Create 1 Farmer for (Triggering player) at (Random point in (Playable map area)) facing Default building facing degrees
      • Unit Group - Remove all units of (Units owned by (Triggering player)) from (Units in (Playable map area))
This trigger is supposed to remove all units of the player whos farmer died, but it won't work for some reason. Any ideas why?

I was also wondering with this trigger:
  • Farmers Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add (Number of units in (Units of type Barrack)) to Player 1 (Red) Current gold
How could I make each "barrack" or w/e unit im using worth 2 or 3 gold instead?
 
Level 3
Joined
May 12, 2008
Messages
28
There isn't any triggering player. Please use your... thing... inside your head next time.

Using triggering player on the first action worked just fine.

But on the second action(unit group one) triggering player didn't work. Besides triggering unit I can only choose from leaderboard-player in position, event response-previous owner, picked player, matching player, owner of unit/item, random player for player group. So far none of these have worked. So what else could I try?
 
Level 3
Joined
May 12, 2008
Messages
28
  • Farmer Spawn
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farmer
    • Actions
      • Unit - Create 1 Farmer for (Owner of (Triggering unit)) at (Random point in (Playable map area)) facing Default building facing degrees
      • Unit Group - Remove all units of (Units owned by (Owner of (Triggering unit))) from (Units owned by (Owner of (Triggering unit)))
Like this?

Cause that didn't change anything =/
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Umm, you're removing the units from the unit group, not from the game. Also, you should remove before you create a new farmer.

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick Every Unit in (Units owned by (Owner of (Triggering Unit))) and do Actions
      • Loop - Actions
        • Unit - Remove (Picked Unit) from the game
    • Unit - Create 1 Farmer for (Owner of (Triggering unit)) at (Random point in (Playable map area)) facing Default building facing degrees
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
In addition to purplepoot's reply add the:
  • Set variable *dying group* = Units owned by...
  • Set variable *stored region* to playable map
  • Set variable *your var name* to Random point in *stored region*
  • -your actions-
  • Custom script: call RemoveLocation(udg_*your var name*)
  • Custom script: call DestroyRect(udg_*stored region*)
So the trigger won't leak, but not sure does playable map area leak and not sure for the script: call DestroyRect maybe it is call RemoveRect
 
Level 3
Joined
May 12, 2008
Messages
28
Thanks very much everyone! This helps my map quite a bit +rep :)

Just a question, though, is how do I make my buildings burst in flame when they die instead of just disappear? is it a trigger problem, object editor, or gameplay constants thing?
 
Level 11
Joined
Dec 31, 2007
Messages
780
mmmm... you might replace your dying unit for an special effect using "spawned effects - neutral building explotion" via triggers.

something like

event
unit dies
condition
dying unit is a building == true
action
set Temp_Pos == position of dying unit
special effect - create an especial effect at Temp_Pos using (the effect i told you)
Custom script: call Remove Location(udg_Temp_Pos)

i think that would accomplish what you want.
 
Status
Not open for further replies.
Top