Oninuva
You can change this now in User CP.
- Reaction score
- 221
Unit Rank System
By: Oninuva
By: Oninuva
The promoting in mine goes by:
Private: 2 Kills
Major: 5 Kills
Captain: 15 Kills
Of course you can change yours to what ever you want.
You need to create a skill based off engineering upgrade. Change it to one level and make it a unit ability. Null all the values. I changed mine to:
Private: +2 Damage
Major: +5 Damage
Captain: +10 Damage
But notice that engineering upgrade has a lot more values which you can change. A few ones which are easy to implement in any game are:
Damage
Movement Speed
Ability Upgrade
If you have the effects for it you can even put a symbol over the head of the units by attaching it.
Copy and paste it two times to make the ranks Major and Captain. Next you have to make three triggers.
Code:
PreSetup
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Set Unit[UnitNum] = (Picked unit)
Unit - Set the custom value of (Picked unit) to UnitNum
Set UnitNum = (UnitNum + 1)
Custom Script: call DestroyGroup(udg_UnitGroup)
Code:
UnitCreated
Events
Unit - A unit Finishes construction
Conditions
Actions
Set Unit[UnitNum] = (Last created unit)
Unit - Set the custom value of Unit[UnitNum] to UnitNum
Set UnitNum = (UnitNum + 1)
Code:
Record
Events
Unit - A unit Dies
Conditions
Actions
Set RankStore[(Custom value of (Killing unit))] = (RankStore[(Custom value of (Killing unit))] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RankStore[(Custom value of (Attacking unit))] Equal to 2
Then - Actions
Unit - Add Private to (Killing unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RankStore[(Custom value of (Attacking unit))] Equal to 5
Then - Actions
Unit - Remove Private from (Killing unit)
Unit - Add Major to (Killing unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RankStore[(Custom value of (Attacking unit))] Equal to 10
Then - Actions
Unit - Remove Major from (Killing unit)
Unit - Add Captain to (Killing unit)
Else - Actions
The variables which are used are:
RankStore – Integer
Unit – Unit Array
UnitNum – Integer
You can download the icons that I used here.
The demo map is attached.
Sorry that the icons are attached else where but too little space to put stuff here.