- Joined
- Jul 1, 2009
- Messages
- 1,147
SOLVED
I'm trying to create a trigger that creates a star where there are no other stars. For some reason it's not working, and it has to do with the Pick Each Unit function as I've tried other variations on this trigger, however when I attempt to get it to detect whether or not there is a star already there it just ignores it and carries on. I cannot figure out another way for the game to detect if there's a star there, though.
Aside from creating 100+ of each type of region (massive headache) to detect if theres a region in a region, this is my only option.
I've tried using "is there a star there? if yes, set variable to true. Is variable false? then create a star there" but it doesn't work, and instead just spawns a star there anyways.
-> Move region
-> Are there stars there?
-> No? Create a star
-> Yes? Try again
Edit:
I'm trying to create a trigger that creates a star where there are no other stars. For some reason it's not working, and it has to do with the Pick Each Unit function as I've tried other variations on this trigger, however when I attempt to get it to detect whether or not there is a star already there it just ignores it and carries on. I cannot figure out another way for the game to detect if there's a star there, though.
Aside from creating 100+ of each type of region (massive headache) to detect if theres a region in a region, this is my only option.
I've tried using "is there a star there? if yes, set variable to true. Is variable false? then create a star there" but it doesn't work, and instead just spawns a star there anyways.
-> Move region
-> Are there stars there?
-> No? Create a star
-> Yes? Try again
-
Move System
-
Events
- Timer - Every 0.1 seconds of Game Time
- Local Variables
-
Conditions
- Total Solar Systems < Max Total Solar Systems
-
Actions
-
Unit Group - Pick each unit in Stars and do (Actions)
-
Actions
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
Or
-
Conditions
- ((Picked unit) is in System) == True
- ((Picked unit) is in Star) == True
-
Conditions
-
Or
-
Then
- Region - Move Star to (Random point in (Playable map area))
- Region - Move System to (Center of Star)
- Region - Move Planet to (Random point in System)
-
Else
- Variable - Modify Total Solar Systems: + 1
- Trigger - Run Create System (Check Conditions, Don't Wait until it finishes)
-
If
-
General - If (Conditions) then do (Actions) else do (Actions)
-
Actions
-
Unit Group - Pick each unit in Stars and do (Actions)
-
Events
-
Create System
- Events
- Local Variables
- Conditions
-
Actions
- Unit - Create 1 (Planet) Star (Orange) for player 0 at (Center of Star) using default facing (No Options)
- Unit Group - Add (Last created unit) to Stars
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- Total Solar Systems >= Max Total Solar Systems
-
Then
- Trigger - Run Scale Planets (Check Conditions, Wait until it finishes)
- Else
-
If
-
Move System
-
Events
- Timer - Every 0.1 seconds of Game Time
- Local Variables
-
Conditions
- Total Solar Systems < Max Total Solar Systems
-
Actions
- Region - Move Star to (Random point in (Playable map area))
- Region - Move System to (Center of Star)
- Region - Move Planet to (Random point in System)
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- ((Closest unit to (Center of Star) in Stars) is in Star) == False
-
Then
- Trigger - Run Create System (Check Conditions, Don't Wait until it finishes)
- Else
-
If
-
Events
-
Create System
- Events
- Local Variables
- Conditions
-
Actions
- Unit - Create 1 (Planet) Star (Orange) for player 0 at (Center of Star) using default facing (No Options)
- Unit Group - Add (Last created unit) to Stars
- Variable - Modify Total Solar Systems: + 1
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- Total Solar Systems >= Max Total Solar Systems
-
Then
- Trigger - Run Scale Planets (Check Conditions, Wait until it finishes)
- Else
-
If
Last edited: