HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

2 More Questions

07-29-2006, 08:52 PM#1
scmstrack06
I have to go, but I'll be back later to see the answers.

Here are my 2 questions:

1) I created a trigger to remove all units in the start region that are not playing. The player 2 blue grunt always stays and is not removed. Here is my trigger:

Trigger:
Remove Grunts
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) slot status) Equal to Is unused))) and do (Actions)
Collapse Loop - Actions
Unit Group - Remove (Picked unit) from Grunts
Unit - Remove (Picked unit) from the game

2) All the help with the Fall Off The Path trigger was helpfull! No leaks and all, but my grunts don't die when they touch the black marble! Here is the trigger:

Trigger:
Fall Off Path
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Custom script: local location udg_L
Set L = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at L) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Not equal to True
Then - Actions
Collapse Else - Actions
Unit - Kill (Picked unit)
Collapse Else - Actions
Custom script: call RemoveLocation(udg_L)
Custom script: set udg_L = null
07-29-2006, 09:04 PM#2
Fireeye
alright, in the first trigger i didn't find a fault (maybe i've overseen it), but in the second there are 2 fault.
First, what an item? There's no item, you have to choose one type.
Second, set Not equal to equal.
You don't want a Unit to die when it has an special item, right?

--Edit---
Found error in first script change matching to picked, then it should work. (Sorry if i'm wrong, i'm tired)
07-29-2006, 09:25 PM#3
Captain Griffen
Change to:

Trigger:
Remove Grunts
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) is Not equal to playing))) and do (Actions)
Collapse Loop - Actions
Unit Group - Remove (Picked unit) from Grunts
Unit - Remove (Picked unit) from the game

I changed it to not equal to and moved the action to the then, as if you have an empty then an something on the else, I have found it to be buggy in the past (also neater).

Trigger:
Fall Off Path
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Custom script: local location udg_L
Set L = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at L) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Not equal to True
Then - Actions
Collapse Else - Actions
Unit - Kill (Picked unit)
Collapse Else - Actions
Custom script: call RemoveLocation(udg_L)
Custom script: set udg_L = null
[/quote]