• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Hero Experience System

This bundle is marked as pending. It has not been reviewed by a staff member yet.
[BOX]
Experience System
Created by Midnighters

I had been looking around Hive for a while, searching for a system that did something similar, and found little to nothing. I know it can be done outside of triggers fairly easily, through GamePlay Constants and Experience Given in the object Editor, but many, like myself, don't understand the Constants.

So to alleviate my issues, I decided to create this system, and figured, if I am looking for something like this, maybe others are as well, so here it is!

Contents

Triggers

ChangeLog


Contains the Following:
  • Allows you to set custom values for Experience Given upon Kills
  • Allows you to set custom units to variables, to define what units give experience
  • Allows you to define the value of level experience required
This system was designed to enable the user to customize the units which can be killed for experience, as well as the total experience given upon kill. It checks to ensure that the killing unit is a hero, compares the current experience to the required experience, and compares the dying unit UnitType to ensure it is contained in the variable array of the system as a unit that does give experience.

In the future, this system will also have portions designed to handle custom destructibles, giving experience upon destroying them, that way if you have a profession system, you can gain defined experience for using them.



Variables

Variable Setup Trigger

Level Trigger


Variables are defined in the Variable Setup trigger, All variables in that trigger short of the following snippet are customizable.
  • For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)
    • Loop - Actions
      • Set VariableSet ExpSys_ExpToLevel[(Integer A)] = ((Integer A) x ExpSys_ExpInt)

Set the Maximum Level for the heroes.
  • Set VariableSet ExpSys_MaxLevel = 10
Set the experience difference required per level, Level 1 - 20Exp, Level 2 - 40Exp, Level 3 - 60Exp and so on...
  • Set VariableSet ExpSys_ExpInt = 20
Define the Unit which will give experience to the Hero.
  • Set VariableSet ExpSys_Creep[1] = Bandit
Define the Experience given by the previously defined unit.
  • Set VariableSet ExpSys_ExpGiven[1] = 8
