Trying to create dialogue (error)[solved]

shakey2
26 Jan 2019, 22:41

Ok so I wanted to play around with making a simple dialogue tree, get a list of responses and print a message depending on the response. I got a script set up and it does what it's supposed to. Except at the end of the script this pesky little error message keeps showing up: "Error running script: Object reference not set to an instance of an object." Now I don't know anything about how quest script actually operates as I'm exclusively using the quest visual editing kit, and I have not seen anything here that seems to indicate the need for setting an Object reference. So if anyone could point out what I'm missing here it'd be much appreciated.

The error:
image
Visual editor:
image
Game code:
pastebin


Io
26 Jan 2019, 23:12

Hmm. I tried running your code in a test game and I'm not actually getting any error. It all worked fine.

If I recall "Object reference not set to an instance of an object" basically means you've told Quest to access an object that does not exist. It usually happens with typos: Talk to BobObject as opposed to BboObject. It can even happen if you mispell an attribute: If you have Bob.Anger, but instead call Bob.Angry, the game will look for attribute Bob.Angry, not find it, then look for object Bob.Angry, not find that either, and throw the error.

But I can't actually see what's wrong with it. Is this your entire code, or is there something else that might be screwing with Bob's part?


shakey2
26 Jan 2019, 23:46

That is literally the entire code. All I did was open a new project, make an object called Bob, then add the verb "Speak" to bob with the script you see here. As for typos, I'm looking over everything and I don't see any.


mrangel
27 Jan 2019, 00:19

Does it do the same if you try to do something other than speaking to bob? Foir example "look at bob" or "inventory"?

My first thought is that you somehow have a turnscript without a script attribute or a name. So at the end of every turn, the Quest runtime is attempting to do do (null, "script") which I think would yield the error message you showed.


shakey2
27 Jan 2019, 00:25

That was exactly what it was. I don't even remember adding that. Thanks!
So at the end of every action counts as a turn, good to know.


hegemonkhan
27 Jan 2019, 07:22

the 'internal turns' (handled by the 'Turnscript' Elements) are any typed-in command in the text box command-bar at the bottom or a mouse click on a hyperlink in the big text box on the left or a verb button in the panels on the right