Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Use a high to low sorter.
Sort

Events


Time - Elapsed game time is 1.00 seconds

Conditions

Actions


Unit Group - Pick every unit in (Random 1 units from (Units in (Playable map area))) and do (Actions)



Loop - Actions




Set FirstUnit = (Picked unit)




Set FirstUnitCustomValue = (Custom value of FirstUnit)


Unit Group - Pick every unit in (Random 1 units from (Units in (Playable map area))) and do (Actions)



Loop - Actions




Set SecondUnit = (Picked unit)




Set SecondUnitCustomValue = (Custom value of SecondUnit)


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



If - Conditions




SecondUnit Equal to FirstUnit



Then - Actions




Trigger - Run (This trigger) (ignoring conditions)




Skip remaining actions



Else - Actions


Set CurrentHighestCustomValue = (Max(FirstUnitCustomValue, SecondUnitCustomValue))


Set LowestCustomValue = (Min(FirstUnitCustomValue, SecondUnitCustomValue))


Set X = (100.00 x (Real(CurrentHighestCustomValue)))


Unit - Move (Random unit from (Units in (Playable map area) matching ((Custom value of (Matching unit)) Equal to CurrentHighestCustomValue))) instantly to (Point(X, 0.00))


Unit - Move (Random unit from (Units in (Playable map area) matching ((Custom value of (Matching unit)) Equal to LowestCustomValue))) instantly to (Point((100.00 x (Real(LowestCustomValue))), 0.00))


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



If - Conditions




(Execution count of (This trigger)) Less than or equal to 100



Then - Actions




Trigger - Run (This trigger) (ignoring conditions)



Else - Actions
You can use quick sort or fusion but fusion is boring when you got nb_units != 2^x :/
DemoCode

Events

Conditions

Actions


Set F = 1


Unit - Set the custom value of Ryu 0000 <gen> to 5


Unit - Set the custom value of Rand 0008 <gen> to 4


Unit - Set the custom value of Bow 0005 <gen> to 3


Unit - Set the custom value of Nina 0007 <gen> to 6


Unit Group - Pick every unit in Figh_All_Units_Group and do (Actions)



Loop - Actions




Set h2LSorterUnitArray[F] = (Picked unit)




Set F = (F + 1)


Set F = 1


-------- The minimum value is the lowest key value that you use in the array. Example: I used tempInt from 1 to 10. The minimum value is 1. --------


Set h2LMinValue = 1


-------- The maximum value is the highest key value that you use in the array. Example: I used tempInt from 1 to 10. The maximum value is 1. --------


Set h2LMaxValue = h2LMaxValue


-------- Then you call the sorter function --------


Custom script: call H2LCustomValueSorter()


-------- After that is called you can use the data. The array for high to low is sorted in here. --------


-------- It is keyed to the units custom value and it stores the placement number in the integer array. Example: If h2LReturnedPlacementH2L[ 5] == 1 then it is in first. If h2LReturnedPlacementH2L[ 200] is 1 it is in first. --------


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



Loop - Actions




-------- You can display which unit is in first second and so on using this. --------




Game - Display to (All players) for 30.00 seconds the text: (Name of h2LSorterUnitArray[(Integer A)])




Game - Display to (All players) for 30.00 seconds the text: (String(h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[(Integer A)])]))
Commence Fight 2

Events

Conditions

Actions


Game - Display to (All players) for 5.00 seconds the text: (Fighting Unit: + (Name of h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]))


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



If - Conditions




(Number of units in Fight_Enemy_Group) Greater than or equal to 1




(Number of units in Party_Group) Greater than or equal to 1




(Fight_Source_Unit[F] is alive) Equal to True




(Fight_Targeted_Enemy[F] is alive) Equal to True



Then - Actions




Game - Display to (All players) for 5.00 seconds the text: Conditions Passed.....




Animation - Play h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]'s attack animation




Animation - Queue h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]'s stand animation




Unit - Cause h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]] to damage Fight_Targeted_Enemy[F], dealing 100.00 damage of attack type Normal and damage type Normal




Special Effect - Create a special effect attached to the origin of Fight_Targeted_Enemy[F] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl




Special Effect - Destroy (Last created special effect)




Set F = (F + 1)




Wait 3.00 seconds




Trigger - Run Commence Fight 2 <gen> (checking conditions)



Else - Actions
Count Distance

Events


Time - Every 0.10 seconds of game time

Conditions

Actions


Set WalkPoint1 = WalkPoint2


Set WalkPoint2 = (Position of Party_Order[1])


Set WalkAmount = (WalkAmount + (Distance between WalkPoint1 and WalkPoint2))


Custom script: call RemoveLocation (udg_WalkPoint1)


Custom script: set udg_WalkPoint1=null
Encounter

Events


Game - WalkAmount becomes Greater than or equal to 900.00

Conditions

Actions


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



If - Conditions




