- Joined
- Mar 8, 2024
- Messages
- 10
Hello
I am trying to make a system where each players units will be moved to a random location chosen from a pool of 8 locations without being moved to the same region.
Out of curiosity and my lack of skill i asked ChatGPT to help me as it actually helped create some other triggers. As i expected ChatGPT cant do everything and the triggers it helped me make doesnt do what i want it to.
This is where i am looking for advice from actual people with brighter minds than me.
The units are all moved to a region but some of the players end up in the same region.
Variables: (this is ChatGPT describtion of the variables used)
PlayerRegions: (Region Array [1-8]): Stores each player’s starting region.
AvailableRegions: (Region Array [1-8]): Tracks which regions are available for the current round.
PlayerAssignedRegion: (Integer Array [1-8]): Stores the region index currently assigned to each player.
RandomRegionIndex (Integer): Temporarily stores a random number for region selection.
RegionCount (Integer): Tracks the number of available regions during selection.
I am trying to make a system where each players units will be moved to a random location chosen from a pool of 8 locations without being moved to the same region.
Out of curiosity and my lack of skill i asked ChatGPT to help me as it actually helped create some other triggers. As i expected ChatGPT cant do everything and the triggers it helped me make doesnt do what i want it to.
This is where i am looking for advice from actual people with brighter minds than me.
The units are all moved to a region but some of the players end up in the same region.
Variables: (this is ChatGPT describtion of the variables used)
PlayerRegions: (Region Array [1-8]): Stores each player’s starting region.
AvailableRegions: (Region Array [1-8]): Tracks which regions are available for the current round.
PlayerAssignedRegion: (Integer Array [1-8]): Stores the region index currently assigned to each player.
RandomRegionIndex (Integer): Temporarily stores a random number for region selection.
RegionCount (Integer): Tracks the number of available regions during selection.
-
RegionArray
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Set PlayerRegions[1] = 1 <gen>
-


Set PlayerRegions[2] = 2 <gen>
-


Set PlayerRegions[3] = 3 <gen>
-


Set PlayerRegions[4] = 4 <gen>
-


Set PlayerRegions[5] = 5 <gen>
-


Set PlayerRegions[6] = 6 <gen>
-


Set PlayerRegions[7] = 7 <gen>
-


Set PlayerRegions[8] = 8 <gen>
-
-
-
SetAvailableRegions
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


For each (Integer A) from 1 to 8, do (Actions)
-



Loop - Actions
-




Set AvailableRegions[(Integer A)] = PlayerRegions[(Integer A)]
-
-
-


For each (Integer A) from 1 to 8, do (Actions)
-



Loop - Actions
-




Set PlayerAssignedRegion[(Integer A)] = 0
-
-
-


Set RegionCount = 8
-


Trigger - Run AssignRandomRegions <gen> (ignoring conditions)
-
-
-
AssignRandomRegions
-

Events
-

Conditions
-

Actions
-


Player Group - Pick every player in (All players) and do (Actions)
-



Loop - Actions
-




Set RandomRegionIndex = (Random integer number between 1 and RegionCount)
-




For each (Integer A) from 1 to 8, do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Picked player) Equal to (Player((Integer A)))
-
-







Then - Actions
-








Set PlayerAssignedRegion[(Integer A)] = RandomRegionIndex
-








Set AvailableRegions[RandomRegionIndex] = AvailableRegions[RegionCount]
-








Set RegionCount = (RegionCount - 1)
-
-







Else - Actions
-
-
-
-
-
-


Trigger - Run MoveToAssigendRegion <gen> (ignoring conditions)
-
-
-
MoveToAssigendRegion
-

Events
-

Conditions
-

Actions
-


Player Group - Pick every player in (All players) and do (Actions)
-



Loop - Actions
-




For each (Integer A) from 1 to 8, do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Picked player) Equal to (Player((Integer A)))
-
-







Then - Actions
-








Unit Group - Pick every unit in (Units in AbilityGiveRegion <gen> owned by (Picked player)) and do (Actions)
-









Loop - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












((Picked unit) is A structure) Equal to False
-
-











Then - Actions
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














(Unit-type of (Picked unit)) Not equal to Peasant
-
-













Then - Actions
-














Unit - Move (Picked unit) instantly to (Center of PlayerRegions[PlayerAssignedRegion[(Integer A)]])
-














Camera - Pan camera for (Player((Integer A))) to (Center of PlayerRegions[PlayerAssignedRegion[(Integer A)]]) over 0.00 seconds
-
-













Else - Actions
-
-
-











Else - Actions
-
-
-
-
-







Else - Actions
-
-
-
-
-
-
-



