I was thinking about having the possibility to create items at runtime through script. I am referring to armors and weapons with special properties... So i have some questions:
1) Would it be possible to create them on runtime?
2) Would it be possible to save them on runtime?
2b) If is it possible, can them be saved with each property in character inventory?
Thanks. :)
  • 1) Yes.

    2) Not out of the box. You'd have to e.g. add them to the save game data using the Custom Save Data system or save them in separate files.

    2b) The inventory save data only holds limited info, i.e. the items/equipment's actual settings and handling are just referenced through the ID, instead of saving all item data for each item in the inventory.
    I.e. if you save the items created at runtime with the custom save data, the items in your inventory (which are just the ID and some additional info like quantity) should keep working in a loaded game.

    Naturally, for that you'd need to restore the items when the custom save data is loaded in the same order they where saved, otherwise the ID/index will be wrong :)
    When creating new items, you'll need to add them to the other item data, e.g. using this function:
    int id = ORK.Items.Add();
    It returns the ID of the created item which you can use to access the item like this:
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Uhm, it seems really too complicated for me. I suppose it would require a lot of scripting, and also a good setup for data storage...

    Thanks GiL, i got some nice ideas but i must see if they are applicabile to my prototype. :)

    Have a nice day. ^^
Sign In or Register to comment.