All variables mentioned in this section are customization unless otherwise told. Any variables not explained here, are recommended not to be changed, as it will have an effect on the entire system.


  • ExpSys Variable Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ----------------------------------------- --------
      • -------- Set Max Level For Heroes --------
      • -------- ----------------------------------------- --------
      • Set VariableSet ExpSys_MaxLevel = 10
      • Set VariableSet ExpSys_ExpInt = 20
      • -------- ------------------------------------------------------- --------
      • -------- Set Experience Required Per Level --------
      • -------- Current Level Multiplied by Variable --------
      • -------- ------------------------------------------------------- --------
      • For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)
        • Loop - Actions
          • Set VariableSet ExpSys_ExpToLevel[(Integer A)] = ((Integer A) x ExpSys_ExpInt)
      • -------- -------------------------------------------------- --------
      • -------- Set Units for Experience System --------
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[1] = Bandit
      • Set VariableSet ExpSys_ExpGiven[1] = 8
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[2] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[2] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[3] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[3] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[4] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[4] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[5] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[5] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[6] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[6] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[7] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[7] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[8] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[8] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[9] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[9] = 0
      • -------- -------------------------------------------------- --------
      • Set VariableSet ExpSys_Creep[10] = No unit-type
      • Set VariableSet ExpSys_ExpGiven[10] = 0
      • -------- -------------------------------------------------- --------

  • ExpSys Unit Killed
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- Sets TempUnits for the Actions --------
      • Set VariableSet ExpSys_TempUnit[1] = (Dying unit)
      • Set VariableSet ExpSys_TempUnit[2] = (Killing unit)
      • -------- Used in cases you would like to set messages to Triggering Player. --------
      • Set VariableSet ExpSys_TempGroup = (Player group((Owner of ExpSys_TempUnit[2])))
      • -------- Set PlayerNumber to Ensure Variables are Tied to Player --------
      • Set VariableSet ExpSys_PlayerNum = (Player number of (Owner of ExpSys_TempUnit[2]))
      • -------- Set Hero Level to a Variable to Use Later --------
      • Set VariableSet ExpSys_HeroLevel[ExpSys_PlayerNum] = (Hero level of ExpSys_TempUnit[2])
      • -------- Delete The Disable Experience Action --------
      • -------- Add it to your Hero Pick Trigger of your Map --------
      • Hero - Disable experience gain for ExpSys_TempUnit[2].
      • For each (Integer A) from 1 to ExpSys_MaxLevel, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ExpSys_TempUnit[2] is A Hero) Equal to True
              • ExpSys_HeroLevel[ExpSys_PlayerNum] Less than ExpSys_MaxLevel
              • (Unit-type of ExpSys_TempUnit[1]) Equal to ExpSys_Creep[(Integer A)]
            • Then - Actions
              • -------- Adds Unit Experience to Current Experience --------
              • Set VariableSet ExpSys_ExpCurrent[ExpSys_PlayerNum] = (ExpSys_ExpCurrent[ExpSys_PlayerNum] + ExpSys_ExpGiven[(Integer A)])
              • -------- --------------------------------------------------------------------- --------
              • -------- ---------- DELETE UPON IMPORTING ---------- --------
              • -------- ------ ONLY USED TO CONFIRM VARS ------ --------
              • -------- V ----------------------------- V ----------------------------- V --------
              • Game - Display to ExpSys_TempGroup the text: (Experience Gained: + ((String(ExpSys_ExpGiven[(Integer A)])) + Experience))
              • Game - Display to ExpSys_TempGroup the text: (Current Experience: + ((String(ExpSys_ExpCurrent[ExpSys_PlayerNum])) + Experience))
              • -------- If you Decide to use Messages or PlayerGroups --------
              • -------- Be sure that you Destroy the PlayerGroup Leak --------
              • Custom script: call DestroyForce(udg_ExpSys_TempGroup)
              • -------- ^ ----------------------------- ^ ----------------------------- ^ --------
              • -------- ---------- DELETE UPON IMPORTING ---------- --------
              • -------- ------ ONLY USED TO CONFIRM VARS ------ --------
              • -------- --------------------------------------------------------------------- --------
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ExpSys_TempUnit[2] is A Hero) Equal to True
          • ExpSys_HeroLevel[ExpSys_PlayerNum] Less than ExpSys_MaxLevel
          • ExpSys_ExpCurrent[ExpSys_PlayerNum] Greater than or equal to ExpSys_ExpToLevel[ExpSys_HeroLevel[ExpSys_PlayerNum]]
        • Then - Actions
          • -------- Sets Hero Level to [Hero Level + 1] --------
          • Hero - Set ExpSys_TempUnit[2] Hero-level to (ExpSys_HeroLevel[ExpSys_PlayerNum] + 1), Show level-up graphics
          • -------- Equation Used to Ensure Excess Experience is not Wasted --------
          • Set VariableSet ExpSys_ExpCurrent[ExpSys_PlayerNum] = (ExpSys_ExpCurrent[ExpSys_PlayerNum] - ExpSys_ExpToLevel[ExpSys_HeroLevel[ExpSys_PlayerNum]])
        • Else - Actions

Version 0.1

Version 0.2


Initial Release to HiveWorkshop

Removed PlayerGroup Leak
Added ExpSys_TempGroup Player Group Variable to ensure PlayerGroup leak can be destroyed.


[/BOX]
Contents

Experience System (Map)

So does this system function like normal experience? If so, sounds very interesting.
Very similar, yes, it does not yet show the experience gained on unit kill, which is planned next.

I will also be using this in conjunction with an Item drop system I will be making, so this sysyem will more than likely expand in the future.
 
Sounds cool. This should give the user a lot more control over how xp is given then.
Thats the overall goal. I may also look into adding support for destructables, that way if you have proffesions, you can gain experience from those as well. I will make it togglable with a boolean, that way it checks what portion is active.
 
Level 4
Joined
May 24, 2017
Messages
93
Why does your map and system not work? The hero gets to 20 exp and nothing happens. Why does this happen? The triggers are also really hard to understand. Can the exp requirement in the hero UI be changed to show how much exp is needed for the next level or something to indicate how much is needed?
 
Top