Spawning USurvival Items

Announcements, support questions, and discussion for Quest Machine.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Spawning USurvival Items

Post 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
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post 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.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

Great!

Thanks Tony!

Also, thanks for 1.15!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post 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.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post 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
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

It will affect any characters that were saved in uSurvival's database. They'll lose their quest progress.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

Ok, thanks fof the heads up luckily it won’t effect us!
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post 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
Last edited by nathanj on Wed Mar 20, 2019 2:23 am, edited 2 times in total.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

Hi Nathan,

Try the quest giver ID:

Code: Select all

GiveQuest(Variable["QUESTGIVERID"], Variable["QUESTID"])
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post 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
Post Reply