Page 1 of 1

Invecvtor Inventory Question

Posted: Sun Oct 13, 2019 8:43 am
by nitrox32
I've looked at the manual on how the to use DS to add items to Invector's inventory. I've also added the Use_Invector_Inventory to the Scripting Define Symbols. I can't figure out where to use these Lua in conversations. I thought they would be used under Conditions and Scripts in a Dialogue Entry but they are not showing up.

Re: Invecvtor Inventory Question

Posted: Sun Oct 13, 2019 8:59 am
by Tony Li
Enter them manually. In the example below, the dialogue entry's Conditions check if the player has a sword (item ID 3). If so, it uses this entry, displaying the Dialogue Text and running the Script, which gives the player a sword:

invectorLua.png
invectorLua.png (5.26 KiB) Viewed 1416 times

BTW, for debugging, you can also add a Lua Console component to your scene. Press ~+L to open it, then enter Lua commands. For example, to give yourself a sword, enter "vAddItemByID(3, 1, true)​" in the Lua Console.

Re: Invecvtor Inventory Question

Posted: Sun Oct 13, 2019 11:54 am
by nitrox32
Perfect! Thanks!

Re: Invecvtor Inventory Question

Posted: Sun Oct 13, 2019 12:27 pm
by nitrox32
One other thing, I would like to have a message display that a sword has been added to my inventory. I've added ShowAlert("Sword added!") but nothing happens.

Re: Invecvtor Inventory Question

Posted: Sun Oct 13, 2019 1:00 pm
by Tony Li
Hi,

In the Dialogue Manager's Alert Settings, make sure alerts are allowed during conversations.

Alternatively, you can set the Variable["Alert"] to the string you want to show. When the conversation ends, the Dialogue System will check this variable and show its content if you've set it.

Re: Invecvtor Inventory Question

Posted: Wed Oct 16, 2019 7:38 pm
by nitrox32
I have two situations. First, I have a key and door lock system set up in Invector. Is there a way to have DS save the state of the lock? In other words once the lock has been opened, can DS save the state so that it doesn't have to be unlocked later when the scene is loaded? Also, DS seems to be saving the inventory but when I load a saved scene the items that have been picked up reappear in the scene. Any way to fix this?

Re: Invecvtor Inventory Question

Posted: Wed Oct 16, 2019 7:51 pm
by Tony Li
Hi,

Add Destructible Saver components to pickups. Assign a unique key to each one, or use menu item Tools > Pixel Crushers > Common > Save System > Assign Unique Keys to do it automatically.

For the lock, it depends on how it's set up. For example:
  • If it's an animator state, add an Animator Saver.
  • If it activates a GameObject representing the unlocked lock and deactivates the locked version, then use Active Saver components. You'll need to put these on a different GameObject such as the parent, since one of the GameObjects won't be active when the scene starts, so its Active Saver won't take effect.
  • Or you can write your own Saver component. The Common / Templates folder has a starter script.

Re: Invecvtor Inventory Question

Posted: Wed Oct 16, 2019 8:11 pm
by nitrox32
Thanks for the quick reply. I was just about to edit my post. I found the destructible component. I forgot a read about that in the manual. I'll try the animator saver and see if it works.

Re: Invecvtor Inventory Question

Posted: Sat Oct 19, 2019 11:21 am
by nitrox32
Actually the solution was quite simple for my design choices. I did end up using the DS position saver component. It should of been placed on the door model itself instead of the parent object that contained the vSimpleDoor and UseItemEventTrigger compnonets. I also had to untick Auto Close in the vSimpleDoor component.