1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Percentage based damage?

Discussion in 'Requests' started by PrinceOfThaWest, Nov 15, 2017.

  1. PrinceOfThaWest

    PrinceOfThaWest

    Joined:
    Mar 6, 2008
    Messages:
    1,027
    Resources:
    0
    Resources:
    0
    I am in the process of messing around with the editor, and from time to time working on my long term custom campaign project. Overall with everything in it made from scratch, I tend to keep my style of making that campaign more simplified than the usual ones. Perfect example would be units having health points ranging from 80 up to 250 for elites. Even heroes are semi-balanced with units, so they can't go around causing wreckage among enemy lines.

    However, with those low numbers I have an issue with maintaining balance and proper damage values. It seems kind of dull having units with approximately 80 health points fighting each other for 20 damage, or whatever of that sort. Instead, I had come up with an idea but I am not sure whether it's possible or not.

    What I had in mind is an ultimate trigger / script which converts the damage one unit receives into percentage instead. So for example, if I would like Footman to deal fixed 2% of unit's total health as damage with normal auto attack, I'd simply set their damage to 2-2. If I'd like to introduce more RNG with their damages, I could set their damage to be from 2 to 4, and then there'll be RNG for how much they'll harm the unit they're fighting.

    I am aware there are flaws to this system, as in armor values and damage reduction. However, I could work even without those as I'm trying to simplify things by a lot. My main focus is tactics, strategy and timing of attacks rather than random unit bashing and having meta's in the game.

    Same system could be introduced for spells, though their damage would range from 5 to 30 depending on sort and level, whether it's unit or hero spell and so on. So yeah, below I'll make a 'too long, didn't read' on my actual question.

    TL;DR
    Is there a way to make an universal trigger/script which will convert any incoming damage value into percentage number? This is applied to both auto attacks, spells and damages of all sorts.

    Thanks in advance, and if someone thinks they know the way, help would be more than appreciated.
     
  2. Veritas 117

    Veritas 117

    Joined:
    Nov 17, 2010
    Messages:
    1,174
    Resources:
    0
    Resources:
    0
    If you had a damage detection system it allows you to change the damage done by an attack. It detects the attack and allows you to instantly change the damage. You would just have to save the percentage you want for each unit type in a hashtable and then load the values each time a unit attacks. You would have to set the damage to whatever sort of mathematical formula you want using the number saved in the hashtable for each unit type.

    It could get a bit complicated, but look through the tutorials about hashtables and find a good damage detection system (I recommend the one by LOOKING_FOR_HELP or Bribe)

    As far as the formula goes, you'll have to figure that out on your own.

    Good luck!!
     
  3. PrinceOfThaWest

    PrinceOfThaWest

    Joined:
    Mar 6, 2008
    Messages:
    1,027
    Resources:
    0
    Resources:
    0
    Alright, it's at least something for the start. Thanks for your response, mate.