EvilCrizpy

Level 14
This is an advanced, and much easier system to that created by "Born_By_Killers"

Creating a Advanced Tier System (GUI)
Difficulty 3/5

Basical Knowledge of editor required
Able to understand the use of arrays

------------------------------------------------------------------
So lets begin, throughout this tutorial you will learn how to create a advanced tier system for your map, RPG, or any other map you wish to use it in.

So what does this system do? Basically it will create the next tier up for your unit. So as you say, Upgrading the unit, Or advancing to a new tier, It will be made through two triggers. (But i shall be showing three) Unit and Hero type Tier using.

First Steps
First Steps

~-~-~-~-~-~-~-~-~-~-~-~-
The Variables,
You may be thinking that we will require many different variables to set the units to, and the next tier units to, well their is a much simpler way of doing this

First,
Open the Trigger Editor and press CTRL+B or Find "Variables..." at the top bar.
Once open presss CTRL+N or Find "Add New Variable"

--------------------------------------------------------------
Variables;

Variable Type : Integer | Variable Name : UnitLoop | Array : No
Variable Type : Integer | Variable Name : MaxDifferentUnits | Array : No
Variable Type : Integer | Variable Name : LevelRequiremtn | Array : Yes
Variable Type : Unit-Type | Variable Name : Tier1Units | Array : Yes
Variable Type : Unit-Type | Variable Name : Tier2Units | Array : Yes
These two variables can be repeated for the amount of tiers you want.

What do each Variable do?

UnitLoop - This will be used in the checking of the units tier; But we will come to that later
MaxDifferentUnits - This is an important trigger, this variable changes according to the amount of units you have, obviously you normally have, if there is 3 tier 1 units then their would be 3 tier 2 units. So therefore This variable will be 3
LevelRequirement - This the requirement the hero needs for the upgade.
Tier1Units/Tier2Units - This is the unit/units they were/are going to be advancing into.
Second Step
Second Step

~-~-~-~-~-~-~-~-~-~-~-~-
Setting the variables,

First,
Create a trigger called "Set Variables' and do the following,
each action will be explained in the following trigger.

• Set variables
• Events
• Map initialization
• Conditions
• Actions
• -------- Tier 1 Units - These are the basis untis. --------
• Set Tier1Units[1] = Footman
• Set Tier1Units[2] = Rifleman
• Set Tier1Units[3] = Priest
• -------- Tier 2 Units - These are what they advance into --------
• Set Tier2Units[1] = Knight
• Set Tier2Units[2] = Mortar Team
• Set Tier2Units[3] = Spell Breaker
• -------- To add more tiers simply follow the following pattern, and ofcourse create another trigger --------
• -------- called Tier#Units "Changing # to a number of the next tier" --------
• -------- Simply change the MaxNumber to the amount of units that each tier has so --------
• -------- My tier one and two have 3 units, so my max number is "3" --------
• Set MaxDifferentUnits = 3
• -------- Now to set the level requirement; --------
• -------- Tier 1-2 = LevelRequirement[1] --------
• -------- Tier 2-3 = LevelRequirement[2] --------
• -------- This will keep repeating for how many tiers you have --------
• Set LevelRequirement[1] = 10
• Set LevelRequirement[2] = 15
We are setting this in Map initialization so that we are able to do the tier upgrade throughout the game, so we do not need to set it each time a unit enters the upgrade area.
Third Step
Third Step

~-~-~-~-~-~-~-~-~-~-~-~-
Creating the region for the upgrade area;

So we will now need a region where the unit will enter to be detected and run the trigger which will be created later.

First,
Go to Terrain Editor,
At the top go to Window -- > New Palette -- > Region Palette
This will open up the Region creator
You should see the following image in the Box to the right of your screen
.

Click it and select a suitable size for the enter Region,
i would recommened a 2x2 Size (If you want to use a circle of power for decoration so that the enter region looks more... Interesting)
You may rename this region by right clicking the region in the "Region Palette" and clicking "Edit Region Properties" and change Region name to something suitable, i chose in this case "Upgrade Area"
Now repeat this step for the region that the new unit will be created at. Call this region "New Unit" or another suitable name.

Secondly,
if you decide you want to add a Circle of power to the point of where the region is, then select Unit Palette.
Go to Netural Passive and change "Melee" to "Campaign" and find the Unit Circle Of Power (Large)
Place this unit at the point of where the region "Upgrade" is, You may press CTRL+R to find where you place.

Final Step
~-~-~-~-~-~-~-~-~-~-~-~-
The actual trigger for tier advancing; I will show both Unit and Hero advancment,
Creat a new trigger called "Unit Advancment" and do the following once again,
the use of each action will be showed in the trigger.

