Forum rules - please read before posting.

Containers: Loot Randomization Pool

Hello, is there anyway to add an action so that on container click, the loot pulls from a loot table and randomizes it in the container for the player instead of there being always that type of loot in that container.

Thanks.

Comments

  • Of course - custom Actions can be added as explained here.  So you mean for the contents of the container itself to be randomised?  I would recommend running such an Action when your game begins, rather than at the point the player opens it.  Have a look at ActionContainerSet.cs to use as a basis.

    To add an item to a contained, you use this function:

    container.Add (invID, amount);

    where "container" is a variable reference to your container class, "invID" is the ID number of the inventory you're adding, and "amount" is the amount (if you can carry multiple instances of the item).

    So to randomise it, all you need to do is randomise the invID from a list of Inventory IDs you want to be made available.  An Inventory Item's ID number can be found to the left of the item's label in the Inventory Manager.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.