Page 1 of 2

Spawning USurvival Items

Posted: Mon Mar 18, 2019 9:04 pm
by nathanj
Hi Tony,

Hope this isn't too far from Quest Machine support but I was wondering if you had any insight about using Quest Machines Spawner for USurvival items?

I just loaded up the demo scene for Quest Machine's USurvival package and added a QM Spawner that creates Drink objects from the USurvival Prefabs folder.

When I start the scene, the items are placed in the world but are not collectable. I get two error messages:

Code: Select all

KeyNotFoundException: There is no ScriptableItem with hash=0. Make sure that all ScriptableItems are in the Resources folder so they are loaded properly.
Item.get_data () (at <eaac12703186412e8425eee47339ef6f>:0)
Item.get_name () (at <eaac12703186412e8425eee47339ef6f>:0)
ItemDrop.GetInteractionText () (at <eaac12703186412e8425eee47339ef6f>:0)
UIInteraction.Update () (at <eaac12703186412e8425eee47339ef6f>:0)
and

Code: Select all

KeyNotFoundException: There is no ScriptableItem with hash=0. Make sure that all ScriptableItems are in the Resources folder so they are loaded properly.
Item.get_data () (at <eaac12703186412e8425eee47339ef6f>:0)
Item.get_maxStack () (at <eaac12703186412e8425eee47339ef6f>:0)
Inventory.CanAdd (Item item, System.Int32 amount) (at <eaac12703186412e8425eee47339ef6f>:0)
Inventory.Add (Item item, System.Int32 amount) (at <eaac12703186412e8425eee47339ef6f>:0)
ItemDrop.OnInteractServer (UnityEngine.GameObject player) (at <eaac12703186412e8425eee47339ef6f>:0)
Interaction.CmdInteract (UnityEngine.Vector3 lookAt) (at <eaac12703186412e8425eee47339ef6f>:0)
Interaction.CallCmdInteract (UnityEngine.Vector3 lookAt) (at <eaac12703186412e8425eee47339ef6f>:0)
Interaction.Update () (at <eaac12703186412e8425eee47339ef6f>:0)
However, if I click on the "Spawn" button that was added to the Network Identity component

Image

the item becomes intractable.

I know that this is more about USurvival but can you think of anything off your head that would solve this issue?

Thanks again,
Nathan

Re: Spawning USurvival Items

Posted: Mon Mar 18, 2019 11:16 pm
by Tony Li
Hi Nathan,

I think I can make a uSurvival-compatible spawner this week.

I just released Quest Machine version 1.1.5. As luck would have it, version 1.1.5 has some Spawner improvements that will make the code for a uSurvival-compatible spawner really short and easy.

Re: Spawning USurvival Items

Posted: Mon Mar 18, 2019 11:44 pm
by nathanj
Great!

Thanks Tony!

Also, thanks for 1.15!

Re: Spawning USurvival Items

Posted: Tue Mar 19, 2019 8:32 am
by Tony Li
BTW, version 1.1.5 has an updated Dialogue System integration package. When starting a conversation, Lua variables QUESTGIVER/ID, QUESTER/ID, QUESTID are now set. So you can put things like this in your dialogue text: "I'm [var=QUESTGIVER]." and this in your Script fields: SetQuestState(Variable["QUESTID"], "success")

Also, BarkQuestAction > String can now play a sequence.

But unfortunately there is a breaking change in save data format. Prior to 1.1.5, quests didn't save the state of their HUD track on/off checkbox. Version 1.1.5 adds this one extra byte to save data, but that means it's not compatible with older save data.

Re: Spawning USurvival Items

Posted: Tue Mar 19, 2019 3:34 pm
by nathanj
Thanks for adding all this, Tony - the new variable functionality is a huge addition for us.

We’re still in development so the save data change shouldn’t effect anything, correct?

Thanks again
Nathan

Re: Spawning USurvival Items

Posted: Tue Mar 19, 2019 3:49 pm
by Tony Li
It will affect any characters that were saved in uSurvival's database. They'll lose their quest progress.

Re: Spawning USurvival Items

Posted: Tue Mar 19, 2019 4:05 pm
by nathanj
Ok, thanks fof the heads up luckily it won’t effect us!

Re: Spawning USurvival Items

Posted: Tue Mar 19, 2019 9:40 pm
by nathanj
Hi Tony

.
Just trying the new variables commands but for some reason I can't get the quest to assign to the player.

The last node of my conversation runs this

Code: Select all

GiveQuest(Variable["QUESTGIVER"], Variable["QUESTID"])
but nothing happens. Other sequencer commands are working and triggering properly

I can get the [var=QUESTGIVER] to display correctly in the dialogue UI but the LUA commands are not working in my scenes or the Dialogue System integration demo scene. I tried replacing Johans GiveQuest command with the line above but it did not work.

Am I missing anything?

PS. I posted a bunch in this thread (which I have deleted) while I was trouble shooting a bunch of weird stuff that just seems to have sorted itself out so apologies to anyone who was confused by it.

Thank you,
Nathan

Re: Spawning USurvival Items

Posted: Wed Mar 20, 2019 8:27 am
by Tony Li
Hi Nathan,

Try the quest giver ID:

Code: Select all

GiveQuest(Variable["QUESTGIVERID"], Variable["QUESTID"])

Re: Spawning USurvival Items

Posted: Wed Mar 20, 2019 3:38 pm
by nathanj
Hi Tony

I won’t be at my computer for a few hours but I was able to replicate this in a new project with only Quest Machine, Dialogue System and USurvival - but I didn’t end up testing it in any of the USurvival integration demos since the error occurred in the first integration test. Also, I have Unity 2018.3.7 installed.

In the test project, when I open the demo scene for the Dialogue System integration (for Quest Machine)and try the above codes I have the same issue as in my main build. The name is displayed in dialogue text but the sequencer LUA commands don’t run. They don’t throw an error either.

Was there anything I am supposed to enable to allow this to work?

I can test the QUESTGIVERID when I get in to work but I feel like the is replicable. But I’ve been wrong lots before...

Thanks again,
Nathan