experience for units (sort of)

Kyux

Active Member
Reaction score
3
hey, does anyone know how to make a variable for EVERY unit? a serperate one? so for every unit it kills, or every unit it attacks the variable goes up by .1 and then damage is increased by that variable. the idea is that the more it kill the more damage it does.

anyone know how?
 

tommerbob

Minecraft. :D
Reaction score
110
Well I don't really know the answer to your question, but its an interesting concept.

Hmm, that gives me some ideas... thanks! :)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
multiple ways, the easiest would be using the custom value of units.

the custom value is an integer variable assigned to every single unit. however many custom skills or systems use it and it might malfunction if you use it for something else.

if the "experience" has a maximum limit another very easy way would be to use a hidden passive ability (like tornado slow aura without any effect) and level that ability up, the downside is of course the max value is fixed.

what you can do is indexing all of your units and using an integer array, will be limited to 8192 units though and it requires an index system.

another possibility is using a hashtable, that would be the most effective and most easiest way to implement however it is a bit advanced and not for beginners.
 

Bogrim

y hello thar
Reaction score
154
another possibility is using a hashtable, that would be the most effective and most easiest way to implement however it is a bit advanced and not for beginners.
I wouldn't recommend a hashtable for this sort of thing because the limit on data that hashtables can store is much smaller than an array.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
hashtables can store unlimited amount of data, the only limitation is that you can only have 256 hashtables.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Beware Handwritten:
Trigger:
  • ExperienceForKills
    • Events
      • Unit - A Unit dies
    • Conditions
      • ((Owner of (Dying Unit)) Not Equal (Owner of (Killing Unit)))
    • Actions
      • Unit - Set Custom value for (Killing Unit) to (Custom Value of (Killing Unit))+1

this will increase the custom value of the killing unit by 1 each time its killing a unit which is not owned by the owner of the killing unit.
the damage bonus effect would have to be triggered by yourself, i would suggest using a custom trueshot aura with many levels and setting its level for the killing unit depending on the units custom value.
 

Sjaakje

New Member
Reaction score
9
Accname's trigger is good, but know that if you have triggered abilities that use custom values that they will no longer work.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Accname's trigger is good, but know that if you have triggered abilities that use custom values that they will no longer work.

exactly.
as i said in my first post there are different ways to achieve this, the trigger given by me is the first possibility i have listed.
 

Kyux

Active Member
Reaction score
3
can i make the custom value, damage dealt (like the 7-12 thingy or w/e) increased by 0.1?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
the damage bonus of your unit has nothing to do with the custom value.
the actual damage bonus got to be an ability, preferably the trueshot or command aura with a hell lot of levels.
what you do is setting the level for that dummy damage bonus ability to a level dependant on the custom value.
 

Kyux

Active Member
Reaction score
3
ok, can you explain how i link the custom value to the trueshot aura? and how do i make the trueshot aura work for each individual unit?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top