Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Item Table Function #199

Open
Nostrademous opened this issue Apr 11, 2017 · 1 comment
Open

Create Item Table Function #199

Nostrademous opened this issue Apr 11, 2017 · 1 comment

Comments

@Nostrademous
Copy link
Owner

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.

@Nostrademous
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant