Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

GetBotNames() should pick without repetition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • adamqqq
    replied
    Yeah, I also think it is nice to assign a specific name to a particular hero. So that we can give a specific hero to assign a suitable professional player nickname!

    Leave a comment:


  • Lord_Zera
    replied
    The issue with repeated names is due to you submitting the same name list for both teams.

    Do a check on GetTeam() and submit different lists with at least 5 names for radiant/dire to get unique names.

    That said, a way to set names for specific slots (and with that heroes) would be nice.

    Leave a comment:


  • The Nomad
    replied
    Originally posted by Platinum_dota2 View Post
    GetBotName is fine (and I think it should be as it is) , but having an additional function like your AssignBotNames suggestion would be useful and also enough
    No, you are right, of course! It would break other custom bots. Then the cleanest method to get the names AND not break code is this:

    Code:
    function AssignBotNames (tNames)
    Where tNames is a table that holds the names of the bots: if GetBotNames() doesn't exist, then tNames holds the default list (Mordecai, Archy etc.) and if GetBotNames() exists then tNames returns the custom names set by GetBotNames().

    And yes, as we both said, if the function is missing, to fall back to the as-is code.


    EDIT: the pciture also shows another issue: since each team has a different VM, there should be a way to exclude the same name from appearing twice if the same script is executed on both teams.
    Last edited by The Nomad; 08-22-2017, 01:49 PM.

    Leave a comment:


  • Platinum_dota2
    replied
    Originally posted by The Nomad View Post
    Prolly for diversity. The defaults are also randomized.

    However, I agree with you. I think a better option would be this:
    • replace the global GetBotNames() event with SetBotNames()
    • add a global function GetBotNames() that either returns the default ones (if SetBotNames() is missing) either the custom ones (added with SetBotNames())
    • add a global AssignBotNames() event that gets called once after SetBotNames()


    ... and add the following behavior:
    1. if AssignBotNames() is missing, then keep the as-is behavior
    2. if AssignBotNames() exists, call it and make it use an indexed table similar to the lane assignment

    This is what I am thinking:
    Code:
    function SetBotNames () -- this event is called once as it is now, replaces GetBotNames(), fills up the bot names table that is used for the bots
        return 
        {
            "bot_name1", "superbot", "dota bot", "no name", "unknown", "secret name", "me"
        }
    end
    
    function AssignBotNames() -- called once at the beginning of the game when bots "connect", after SetBotNames()
        local names = GetBotNames();  -- this is the new func that returns the bot name table (either the default names or the custom ones defined if SetBotNames() exists)
    
        return 
        { 
            [1] = names[2],
            [2] = names[10],
            [3] = names[1],
            [4] = names[11],
            [5] = names[6]
        }
    end
    Just a thought
    Maybe you guys have a better approach
    GetBotName is fine (and I think it should be as it is) , but having an additional function like your AssignBotNames suggestion would be useful and also enough (just set the names you like inside it). If someone is not overriding it, it can fall back to the random assignments behavior (then people won't have to change anything if they don't want to).

    Leave a comment:


  • The Nomad
    replied
    Originally posted by Platinum_dota2 View Post
    I'm gonna start using only if I can select who has which name! I don't know why it is randomized in the first place!
    Prolly for diversity. The defaults are also randomized.

    However, I agree with you. I think a better option would be this:
    • replace the global GetBotNames() event with SetBotNames()
    • add a global function GetBotNames() that either returns the default ones (if SetBotNames() is missing) either the custom ones (added with SetBotNames())
    • add a global AssignBotNames() event that gets called once after SetBotNames()


    ... and add the following behavior:
    1. if AssignBotNames() is missing, then keep the as-is behavior
    2. if AssignBotNames() exists, call it and make it use an indexed table similar to the lane assignment

    This is what I am thinking:
    Code:
    function SetBotNames () -- this event is called once as it is now, replaces GetBotNames(), fills up the bot names table that is used for the bots
        return 
        {
            "bot_name1", "superbot", "dota bot", "no name", "unknown", "secret name", "me"
        }
    end
    
    function AssignBotNames() -- called once at the beginning of the game when bots "connect", after SetBotNames()
        local names = GetBotNames();  -- this is the new func that returns the bot name table (either the default names or the custom ones defined if SetBotNames() exists)
    
        return 
        { 
            [1] = names[2],
            [2] = names[10],
            [3] = names[1],
            [4] = names[11],
            [5] = names[6]
        }
    end
    Just a thought
    Maybe you guys have a better approach

    Leave a comment:


  • Yavimaya
    replied
    yea i would also like to be able to assign names to certain bots (by hero, not slot), but i think random as default is best.... its the way the valve bots work.

    Leave a comment:


  • Platinum_dota2
    replied
    I'm gonna start using only if I can select who has which name! I don't know why it is randomized in the first place!

    Leave a comment:


  • The Nomad
    replied
    Already reported
    You will notice that if you switch to default bots without closing DOTA you will get custom names with default bots. Both issues were reported to Chris.

    Leave a comment:


  • axetion
    started a topic GetBotNames() should pick without repetition

    GetBotNames() should pick without repetition

    Currently names will sometimes be picked multiple times, since it appears to simply pick randomly as opposed to shuffling the list and then assigning each name once.

    Example:

    Code:
    function GetBotNames()
        return {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
    end
    Result:



    As you can see bot names 1, 8 and 10 are repeated (took me only one try).
Working...
X