Could someone help me with this?

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Subscribe to Construct videos now

    My dialogue box won't show up, I've tried everything. I really need help here--

    Project Download:

    (REMOVED FOR PRIVACY)

    (I really can't progress if this isn't fixed, I'll take any help I can get.)

    Tutorial I copied from:

    construct.net/en/tutorials/branching-dialogue-using-json-2395

  • I may not know much about JSON script, but have you traced back to see where the script code was working at in your project or wasn't working at? That could be a good place to start if you know where it was working at.

    Edit: I found this tutorial that might could help you with your chat box.

    construct.net/en/tutorials/talking-npcs-213

  • CloudDealer

    There are multiple problems with your JSON file. Press F12 in preview and you will see an error message saying that JSON data can't be parsed.

    First, you can't use comments "//" in JSON. But there are other issues too - extra commas and closing brackets. Use any online JSON validation tool to check and fix your JSON data.

  • I fixed the json, but-- The text box still wont appear.

  • Here's the file with the fixed JSON.

    (REMOVED FOR PRIVACY)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I may not know much about JSON script, but have you traced back to see where the script code was working at in your project or wasn't working at? That could be a good place to start if you know where it was working at.

    Edit: I found this tutorial that might could help you with your chat box.

    https://www.construct.net/en/tutorials/talking-npcs-213

    I still cant seem to figure it out--

  • What does the JSON script coding from the tutorial look like? Post a screen shot of it and compare how the JSON is scripted in it vs how you have yours scripted. If it is followed as you mentioned from the tutorial you referenced from, then it should be coded the same as so. Again, I don't know much about JSON script, let alone JSON script coding, but tracing back is always good when your not sure of why your coding isn't working.

  • MY CODE

    {
    	"scene": [
    	{
    			"id": 0,
    			"dialogs": [
    			{
    				"type": "end",
    				"nextscene": 1
    			}
    		]
    		},
    
    		{
    			"id": 1,
    			"dialogs": [{
    					"char": "Maura",
    					"type": "line",
    					"line": "Well.. Looky here--"
    				},
    				{
    					"char": "Maura",
    					"type": "line",
    					"line": "You got the text box working!"
    				},
    				{
    					"char": "Maura",
    					"type": "line",
    					"line": "Hard work pays off.. Huh?"
    				}
    
    			]
    		},
    
    		{
    			"type": "end"
    		}
    	]
    
    
    }

    THEIR CODE

    {
    	"scene": [
    		{
    			"id": 0,
    			"dialogs": [
    				{
    					"type": "end",
    					"nextscene": 3
    				}
    			]
    		},
    {
    			"id": 3,
    			"dialogs": [
    				{
    					"char": "Jessie",
    					"type": "line",
    					"line": "Hi there, looks like you're in another one of these dialogue system tests."
    				},
    				{
    					"char": "Jessie",
    					"type": "line",
    					"line": "There have been so many of these test projects now."
    				},
    				{
    					"char": "Jessie",
    					"type": "question",
    					"question": "Are you bored of these projects yet? I sure am.",
    					"nbanswers": 3,
    					"answer0": "Of course not!",
    					"nextscene0": 7,
    					"answer1": "Maybe a little.",
    					"nextscene1": 8,
    					"answer2": "I am so done with this.",
    					"nextscene2": 9
    				}
    			]
    		},
    
  • Oh my gosh...this way too big to try to compare the two. Can you post them side by side so we can see exactly whats going on with the two?

  • like this?

  • Okay....so I took a look at it and compared how it was coded vs how your JSON script was coded. Since the two was kinda unclear to tell exactly what the brackets were. I think I saw some red flags of yours that I notice looking at the tutorial scrpt...

    I put the number so you can tell where I think your mistakes were at. At the beginning of 1. is the bracket green like in the tutorial JSON you copied from?

    On 2, I not sure if it makes a difference but the brackets seem a little too spaced apart and the "]" above the circle of 2 of you Coding, should be over a bit like it is in the original JSON script.

    and for 3, I notice after it says "Dialogs": { in the orginal JSON script, your is scripted like this "Dialogs:{[ ......should this "[" be below that, like it is in the Original JSON script?

  • I ran a JSON validator, and it said that it should work. So, there's a good chance it isn't the JSON, and there's a problem within the visual code. I've looked through my visual code, and can't seem to find the problem.

  • hmmm, im not sure. I wish I could help you on this, but I don't know enough on how JSON script coding works or whats really going on behind it :(

  • You dialogue system actually works. You can't see the text because it's on Dialogue layer with 100% parallax, so it's somewhere off-screen. Change parallax to 0%

    I highly recommend using Debug View to troubleshoot issues like this. You would be able to see that the Text_NPCDialogue object contains the correct line from the dialogue, so the problem is just with its visibility.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)