WalkAmount Greater than or equal to WalkAmountRandomReal



Then - Actions




Game - Display to (All players) for 5.00 seconds the text: (String(WalkAmount))




Set WalkAmount = 0.00




Set WalkAmountRandomReal = (Random real number between 900.00 and 1900.00)




Sound - Play Enemy_Encountered <gen>




Cinematic - Fade out and back in over 2.10 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency




Trigger - Run Fight Setup <gen> (checking conditions)




Trigger - Turn off Count Distance <gen>



Else - Actions
Fight Setup

Events

Conditions

Actions


Set Fight_Unit_Pending = Party_Order[1]


Set F = 1


Selection - Select Fight_Unit_Pending for Player 1 (Red)


Unit Group - Pick every unit in Party_Group and do (Actions)



Loop - Actions




Unit - Move (Picked unit) instantly to (Center of Battle 1 Alliance <gen>), facing (Center of Battle 1 Enemies <gen>)




Unit - Set (Picked unit) movement speed to 0.00


Camera - Apply BattleScene1 <gen> for Player 1 (Red) over 0.00 seconds


Camera - Lock camera target for Player 1 (Red) to Fight_Camera_Unit[1], offset by (0.00, 0.00) using Default rotation


Unit - Create 1 Furbolg Ursa Warrior for Player 12 (Brown) at (Center of Battle 1 Enemies <gen>) facing (Center X of Battle 1 Alliance <gen>) degrees


Unit Group - Add (Last created unit) to Fight_Enemy_Group


Unit Group - Add all units of Fight_Enemy_Group to Figh_All_Units_Group


Unit Group - Add all units of Party_Group to Figh_All_Units_Group


Unit Group - Add (Last created unit) to Fight_Enemy_Group


Unit - Set the custom value of (Last created unit) to 2


Unit - Set (Last created unit) movement speed to 0.00


-------- -------------- --------


-------- Start Sort Code --------


-------- -------------- --------


Trigger - Run DemoCode <gen> (checking conditions)


-------- -------------- --------


-------- End Sort Code --------


-------- -------------- --------


Wait 1.00 seconds


Sound - Play Breath_of_Fire_II_SNES_OST_Cross_Counter <gen>
DemoCode

Events

Conditions

Actions


Set F = 1


Unit - Set the custom value of Ryu 0000 <gen> to 5


Unit - Set the custom value of Rand 0008 <gen> to 4


Unit - Set the custom value of Bow 0005 <gen> to 3


Unit - Set the custom value of Nina 0007 <gen> to 6


Unit Group - Pick every unit in Figh_All_Units_Group and do (Actions)



Loop - Actions




Set h2LSorterUnitArray[F] = (Picked unit)




Set F = (F + 1)


Set F = 1


-------- The minimum value is the lowest key value that you use in the array. Example: I used tempInt from 1 to 10. The minimum value is 1. --------


Set h2LMinValue = 1


-------- The maximum value is the highest key value that you use in the array. Example: I used tempInt from 1 to 10. The maximum value is 1. --------


Set h2LMaxValue = (Number of units in Figh_All_Units_Group)


-------- Then you call the sorter function --------


Custom script: call H2LCustomValueSorter()


-------- After that is called you can use the data. The array for high to low is sorted in here. --------


-------- It is keyed to the units custom value and it stores the placement number in the integer array. Example: If h2LReturnedPlacementH2L[ 5] == 1 then it is in first. If h2LReturnedPlacementH2L[ 200] is 1 it is in first. --------


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



Loop - Actions




-------- You can display which unit is in first second and so on using this. --------




Game - Display to (All players) for 30.00 seconds the text: (Name of h2LSorterUnitArray[(Integer A)])




Game - Display to (All players) for 30.00 seconds the text: (String(h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[(Integer A)])]))
Que Orders

Events


Unit - A unit Is issued an order targeting an object

Conditions


(Triggering unit) Equal to Fight_Unit_Pending

Actions


Game - Display to (All players) for 5.00 seconds the text: (((Name of Fight_Unit_Pending) + (Ordered Unit): ) + (String(F)))


Unit - Order (Triggering unit) to Stop


Set Fight_Targeted_Enemy[F] = (Target unit of issued order)


Set Fight_Source_Unit[F] = (Triggering unit)


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



If - Conditions




(Issued order) Equal to (Order(attack))



Then - Actions




Set Fight_Basic_Attack[F] = True



Else - Actions


Unit - Change ownership of Fight_Unit_Pending to Player 9 (Gray) and Change color


Set F = (F + 1)


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



If - Conditions




F Less than or equal to 4



Then - Actions




Set Fight_Unit_Pending = Party_Order[F]




Unit - Change ownership of Fight_Unit_Pending to Player 1 (Red) and Change color




Selection - Select Fight_Unit_Pending for Player 1 (Red)



Else - Actions


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



If - Conditions




