- Joined
- Dec 6, 2009
- Messages
- 173
Hello!
I am in the making of a PUBG/Fortnite/Apex circle that spawn in a random location on the map and then shrinks. My problem is that if part of the circle is out of bounds it doesn't spawn correctly when it has shrunken enough to be inside world bounds. I have uploaded a test map aswell. If you set "CircleSizeMax = 8500" or larger the circle doesn't move at all and it ends the trigger. I guess there is a better way to do this but I'm out of ideas on how to make it work.
I tried my best to describe what everything does.
I am in the making of a PUBG/Fortnite/Apex circle that spawn in a random location on the map and then shrinks. My problem is that if part of the circle is out of bounds it doesn't spawn correctly when it has shrunken enough to be inside world bounds. I have uploaded a test map aswell. If you set "CircleSizeMax = 8500" or larger the circle doesn't move at all and it ends the trigger. I guess there is a better way to do this but I'm out of ideas on how to make it work.
I tried my best to describe what everything does.
-
Circle
-
Events
-
Time - Elapsed game time is 1.00 seconds
-
-
Conditions
-
Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Choose circle unit --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleDummyUnit = Circle Dummy
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Size of the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleSizeMax = 7500.00
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- The speed the circle moves towards the middle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleShrinkSpeed = 10.00
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Number of circle units that spawn --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleDummyNumber = 20
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- End size of the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleSizeMin = 500.00
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Position of the middle of the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleFacing = (Position of CircleDummy)
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- The amount of degrees the circle units will spawn in order to form the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleSpin = 20.00
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Creating the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
For each (Integer A) from 1 to CircleDummyNumber, do (Actions)
-
Loop - Actions
-
Set Circle_LoopLocation = (CircleFacing offset by CircleSizeMax towards (CircleSpin x (Real((Integer A)))) degrees)
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Checking World bounds so that the circle doesn't spawn outside of the map --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(X of Circle_LoopLocation) Greater than WB_MaxX
-
(X of Circle_LoopLocation) Less than WB_MinX
-
(Y of Circle_LoopLocation) Greater than WB_MaxY
-
(Y of Circle_LoopLocation) Less than WB_MinY
-
-
-
-
Then - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- If out of bounds no unit will spawn yet --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleDummy1[(Integer A)] = No unit
-
Set CircleBoundsPoint[(Integer A)] = Circle_LoopLocation
-
Game - Display to (All players) the text: Dummy = No Unit Tri...
-
-
Else - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Spawning the units forming the circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Unit - Create 1 Circle Dummy for Player 1 (Red) at Circle_LoopLocation facing CircleFacing
-
Set CircleDummy1[(Integer A)] = (Last created unit)
-
Custom script: call RemoveLocation(udg_Circle_LoopLocation)
-
-
-
-
-
Custom script: call RemoveLocation(udg_Circle_Location)
-
Trigger - Turn on Circle Loop <gen>
-
-
-
Circle Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to CircleDummyNumber, do (Actions)
-
Loop - Actions
-
Set Circle_Location = (Position of CircleDummy1[(Integer A)])
-
Set CircleAngle1 = (Facing of CircleDummy1[(Integer A)])
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Setting the new location the circle dummy will move to --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set Circle_LoopLocation = (Circle_Location offset by CircleShrinkSpeed towards CircleAngle1 degrees)
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- CircleBoundsPoint is to set a point for the units that spawns when they get inside World Bounds --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Set CircleBoundsPoint[(Integer A)] = (CircleBoundsPoint[(Integer A)] offset by CircleSizeMax towards (CircleSpin x (Real((Integer A)))) degrees)
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Checking if the Circle is range of its minimum size --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Circle_LoopLocation and CircleFacing) Less than or equal to CircleSizeMin
-
-
Then - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Custom script: call RemoveLocation(udg_Circle_LoopLocation)
-
Custom script: call RemoveLocation(udg_Circle_Location)
-
Set CircleAngle1 = 0.00
-
Game - Display to (All players) the text: (String(CircleSizeMax))
-
For each (Integer A) from 1 to CircleDummyNumber, do (Actions)
-
Loop - Actions
-
Set CircleDummy1[(Integer A)] = No unit
-
-
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- Checking if there already is a unit in the circle or if it can spawn one inside World Bounds --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CircleDummy1[(Integer A)] Equal to No unit
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(X of CircleBoundsPoint[(Integer A)]) Greater than WB_MaxX
-
(X of CircleBoundsPoint[(Integer A)]) Less than WB_MinX
-
(Y of CircleBoundsPoint[(Integer A)]) Greater than WB_MaxY
-
(Y of CircleBoundsPoint[(Integer A)]) Less than WB_MinY
-
-
-
-
Then - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- If it is still outside of World Bounce no unit will spawn. And the Message "Out of Bounds" will show. --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Game - Display to (All players) the text: Out of Bounds
-
-
Else - Actions
-
-------- ------------------------------------------------------------------------------------------------ --------
-
-------- If it is in bounds then the unit shall spawn in the correct order to form a circle --------
-
-------- ------------------------------------------------------------------------------------------------ --------
-
Game - Display to (All players) the text: In Bounds
-
Unit - Create 1 Circle Dummy for Player 1 (Red) at CircleBoundsPoint[(Integer A)] facing CircleFacing
-
Set CircleDummy1[(Integer A)] = (Last created unit)
-
Cinematic - Ping minimap for (All players) at CircleBoundsPoint[(Integer A)] for 1.00 seconds
-
Custom script: call RemoveLocation(udg_CircleBoundsPoint[GetForLoopIndexA()])
-
-
-
-
Else - Actions
-
Set CircleSizeMax = (CircleSizeMax - 0.25)
-
Unit - Move CircleDummy1[(Integer A)] instantly to Circle_LoopLocation
-
Custom script: call RemoveLocation(udg_Circle_LoopLocation)
-
Custom script: call RemoveLocation(udg_Circle_Location)
-
-
-
-
-
-
-
-