HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need trigger help!

03-20-2009, 05:15 PM#1
fille3002
OK, i've tried to make a simple but efective way of splitting a group of units into 2 groups, acctually to make units from one lane split and go 50% on one lane and 50% on other.

I thought that this would be an easy and efficient way of dealing with this problem but it wasn't. The units want to stay in one bunch and all of them goes onto one lane. I've tried to fix this a few times but it doesn't work.

Here's the 2 triggers.

Trigger:
hu orc to ne
Collapse Events
Unit - A unit enters orc hq <gen>
Collapse Conditions
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
Collapse Actions
Unit - Order (Triggering unit) to Move To (Random point in orc diagonal spawn <gen>)
Trigger - Turn on hu orc to ud <gen>
Trigger - Turn off (This trigger)

Trigger:
hu orc to ud
Collapse Events
Unit - A unit enters orc hq <gen>
Collapse Conditions
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
Collapse Actions
Unit - Order (Triggering unit) to Move To (Random point in orc north spawn <gen>)
Trigger - Turn on hu orc to ne <gen>
Trigger - Turn off (This trigger)

I've got many ideas of why this happens. None of them does make any logical sense, so i'm starting to think that they just don't wanna go away from eachother
The one that's dominant = the one that always get's it's order to work is the bottom one.

If someone can help me with this i'll be happy I don't care if it's done by JASS or GUI as long as it's easy to understand, beacuse i'm gonna use this trigger again in different parts of the map. Plz help me!

EDIT: The units which are in the region when the trigger is activated are sent to the diagonal lane, all others are sent to the north. Hope you can help!

EDIT2: The trigger works now. Tnx for helping me. I use Fledermaus' trigger. - the reason for bug was (i think) a simple typing error in another trigger (wich my jasshelper didn't find and wich didn't make the game crash) The help i got was still helpfull, though. Hope you all can help me next time i get stuck too! I didn't change anything more than that i think so i has to be the typo that bugged.
03-21-2009, 12:49 AM#2
Anopob
Why not assign the units with a custom value of 1 or 2, and then depending on what their custom value is when they enter a region, you diver their path to direction 1 or direction 2?
03-21-2009, 12:57 AM#3
Fledermaus
Something like this?

Trigger:
Trigger
Collapse Events
Unit - A unit enters orc hq <gen>
Collapse Conditions
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RandomBoolean Equal to True
Collapse Then - Actions
Set TempPoint = Random point in orc diagonal spawn <gen>
Set RandomBoolean = False
Collapse Else - Actions
Set TempPoint = Random point in orc north spawn <gen>
Set RandomBoolean = True
Unit - Order (Triggering unit) to Move To TempPoint
Custom script: call RemoveLocation(udg_TempPoint)

EDIT: removed the leak.
03-21-2009, 02:00 AM#4
Michael Peppers
Seems good enough to work.

BTW, maybe this won't change if it works or not, but try putting (Entering unit) instead of (Triggering unit)
03-21-2009, 02:14 AM#5
Blacktastic
I feel like a "switch" would be perfect here.

Unit Enters Region.

If Switch = 1

Go Left
Set Switch = 2

If Switch = 2

Go Right
Set Switch = 1

Also, Triggering unit works for Entering Region, and is actually slightly faster.

If the switch method doesn't work, I suggest either putting a small gap in the unit spawn (maybe .3 seconds) or doing the custom value idea.
03-21-2009, 02:39 PM#6
fille3002
Thanks for all the help! The part that makes this a little bit harder is that they are, after all, going through combat, which means that the groups they spawn in prbly will be uneven after a while.
@Bat: tnx, i'll try that one! I'll come back if it didn't work.
03-21-2009, 03:09 PM#7
fille3002
OK, i tried, but with the same result.
Trigger:
WC3C hu orc redirect test001
Collapse Events
Unit - A unit enters orc hq <gen>
Collapse Conditions
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CreepRedirectHuOrc1 Equal to True
Collapse Then - Actions
Set TempPointHuOrc1 = (Random point in orc diagonal spawn <gen>)
Set CreepRedirectHuOrc1 = False
Collapse Else - Actions
Set TempPointHuOrc1 = (Random point in orc north spawn <gen>)
Set CreepRedirectHuOrc1 = True
Unit - Order (Triggering unit) to Attack-Move To TempPointHuOrc1
Custom script: call RemoveLocation(udg_TempPointHuOrc1)
those bad creeps... They just don't wanna split...

Hope someone can help me! I've tried this a few times now but it still doesn't wanna work... Any solution is welcome!
03-22-2009, 08:12 PM#8
Anopob
Are the creeps entering the same region and how far apart are they with each other unit?