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

[Bug] CreateHeroForPlayer unexpected behavior

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

  • [Bug] CreateHeroForPlayer unexpected behavior

    Code:
    CreateHeroForPlayer("npc_dota_hero_furion", PlayerResource:GetPlayer(playerID))
    Calling this function with a custom hero has this weird undesired behavior:



    This is an almost unmodified hero with a single ability to hide it (as we want to just have a hero dummy and continue the game as if it was never created)

    Code:
    "npc_dota_hero_furion"
    {
    	// General
    	//----------------------------------------------------------------
    	"override_hero"				"npc_dota_hero_furion"
    	
    	"Ability1" 					"hide_hero"
    
    	"VisionDaytimeRange"		"0"
    	"VisionNighttimeRange"		"0"
    }
    It has the same issue without the hide_hero ability.

    As far as I know, no one managed to make good use of the CreateHeroForPlayer function, and everyone is resorting to force picking a hero and ReplaceHeroWith calls.
    ModDota | My GitHub Profile | My Project's Page

  • #2
    What undesired behavior are you referring to? The fact that the hero is automatically selected? The camera? The health?

    Heroes should always be selectable in one way or another; this is innate behavior. I believe your hero is selectable anyway if you right click the map with no unit selected.
    Last edited by arhowk; 08-13-2015, 02:04 PM.
    Every time you have an issue, spend at least 5 minutes on each of these four sites Google, Wiki, Github, and ModDota
    If you still can't figure out your issue, post your issue on moddota in as much detail as possible with a SSCCE. If you do not complete these requirements, than you will be rejected by the community. Try not to contact individual users for help as we are very busy.

    Comment


    • #3
      There is a random Level 0, 0/0 Health hero that is being created in addition to the real created hero. It also produces a weird white minimap icon near the map origin:



      I managed to completely override hero select-ability with the hide_hero ability + panorama re-selection (for the hero hotkey), the only issue is that the hero made through CreateHeroByName is ruining the ability somehow.
      Last edited by Noya; 08-13-2015, 04:23 PM.
      ModDota | My GitHub Profile | My Project's Page

      Comment

      Working...
      X