F Equal to 5



Then - Actions




Set F = 1




Game - Display to (All players) for 5.00 seconds the text: (Fighting Unit: + (Name of h2LSorterUnitArray[h2LReturnedPlacementH2L[1]]))




Wait 2.00 seconds




Trigger - Run Commence Fight 2 <gen> (checking conditions)




Trigger - Turn off (This trigger)



Else - Actions
Commence Fight 2

Events

Conditions

Actions


Game - Display to (All players) for 30.00 seconds the text: (Fighting Unit: + (Name of h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]))


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



If - Conditions




(Number of units in Fight_Enemy_Group) Greater than or equal to 1




(Number of units in Party_Group) Greater than or equal to 1




(Fight_Source_Unit[F] is alive) Equal to True




(Fight_Targeted_Enemy[F] is alive) Equal to True



Then - Actions




Game - Display to (All players) for 30.00 seconds the text: Conditions Passed.....




Animation - Play h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]'s attack animation




Animation - Queue h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]]'s stand animation




Unit - Cause h2LSorterUnitArray[h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[F])]] to damage Fight_Targeted_Enemy[F], dealing 100.00 damage of attack type Normal and damage type Normal




Special Effect - Create a special effect attached to the origin of Fight_Targeted_Enemy[F] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl




Special Effect - Destroy (Last created special effect)




Set F = (F + 1)




Wait 3.00 seconds




Trigger - Run Commence Fight 2 <gen> (checking conditions)



Else - Actions
DemoCode

Events

Conditions

Actions


Set F = 1


Unit - Set the custom value of Ryu 0000 <gen> to 5


Unit - Set the custom value of Rand 0008 <gen> to 4


Unit - Set the custom value of Bow 0005 <gen> to 3


Unit - Set the custom value of Nina 0007 <gen> to 6


Unit Group - Pick every unit in Figh_All_Units_Group and do (Actions)



Loop - Actions




Set h2LSorterUnitArray[F] = (Picked unit)




Set F = (F + 1)


Set F = 1


-------- The minimum value is the lowest key value that you use in the array. Example: I used tempInt from 1 to 10. The minimum value is 1. --------


Set h2LMinValue = 1


-------- The maximum value is the highest key value that you use in the array. Example: I used tempInt from 1 to 10. The maximum value is 1. --------


Set h2LMaxValue = (Number of units in Figh_All_Units_Group)


-------- Then you call the sorter function --------


Custom script: call H2LCustomValueSorter()


-------- After that is called you can use the data. The array for high to low is sorted in here. --------


-------- It is keyed to the units custom value and it stores the placement number in the integer array. Example: If h2LReturnedPlacementH2L[ 5] == 1 then it is in first. If h2LReturnedPlacementH2L[ 200] is 1 it is in first. --------


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



Loop - Actions




-------- You can display which unit is in first second and so on using this. --------




Game - Display to (All players) for 30.00 seconds the text: (Name of h2LSorterUnitArray[(Integer A)])




Game - Display to (All players) for 30.00 seconds the text: (String(h2LReturnedPlacementH2L[(Custom value of h2LSorterUnitArray[(Integer A)])]))
DemoCode

Events

Conditions

Actions


Set F = 1


Unit - Set the custom value of Ryu 0000 <gen> to 5


Unit - Set the custom value of Rand 0008 <gen> to 4


Unit - Set the custom value of Bow 0005 <gen> to 3


Unit - Set the custom value of Nina 0007 <gen> to 6


-------- Are these units above added to the group ??????? --------


Unit Group - Pick every unit in Figh_All_Units_Group and do (Actions)



Loop - Actions




Set h2LSorterUnitArray[F] = (Picked unit)




Set F = (F + 1)


-------- The minimum value is the lowest key value that you use in the array. Example: I used tempInt from 1 to 10. The minimum value is 1. --------


Set h2LMinValue = 1


-------- The maximum value is the highest key value that you use in the array. Example: I used tempInt from 1 to 10. The maximum value is 1. --------


Set h2LMaxValue = F


-------- Set f to one again. --------


Set F = 1


-------- Then you call the sorter function --------


Custom script: call H2LCustomValueSorter()


-------- After that is called you can use the data. The array for high to low is sorted in here. --------


-------- It is keyed to the units custom value and it stores the placement number in the integer array. Example: If h2LReturnedPlacementH2L[ 5] == 1 then it is in first. If h2LReturnedPlacementH2L[ 200] is 1 it is in first. --------


Unit Group - Pick every unit in Figh_All_Units_Group and do (Actions)



Loop - Actions




Set F = custom value of picked unit




-------- You can display which unit is in first second and so on using this. --------




Game - Display to (All players) for 30.00 seconds the text: (Name of h2LSorterUnitArray[F])




Game - Display to (All players) for 30.00 seconds the text: (String(h2LReturnedPlacementH2L[F]))
