Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Anyone else get error with 'GetActualDamage' on ally creep after update ?

  1. #1
    Basic Member
    Join Date
    Dec 2016
    Posts
    123

    Anyone else get error with 'GetActualDamage' on ally creep after update ?

    Code:
    [VScript] Script Runtime Error: ...2 beta\game\dota\scripts\vscripts\bots\bot_alchemist.lua:329: attempt to call method 'GetActualDamage' (a nil value)
    stack traceback:
    my code run smoothly before the update and now it's showing this message.
    tried one of my backup code and it looks the same. 'GetActualDamage' is broken for ally creep.

    --------
    edit: problem solved after replace all 'GetActualDamage' with the new function name. Thx to antigame.
    Last edited by lunarbreez; 02-03-2017 at 08:36 PM.

  2. #2
    I'm gonna take my complaints about these updates to heavens (who am I kidding, hell will take me with open arms ).

  3. #3
    Basic Member
    Join Date
    Feb 2015
    Posts
    15
    I saw this new function on wiki: GetActualIncomingDamage, can you use it instead of GetActualDamage and see if it works ? (I think Chris forgot to mention this change in the latest update)

  4. #4
    Please don't tell me they changed the function's name because it "sounded" better.

  5. #5
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    They do it for clarity, as people have complained about confusing function names. It's actually happened a few times.
    GetModifier() -> GetModifierName() and GetPlayer() -> GetPlayerID() as a couple of examples.

  6. #6
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Quote Originally Posted by Platinum_dota2 View Post
    Please don't tell me they changed the function's name because it "sounded" better.
    Well, not just because it sounded better, but because it's more clear/less confusing.

  7. #7
    Quote Originally Posted by ChrisC View Post
    Well, not just because it sounded better, but because it's more clear/less confusing.
    Yeah, I'm gonna nag whenever you change the existing API (improvements or new functions are a different story)

    On a more serious note, I understand the API is still evolving, but if you don't consider the inputs, then GetActualIncomingDamage is not that much less confusing! For instance, this can be interpreted as how much health the hero lost last time someone dealt damage to him (which actually makes more sense!) or something similar. I'm not saying this so you change it again, but what I mean is that I think that things which are "good enough" shouldn't be changed for slight improvements, since I think the updates should have a balance between how much current scripters will be annoyed vs how much future scripters will be happy!

  8. #8
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Among all the GetBaseDamage() and GetAttackDamage(), I thought it was important to clarify that this function is talking about incoming, not outgoing damage. But yeah, I get your point too.

    Though honestly I don't like the function that much, I'd rather just separate out "please give me damage value X after reductions Y" into its own function. There's no real reason it needs to be unit-based when it's just doing some math for you.

  9. #9
    Quote Originally Posted by ChrisC View Post
    Among all the GetBaseDamage() and GetAttackDamage(), I thought it was important to clarify that this function is talking about incoming, not outgoing damage. But yeah, I get your point too.

    Though honestly I don't like the function that much, I'd rather just separate out "please give me damage value X after reductions Y" into its own function. There's no real reason it needs to be unit-based when it's just doing some math for you.
    Keeping it unit based makes our job a bit easier, since otherwise we have to get how much the target has damage reduction for an specific damage type and then use another function to calculate the actual damage (and I don't see any other reason for using this functionality). However, I see the problem that it is hard to find a good name for the function when it is unit based (and it is hard to make all the function names consistent in general).

  10. #10
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    It's not hard to make the names, it's hard to make the names without then being too long. XD

    Calling it CalculateHowMuchDamageWouldBeTakenAfterReductions( int Damage, int DamageType) would get the message across, but it takes up so much space.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •