Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 38 of 38

Thread: Questions about function fallbacks and chaining to generics

  1. #31
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by ironmano View Post
    The generic function is only 'automatically' called if you don't override that function in the hero file, same as always.
    There is a small change in that now a bot gets its own instance of the generic (whole file not just the function) with dofile. This didn't work this way before with the old method.

    No I am very happy how it is now, I was referring to arz_on4dt's implication that some functions call the generic when not overridden and some don't. Maybe a bug I dunno, but no I don't want overridden functions calling generics automatically
    Wups, my bad. Yep, from now on I have to called all *Think() functions in ability_item_usage_generic.lua on every ability_item_usage_botname.lua like AbilityLevelUpThink() did if I use the new boilerplate code.

  2. #32
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Yeah, we didn't change anything in which functions get called -- this change was entirely in the boilerplate stuff at the top/bottom of .lua files, and the addition of the botsinit.lua file with the BotsInit.CreateGeneric() function.

  3. #33
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Aye the way it works now is like calling in a function. Actually, that's literally what it is. There's no issues when trying to call specific bots. I've been using my own functions in place of the generic files for this reason. Now, I can make use of generic files again!

    This is probably a good thing overall since module() is fully removed in newer versions of Lua.

  4. #34
    Basic Member
    Join Date
    May 2014
    Posts
    270
    BTW, where can I override default bot swapping, picking up, and dropping item? It seems like default bot tend to refuse some of the actions :
    1. When I tried to swap boots in the backpack with less valuable item in the inventory other than consumable or support item, it's always swap it back and forth so both item that swapped will be unusable.
    2. When I tried to make the bot drop an item it always tries to pick them stright up in result it will idle at current location.
    3. Default bots seems to stuck at roshan pit when they try to pick up the aegis. After I looked at their inventory, they always swap item they want to swap from the main inventory to the backpack back and forth

  5. #35
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Quote Originally Posted by arz_on4dt View Post
    BTW, where can I override default bot swapping, picking up, and dropping item? It seems like default bot tend to refuse some of the actions :
    1. When I tried to swap boots in the backpack with less valuable item in the inventory other than consumable or support item, it's always swap it back and forth so both item that swapped will be unusable.
    2. When I tried to make the bot drop an item it always tries to pick them stright up in result it will idle at current location.
    3. Default bots seems to stuck at roshan pit when they try to pick up the aegis. After I looked at their inventory, they always swap item they want to swap from the main inventory to the backpack back and forth
    1) Yep, currently the default "optimize backpack" code is always running, which is fighting you. I need to disable that functionality under some circumstances.
    2) That should be caused by the item mode, which is for picking up items on the ground. Are you overriding that mode?
    3) There's currently a bug where their "optimize backpack" code is fighting the code in the item pickup mode that's trying to make space for an item on the ground (much like issue #1). Will fix.

  6. #36
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by ChrisC View Post
    1) Yep, currently the default "optimize backpack" code is always running, which is fighting you. I need to disable that functionality under some circumstances.
    2) That should be caused by the item mode, which is for picking up items on the ground. Are you overriding that mode?
    3) There's currently a bug where their "optimize backpack" code is fighting the code in the item pickup mode that's trying to make space for an item on the ground (much like issue #1). Will fix.
    1. Answered
    2. Do you mean mode_item_generic.lua? I don't have mode_item_generic.lua in my script folder.
    3. Answered
    BTW Chris, if you have time, can you make this bot (ember spirit, earth spirit, terrorblade, phoenix, techies, underlord, winter wyvren, and arc warden ) at least behave like the other default bot do even without any item or skill build. If I take a look at npc_hero.txt there is this code that similiar to this
    Code:
    "Bot"
    		{
    			"HeroType"		"DOTA_BOT_SEMI_CARRY | DOTA_BOT_GANKER"
    			"LaningInfo"
    			{
    				"SoloDesire"		"0"
    				"RequiresBabysit"		"2"
    				"ProvidesBabysit"		"0"
    				"SurvivalRating"		"2"
    				"RequiresFarm"		"2"
    				"ProvidesSetup"		"0"
    				"RequiresSetup"		"1"
    			}
    		}
    in all heroes except for the heroes that I've mentioned above. If I add that code above in npc_hero.txt on list heroes I've mentioned above, will it have any effect on how that default bot heroes behave? Because from all heroes that I've been implemented, only that list of heroes that behave strangely ( they didn't go at team fight mostly or sometimes feeding )
    Last edited by arz_on4dt; 02-17-2017 at 11:27 AM.

  7. #37
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    2. Yeah, the default implementation of that mode will try to pick up items.

  8. #38
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by ChrisC View Post
    2. Yeah, the default implementation of that mode will try to pick up items.
    Owh OK. Thanks Chris.

Posting Permissions

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