• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Rank System & Timed Income

Status
Not open for further replies.
Level 4
Joined
Aug 2, 2007
Messages
69
I have two vital aspects for a new map that I cant figure out how to do but I do have the general idea.

Rank System:
After a unit gets a certain amount of kills, have that unit replaced with a stronger type. For example: If a footman for Player 1 gets 5 kills, replace it with a Captain.

Timed Income:
I already know how to do the event and actions of this trigger, but I cant seem to figure out the condition. This is what it would look like:

  • Income
  • Events
  • Time - Income_Timer expires
  • Conditions
  • Actions
  • Player - Add 10 to Player 1 (Red) Current gold
The condition that I want to input is for a specific building. So if this building exists, thats when the amount of gold will be added when the timer expires.
 
Level 5
Joined
Apr 16, 2005
Messages
153
For the Ranked System, if you dont have mana used for something already, then use mana. Example trigger

Unit dies:

If Killing Unit's Current Mana is equal to 5 then
Replace unit with a Captian
Else
Add 1 Mana to killing unit

As for the income, i suggest using 2 triggers and an interger variable. For every time that a building is built, it increases the variable. Then use the current trigger you have to Add (Interger Variable) gold to the player.
 
Level 4
Joined
Aug 2, 2007
Messages
69
Okay, problem with the ranking trigger you've given me. The first time a unit kills another unit, his mana will go up by one, but after that, if he kills more, his mana will no longer go up by one again, so it will stay as 1/100 mana.

Here's my trigger for it:
  • Dranei Guardian to Protector
  • Events
  • Unit - A unit Dies
  • Conditions
  • (Killing unit) Equal to (Random unit from (Unit of type Dranei Guardian))
  • Actions
  • If ((Mana of(Killing Unit)) Greater than or equal to 5.00 then do (Unit - Replace (Killing unit) with a Dranei Protector using The new unit's default life and mana else do (Unit - Set mana of (Killing Unit) to 1.00)
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Mana does work, but that would be just extra work for you since you would have to add mana to every unit. It's better to use 'custom values'. They are like invisible numbers that you can attach to an unit, and they are only good for triggers.
There's an action under 'units' Set custom value of unit. Use that and every time an unit kills set the custom value of the killing unit to + 1. Then use a condition (integer comparison) to check if the custom value of the unit is 5, and then do your actions.
 
do not use mana! Spells are the essential part of a fun map!

I would increase a "Kill count" variable for every kill the unit gets.

  • Rank
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set RankKills = (RankKills + 1)
then if they have a certain number of kill count

  • Upgrade rank
    • Events
      • Unit - A unit Dies
    • Conditions
      • RankKills Equal to 5
    • Actions
      • Unit - Replace (Killing unit) with a Footman using The new unit's default life and mana
if you want it for separate players add an array and just make one of these for each array/player


for the income i would make a trigger that turns on the income timer when you build the building.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Just_Spectating, your way isn't MUI, and it could easily be replaced by Custom Values (which also happen to be MUI)

  • Add Kill
    • Events
      • Unit - A Unit Dies
    • Conditions
      • (Owner of (Killing Unit)) is an enemy of (Owner of (Triggering Unit)) Equal to True
      • -------- I added that condition so that people can't kill their own weak units for exp --------
    • Actions
      • Unit - Set Custom Value of (Killing Unit) to ((Custom Value of (Killing Unit)) + 1)
      • If (All Conditions are True) Then do (Then actions) Else do (Else actions)
        • If - Conditions
          • (Custom Value of (Killing Unit)) Greater than or Equal to (some number)
        • Then - Actions
          • Unit - Replace Killing Unit with a (some unit), using the Old Unit's Relative Life and Mana
        • Else - Actions
 
Status
Not open for further replies.
Top