HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help Me With Trigger!

07-14-2005, 05:17 AM#1
WarGod-X
I have a map that is 3v3v3. There are three start locations (regions) at the eges of the map. I need each team to start at a different location at random. So the trigger needs to create 3 units (1 per player) at a random one of 3 locations, while still keeping the teams together.

Help please? I cant figure this one out.
07-14-2005, 07:04 AM#2
Azhag
Edit: Sorry... my bad, I was thinking of something else.
07-14-2005, 03:29 PM#3
Guest
Heres teh general idea i tried to make a trigger but failed.
Set all the players on a team to a player variable array, so you will need 3
Then set ur 3 regions to a region variable array, so u will need 1
then instantly move team1 to region[random nubmer from 1 to 3]
then if then else move team 2 to a spot no occupied
and team 3 to whatever is left

i havent put much thought into this so dont give me bad rep
07-15-2005, 12:07 AM#4
WarGod-X
Quote:
Originally Posted by xerox237
then instantly move team1 to region[random nubmer from 1 to 3]
then if then else move team 2 to a spot no occupied
and team 3 to whatever is left

That's the exact part that's bothering me. I can't figure out how to make them spawn in different regions, while staying in teams.
07-15-2005, 12:46 AM#5
Guest
doesn't leaving the "fixed starting locations" unchecked work? Like in the melee game where it's random...
07-17-2005, 01:13 AM#6
TaintedReality
Make an integer variable called TeamStart or something. Then at map init set that variable to be a random number between 1 and 3. Then make an If/Else statement that says if TeamStart = 1, create unit for player at region 1, if TeamStart = 2, create unit for player at region 2, if Teamstart = 3 create unit for player at region 3.
07-17-2005, 01:41 AM#7
Killa_Demon1833
you could... well... mabey I shouldn't.... i forgot now... i can't open up world edit cuz my new dvd drive is possesed... it keeps opening n closing, haf way, full way, part way... ARGGH!
07-18-2005, 03:18 AM#8
Guest
Quote:
Originally Posted by Killa_Demon1833
you could... well... mabey I shouldn't.... i forgot now... i can't open up world edit cuz my new dvd drive is possesed... it keeps opening n closing, haf way, full way, part way... ARGGH!

Another useless post by Killa_Demon1833 which has no relevance to this post.

Anyway:
Code:
Trriggers
    Events
        Map initialization
    Conditions
    Actions
        Set Blue_Point = (Random integer number between 1 and 3)
        Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                    Loop - Actions
                        Unit - Move (Picked unit) instantly to (Center of BC[Blue_Point])
                        Set Region_Taken[Blue_Point] = True
        Set Blue_Point = (Random integer number between 1 and 3)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Region_Taken[Blue_Point] Equal to True
            Then - Actions
                Set Blue_Point = (Random integer number between 1 and 3)
            Else - Actions
                Player Group - Pick every player in (All allies of Player 4 (Purple)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                Unit - Move (Picked unit) instantly to (Center of BC[Blue_Point])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units in BC[1] <gen>)) Greater than 0
            Then - Actions
                Do nothing
            Else - Actions
                Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                Unit - Move (Picked unit) instantly to (Center of BC[1] <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units in BC[2] <gen>)) Greater than 0
            Then - Actions
                Do nothing
            Else - Actions
                Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                Unit - Move (Picked unit) instantly to (Center of BC[2] <gen>)
       If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Number of units in (Units in BC[3] <gen>)) Greater than 0
    Then - Actions
        Do nothing
    Else - Actions
        Player Group - Pick every player in (All allies of Player 7 (Green)) and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                    Loop - Actions
                        Unit - Move (Picked unit) instantly to (Center of BC[3] <gen>)




Edit: Err that may not be 100% but you get the idea.
07-18-2005, 08:29 AM#9
Anitarf
No, it' not 100%, it's only 89%. You have an 11% chance that first two teams will be created at the same spot. Here's a better trigger (now, it assumes players 1,2,3 are one team, 4,5,6 second and 7,8,9 third because you didn't specify otherwise):

Code:
Events:
    Map initialization
Conditions:
Actions:
    Set PointArray[1] = Centre of (spawn region 1)
    Set PointArray[2] = Centre of (spawn region 1)
    Set PointArray[3] = Centre of (spawn region 1)
    for each integer A from 0 to 2 do actions
        loop - actions:
            set tempInteger = Random integer number between 1 and (3 - (Integer A))
            pick every unit in (units in region matching condition) playable map area matching (owner of (matching unit) is an ally of Player(1 + ( (Integer A) x 3 ) )) and do actions
                loop - actions:
                    move picked unit to PointArray[(tempInteger)]
            for each integer B from tempInteger to (3 - (Integer A)) do actions
                loop - actions:
                    set PointArray[(Integer B)] = PointArray[((Integer B) + 1)]
            
07-18-2005, 03:00 PM#10
Guest
89% is fine for my at midnight in the basement. ^_^