drunkenoodle's Forum Posts

  • Hello everyone,

    I was searching for a solution to create a dialogue system that will be included in various adventure games / rpg's. And decided to purchase the C2 data editor to do the leg work, and it's awesome!

    But, I'm having a complete blank moment, and have gotten a bit stuck with how to deal with accessing the nested data within the structure (in this instance, an array of strings that sit inside a conversation object).

    Now some of the helper functions are useful in that they return certain row numbers based on your query, so that's great. But the main problem is what to do after that really.

    For example (apologies if it looks a bit messy):

    {
    	"c2array": true,
    	"size": [2, 2, 1],
    	"data": [
    		[
    			[1],
    			["{\"c2array\":true,\"firstRowIsColumnNames\":true,\"size\":[4,2,1],\"data\":[[[\"belongsTo\"],[\"str\"]],[[\"player\"],[\"Hi, I don't suppose you have any materia?\"]],[[\"npc\"],[\"Er, we're fresh out actually. But feel free to take a look anyway.\"]],[[\"player\"],[\"Oh, ok. Let's see what you have.\"]]]}"]
    		],
    		[
    			[2],
    			["{\"c2array\":true,\"firstRowIsColumnNames\":true,\"size\":[1,2,1],\"data\":[[[\"belongsTo\"],[\"str\"]]]}"]
    		]
    	]
    }
    [/code:3334wj70]
    
    Here I'd like to access the first set of data in the c2array, and, from within that, access each individual string. You might notice the 'belongsTo' property, that's basically where I want to end up.
    
    So my conclusion was to store that nested data within a different array, then I can cycle through it and show it on the page using the array.at() expression.
    
    But, my struggle comes when making the link between the JSON string, and then getting that sub data in to an array to access...
    
    Hope this all makes sense, thanks for your time!
  • Ah I see what you mean. Thanks very much for clarifying!

  • Ah that's a good idea actually. Thank you! I take it construct has its own special format due to the fact it needs to work on many different devices? Or is it just simply the way it's written?

  • Hello everyone,

    it's been a long time since I've been back here but glad to be back at the same time. I've recently been playing around with Construct 2 in the hope of creating a very simple RPG mechanic. But, I hit a roadblock when I found that I couldn't seem to get C2 to respond to the JSON format that I was passing .

    For example the following just wasn't getting me anywhere (as an array of objects):

    [{
    	"id": "1",
    	"string": "This is a string that belongs to the id of 1."
    }, {
    	"id": "2",
    	"string": "This is another string that belongs to the id of 2."
    }][/code:1ixvpplt]After some searching I found a couple of examples, so I could probably work with those. But I have a couple of questions, one being, why does Construct require a special format when it comes to JSON exactly? Or, is it the simple case that I'm just not doing it right by loading as Ajax and parsing it in to an array or dictionary?
    
    And secondly, is there some form of reference in the manual that I've overlooked that goes in to detail about it?
    
    My apologies if I've overlooked the obvious, but I'm not having too much luck and wondered if anyone else had a similar issue.
    
    Thanks!
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Evening!

    Great plugin, just got it hooked up like a charm. Just wondering one thing though and this may be me being totally stupid, but I take it that we can't run this using preview mode?

    I mean, the project has to be exported every time we update anything such as event sheets on the capx?

    It got me wondering as I've been trying to get it working from the preview side, but wasn't sure if Construct has things in place that prevented one from doing so.

    (hopefully it's not too late to post on this thread!) :P

    Cheers!

  • Ah that's actually a really good idea, much better than getting all tied up with crazy matrix equations and things, I shall give that a try! Thank you very much for your reply! :]

  • Hello everyone,

    I'm wondering if it's at all possible to change the scale of a 2D sprite, dependent on where the horizon line of a background image is.

    For example, some games such as the first Resident Evil, Final Fantasy 7 seemed to be able to simulate a different scaling value as the player approached the back of the screen in some scenes (running down a corridor, etc).

    So far I've been able to create this effect but only on a singular vanishing point basis (looking straight in to the distance), but since the observer would potentially be looking down upon the player, this would require a 3 point perspective approach.

    I've read a few articles about it and am still a bit unsure about where to begin properly (after getting up to scratch with trigonometry of course) ;) Including the article on here about pseudo 3D games, which worked a treat, only, I wasn't really sure how to apply that to if you were looking down (again from a 3 point perspective idea).

    But I felt it a good idea to ask on here in case anyone else had either encountered the same problem, or, had wondered the same. If you have any ideas or could help in any way, it would be massively welcome.

    Thanks for reading and all the best!