Nostrademous / Dota2-FullOverwrite

Work in progress for a full-overwrite Dota 2 bot framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Item Table Function

Nostrademous opened this issue · comments

As we implement more item-use rules we will need each bot to hold a table lookup of items they have to check if they want to use the item they possess.

Currently, since we only have a few items implemented, we check if we want to use each of the items we implemented every execution cycle.... however, as our list of supported items grow this will become very inefficient as we at most can only use 6 items in our inventory. So I propose each bot hold a table of the function pointers to the 6 items he has, updated as items change, and only check those 6 (maybe also considering backpack) each frame.

I started this and have a function for creating the function pointer that can be called to do this. Just need

  • create a Lua table with the appropriate methods so they can be invoked using it

  • complete the item list for all consumable items to follow the format of other items

  • write special-case code for certain items like "eul's" which is called "cyclone" (there are a few more)

  • change the decision.lua code to call item_use consideration when iterating over our current items