Inventory Management

  • Hey all,

    I was looking at some code pertaining to weapons and was wondering how/where inventory is handled. By this I mean the replenishing of ammo (i.e. for crossbows) and the acquiring of weapons. Is this handled in an inventory manner, or is this very closely tied to the class of character? It would be cool to be able to pick up/equip weapons, or drop existing weapons.

    Any ideas?



  • Weapons aren’t tied to a certain class, though you will have to be careful giving certain classes weapons they don’t normally get because certain classes won’t have animation sets for certain weapons. For example, only the archer class has the animation sets for bows and crossbows.

    I believe there is a fixed “size” inventory with primary, secondary and tertiary slot (I think 4th is always fists). I’m pretty sure you can put whatever you want in those (e.g. you can give a knight 3 primaries). Best thing to do is experiment. If you want a start point, I suggest looking for the function SetWeapons() in the AOCPlayerController class (I think it’s that one…).

  • Thanks for the reply and the pointers NabsterHax! I’ll definitely take a look at SetWeapons(). With a little luck, it’s possible to extend the inventory to something a bit more fully featured, and add some custom UI :).

  • The method you are looking for replenishing ammo is AOCInventoryManager.ReplenishAllAmmo().

    Also when selecting a weapon from the menu, it will look whether it’s a valid weapon for your class from its FamilyInfo.


    This is for Knight.
    The method AOCPlayerController.AreWeaponsValidForCurrentFamilyInfo() is what check for those, and if it returns false, it will load a default weapon for your specific class.
    Recently I had to subclass it to allow Vanguards to run without tertiaries.

    Extending your inventory is possible, though, you will have a lot of work subclassing everything. And i mean it, you will be copy+pasting and rewritting a lot of code.
    As for the UI, changing what is already there is doable with the SDK, the problem is when you need to add new stuff to it. You will have to handle flash to add any new stuff to the HUD, and I’m not sure whether you can cook your own flash elements into your mod.

Log in to reply