Hi :-)
So I finally got my Inventory System to work. After clicking on an object, the item goes straight in the inventory. I also figured out how to use an Inventory object on an In-Game object, and for it to change Scene afterwards (in 'ActionList Editor', 'Switch Scenes')
I assume it's easiest to make a new Scene for each Room View and after unlocking doors? I tried to test if the inventory would work throughout several scenes, and I think it works, with keeping all objects that are already in the inventory. Can somebody confirm this?
But unfortunately, the inventory system stops working, after I restart Unity. Do you have any idea why that could be ?
There's like a bug or something (although I followed the Inventory instructions of the Tutorials step by step).
However, I do get Warning messages in the Unity Console while the game is running:
-'Note: The MainCamera is parented to an unkown object'
- 'No player found - please set one using the Settings Manager, tagging it as a player'
- 'Main cursor has no texture- please assign one in the Cursor Manager'
- 'There are 2 audio listeners in the scene. Please ensure that there is exactly one'
Could these have anything to do with my Inventory System breaking upon restart?
Please note that my point & click game is in 1st person (2D). That's why I did not assign a player. As for the main cursor having no texture, I removed it because I don't want a texture on my cursor either.
I would be very grateful if somebody could help me with those issues. I'm kinda stuck :-(
Comments
You haven't described in what way the inventory stops working. Does it fail to show? Does the game crash? Please illustrate with screenshots if appropriate, as without knowing more it's difficult to suggest a solution.
However, check that your game's Managers are still properly assigned in the main Game Editor window. If you didn't save the project before editing, it may be that they weren't properly loaded into the editor - see Section 1.3 of the Manual.
The MainCamera error will show if you've parented it to something, which shouldn't be necessary. Where is it placed in your Hierarchy, and what is the other object that has an Audio Listener component?
If you have no Player, set the Movement method to None in your Settings Manager - that will stop that message.
If you don't need a cursor, you can set the Display cursor setting to Never rather than not giving it a texture.
Try disabling various cameras in the Hierarchy while the game is actually running. The AudioListener message will stop printing when you disable the offending object, which you can use to work out which one has the second component.
The PlayerPrefs message is not an error, but just AC informing you about the save game data its storing and retrieving automatically. It can be safely ignored. The Metal message is Unity related, and you'll have to search Unity's documentation / forums for info on that. Clicking any message in the Console window will reveal if it's an AC message or not.
That just saves the scene. Managers and ActionLists are stored as asset files, which live outside the scene. To save those, go to File -> Save Project from the top toolbar.
Those are the correct Actions, but the screenshot doesn't show in which ActionList they're running. Is that in the Hotspot's "Inventory" Interaction, or the "Use" Interaction?
Bear in mind that you will need to have a way of recording the fact that the door has been unlocked, if you want the player to be able to return to this door later. You can do this by creating a local boolean Variable named e.g. "Door is locked". Set this to True by default, and then use the Variable: Set Action to change it to False when the key is used on it. The door's "Use" Interaction can then contain a Variable: Check Action to check that variable's value and either let the player go through it, or return an "It's locked" response from the player. Concepts like this are covered in the video tutorials.
Core operations such as inventory combining are all covered by the Manual - see Section 6.2. Combine Interactions are listed at the bottom of an items' properties in the Inventory Manager.
You can do this by running the following line of code:
AC.KickStarter.sceneChanger.LoadPreviousScene ();
(For more about calling AC functions through script, see Section 12.2.)
However, I'll be adding a new Scene: Switch previous Action in the next update, which will run this for you.
If the zoomed-in item is just a sprite/texture, though, you may not necessarily need a separate scene. A full-screen Menu could also serve the same function.
No. There's a two-line break after the section on "Multiple" mode where the words apply to all modes. I'll see about making that more clear.
The ability to define Combine interactions is already displayed at the bottom of your Inventory Manager for each item.
I don't see where to set it to multiple.
It is unavailable if your Interaction method is set to Context Sensitive - see the note at the start of the section. You don't need to change it, however, to make use of inventory combinations.
Yes, but that's down to the Actions you run within the interaction itself. Three Inventory: Add or remove Actions would do it - two to remove item A and B, and another to add item C.
I'm planning on this week, unless a showstopper bug delays it.
"Use" interactions are left-click, so you can just map the ActionList that creates the zoom to the Use interaction instead of Examine.
When creating a new Combine interaction, you select an item that it is intended for. You currently have two such interactions for each item. The "shoes" item, for example, does not need a "shoes" interaction because that will run when combined with itself. To combine it with the Screwdriver, you need only the first one defined.
As you have also checked Combine interactions work in reverse?, you do not need to create a "screw" interaction in the screwdriver's own list of combines. So of the four interaction's you've defined, only the first one on the Screw's page, which has Screwdriver beside it, is necessary.
To have that interaction remove both the screw and the shoes, and create a new item, you just need the following Actions I described earlier: