Forum rules - please read before posting.

Inventory change after loading old scene

Hello Chris ! i have an issue with the inventory saving systeme, between different save ( i am on unity 2019.4.13 ):
in my First save, my item is on the scene and visible. ( save number 1 ) https://i.imgur.com/L6ntr0X.png ( sword )
then i take my item, it is in the inventory correctly and i save. ( save number 2 ) > item is removed
if i load my save number 1 without quitting the game, the item is gone ( its not in the inventory ).
if i quit the game and load the save number 2 ( the item should be not here),the item is here again.
and when a load save 1 he is back too.
I have to add some specific action list ? or just check a line in the manager ? i try to look every where ( i surely forgot something. )
here is the action list of my hotspot for taking the item : https://i.imgur.com/q4wqnOH.png

The second thing i have is that i tried to add the item on the "SwordSupport" by dragging it off the inventory in the SwordSupport Hotspot, but nothing happens in the sword support, the item is remove off the inventory well.
https://i.imgur.com/gL6UZ8s.png here is the action list, i see that when click on the item, the "object to instantiate" in the swordsupport action list, is missing, so i try to create another similar item object and add on it, but its not working.

In resume > how can i save the states of my inventory between loading. Old Loading = Old inventory status
and how can i dragg correcly the invetory item into another hotspot.

Thanx a lot Chris.

Cyril.

Comments

  • Please use separate threads for separate issues in future - it helps other users with similar questions.

    Save issue

    When you say the item is here/not here, are you referring to the item in the scene (the Hotspot), or the item in your Inventory (the icon)?

    If the scene, you must be sure to add the correct "Remember" component to any object whose change in state you wish to save. AC's save system works on the basis that it only saves what you tell it to.

    See the Manual's "Saving scene objects" chapter - this details everything you need to know.

    Your ActionList shows that you are removing the "Hotspot: sword" from the scene. This can make things more complex than they should be. Instead, create a Marker that's always hidden (i.e. underneath the floor) and use the Object: Teleport Action to teleport the sword away from view.

    Then, attach the "Remember Transform" component to it, so that it's Transform (i.e. position) is saved.

    Add to SwordSupport

    Check your Hierarchy for "Big Sword 01" - i.e. the prefab you've set in the Object: Add or remove Action. The Action looks OK, so it should be getting added - but you're offsetting its position to be relative to "SwordSupport".

    This adds the position of SwordSupport onto the prefab's original position - so you'll need to make sure the prefab has a position of (0,0,0) for it to appear at the same place.

    Resume

    The state of your inventory should be stored/restored automatically as you save and load save game files. You'll need to share more details and screens (including AC version number) if you're having an issue with this.

  • edited November 2020

    Thanx for your time !
    I fix everything. i add Visibility and remember transform Script for the saving !
    and for the support, i create a marker ( as you say ! ) and its work perfecly, i just modify somes things in the actionList, and remove 3D object from the child !, and its perfect. Have a nice afternoon Chris, you rock !

    Cyril

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.