Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: May 15 Bot Update

  1. #11
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,642
    Quote Originally Posted by Lord_Zera View Post
    • I see my callback getting invoked twice for each event?
    Did you, by any chance, use your bot script for both teams?
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  2. #12
    Basic Member
    Join Date
    Jan 2012
    Posts
    41
    Quote Originally Posted by The Nomad View Post
    Did you, by any chance, use your bot script for both teams?
    Yes I did - but I saw the callbacks registered by the two sides called twice each!

  3. #13
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,642
    Try it with one team. Normally each team has its own VMm but I wanna rule out the possibility of a callback being done in loops
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  4. #14
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    Quote Originally Posted by Lord_Zera View Post
    Tried the callbacks and things seem somewhat broken
    • I see my callback getting invoked twice for each event?
    • The damage callback seems to be missing the "unit" field
    • The cast callback seems to be missing "unit" and "ability". The values in "location" are weird, most of the time they are zeroed, but sometimes I get something that seems reasonable.

    Can anyone replicate this?
    Yes, I agree with you on the castCallback. Haven't tested damage callback. I am getting 'nil' for ability and unit. Also, it looks like I'm getting two events when only 1 spell is casted (hence the double "traceback" errors). The ability cast was Enemy Sven casting his Stun. I can understand Location being <0,0,0> if I don't have vision of the unit that did the casting, but it should not be if we do.

    @ChrisC - I get the following:
    Code:
    [VScript] Script Runtime Error: attempt to call a table value
    stack traceback:
    [VScript] Script Runtime Error: attempt to call a table value
    stack traceback:
    [VScript] Script Runtime Error: ...2 beta\game\dota\scripts\vscripts\bots\webserver_out.lua:306: attempt to index field 'ability' (a nil value)
    stack traceback:
    	...2 beta\game\dota\scripts\vscripts\bots\webserver_out.lua:306: in function <...2 beta\game\dota\scripts\vscripts\bots\webserver_out.lua:296>
    My Code:
    Code:
    function callbackFunc( hTable )
        local str = '"'
        if callbackStr ~= "" then str = ', "' end
    
        str = str .. hTable.player_id .. '":{'
        if hTable.unit == nil then                                    <-- HAD TO ADD THIS AS hTable.unit is 'nil'
            str = str .. '"CastingUnit": UNKNOWN'
        else
            str = str .. '"CastingUnit": ' .. dumpUnitInfo( hTable.unit )
        end
        str = str .. ', "Ability": ' .. hTable.ability:GetName()
        local loc = hTable.location
        str = str .. ', "Loc_X": ' .. loc.x
        str = str .. ', "Loc_Y": ' .. loc.y
        str = str .. ', "Loc_Z": ' .. loc.z
        str = str .. '}'
        
        callbackStr = callbackStr .. str
    end
    I register the callback only once like this:
    Code:
            if not callbackInit then
                InstallCastCallback(-1, callbackFunc)
                callbackInit = true
            end

  5. #15
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    @ChrisC - still waiting on confirmation with respect to the cast and damage Callback functions and bugs associated with them posted here.

    Are we using the functions wrong or bug-fixes incoming?

  6. #16
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,646
    I'll have a fix in the next update.

Posting Permissions

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