• Events
• Unit - A unit enters Upgrade <gen>
• Conditions
• Actions
• For each (Integer UnitLoop) from 1 to MaxDifferentUnits, do (Actions)
• Loop - Actions
• -------- To allow more units to advance, simply copy the following trigger below. --------
• -------- I will explain what each point does --------
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Unit-type of (Triggering unit)) Equal to Tier1Units[UnitLoop]
• Then - Actions
• -------- Set TempPoint to region where units will be moved to --------
• Set TempPoint = (Center of Region 001 <gen>)
• -------- Set TempUnit to "enterring Unit" --------
• Set TempUnit = (Triggering unit)
• -------- Clear selection so no errors occur --------
• -------- And remove TempUnti --------
• Unit - Remove TempUnit from the game
• Selection - Clear selection for (Owner of TempUnit)
• -------- Create unit type, of next tier for selected unit. --------
• Unit - Create 1 Tier2Units[UnitLoop] for (Owner of TempUnit) at TempPoint facing Default building facing degrees
• -------- Selec last created unit for "Entering Unit" --------
• Selection - Select (Last created unit) for (Owner of TempUnit)
• -------- Remove Leaks --------
• Custom script: call RemoveLocation(udg_TempPoint)
• Else - Actions
Now we will look at the hero trigger; it is the same as above just with more conditions.
Once again if action will be explained.
• Events
• Unit - A unit enters Upgrade <gen>
• Conditions
• Actions
• -------- To allow more units to advance, simply copy the following trigger below. --------
• For each (Integer UnitLoop) from 1 to MaxDifferentUnits, do (Actions)
• Loop - Actions
• -------- I will explain what each point does --------
• -------- Change the Array of the LevelRequirement to next level of tier; --------
• -------- So to tier 2 it would be [1] --------
• -------- So to tier 3 it would be [2] --------
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Triggering unit) is A Hero) Equal to True
• (Unit-type of (Triggering unit)) Equal to Tier1Units[UnitLoop]
• LevelRequirement[1] Equal to (Hero level of (Triggering unit))
• Then - Actions
• -------- Set TempPoint to region where units will be moved to --------
• Set TempPoint = (Center of Region 001 <gen>)
• -------- Set TempUnit to "enterring Unit" --------
• Set TempUnit = (Triggering unit)
• -------- Clear selection so no errors occur --------
• -------- And remove TempUnti --------
• Selection - Clear selection for (Owner of TempUnit)
• Unit - Remove TempUnit from the game
• -------- Create unit type, of next tier for selected unit. --------
• Unit - Create 1 Tier2Units[UnitLoop] for (Owner of TempUnit) at TempPoint facing Default building facing degrees
• -------- Selec last created unit for "Entering Unit" --------
• Selection - Select (Last created unit) for (Owner of TempUnit)
• -------- Remove Leaks --------
• Custom script: call RemoveLocation(udg_TempPoint)
• Set TempUnit = No unit
• Else - Actions
Conclusion
Conclusion

What have you just created?
Well you have created a simple but advanced system which does not require more than one If Then else Action,
but also a easy to edit system, with many posibilities.

Ofcourse here is the test map for those that require a much easier look at the trigger.

Note - I will add pictures soon as i return home to my computer. Shouldn't be too long,
and also upload a test map.

Last edited:

Maker

Level 37
Hashtables would allow you to skip looping through the unit type array. At map initialization, save an integer value, which tells the array index, using the unit type as the key. Then load the integer to get the new unit's type array index.

EvilCrizpy

Level 14
Hashtables would allow you to skip looping through the unit type array. At map initialization, save an integer value, which tells the array index, using the unit type as the key. Then load the integer to get the new unit's type array index.

I will possibly add that to "Part two"
As that will maybe change the difficulty, so i will create a different section for the hashtables.

Last edited:

haxel96

Level 9
Hashtables will make it better but some people don't know how to use them.

The tutorial is easy to follow Nice job.

PurgeandFire

Level 44
Note - I will add pictures soon as i return home to my computer. Shouldn't be too long,
and also upload a test map.

Hopefully you will be able to add those pictures, and a demo map would be particularly useful. (especially when explaining a system) Either one will suffice if you can't do both.

EDIT: This user is inactive and due to a lack of updates, I'm going to graveyard this.

~Graveyarded. Let me know if you come back EvilCrizpy and I'll move it back!

Last edited:

Replies
3
Views
1K
Replies
7
Views
2K
Replies
1
Views
828
Replies
9
Views
1K
Replies
18
Views
4K