Setup a 7-Dimensional Array

Get help using Construct 2

Post » Wed Dec 19, 2012 11:16 pm

Hello, I'm trying to figure out how to make a 7-Dimensional array in construct 2. My plan is to use the array to provide a game with a complicated/flexible dialog structure for a visual novel type game, however trying to set the size of the array only provides up to a 3-dimensional array.

The conditions for which set of dialog the game plays is determined/w the executed dialog for the array is [arc, day, timeOfDay, place, theInteractive_characters&Objects&Items&DefaultAutoDialog, theInteractingCharactersMood/theSitituation/currentRelationship, theDialogToDisplay] with the corresponding sizes being around [3,5,4,4,5,10,100] (with the last 3 sizes being a guess of mine as the story isn't completed as of yet).

Undoutedly the array isn't going to be completely filled but it would provide an organized and easily implemented dialog for my level/knowledge of construct 2.

If somebody, anybody, could please help I would be very very thankful.
B
13
S
4
G
2
Posts: 26
Reputation: 2,429

Post » Thu Dec 20, 2012 3:02 am

One way would be to use the Dictionary object and use keys like "3,5,4,4,5,10,100".

Another idea would be to use a xml file to store all the dialog and access it with the XML object.
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Thu Dec 20, 2012 4:02 am

I'm not familiar with the Dictionary object (no idea how it works), it their a tutorial for it that would apply here?

I've tried using the xml object before but I never could get it to work right dispite looking at a few .capx tutorial files and reading the manual. Atm I'm hoping for a full video tutorial on it.
B
13
S
4
G
2
Posts: 26
Reputation: 2,429

Post » Thu Dec 20, 2012 8:17 am

The dictionnary object is quite simple, I even think it's simpler than the array object.
It just associate a key and a value.
if you do [code]Add value 3 at key "myNumber"[/code] you can retrieve it by doing[code]Dictionnary.Get("myNumber")[/code]The same way you do Array.At(anyNumber)

But since the key is a string, you can do all kind of tricks by formating the key to fit your needs.
Like:[code]Add value "My awesome dialog here!" at key "arc_day_timeOfDay_place_theInteractive_characters_Objects_Items_Default_AutoDialog"[/code]if you do[code]dictionnary.Get("arc_day_timeOfDay_place_theInteractive_characters_Objects_Items_Default_AutoDialog")[/code]it will return "My awesome dialog here!"

So in a way you'll emulate a multi-dimensionnal structure.
The only downside is that you don't know the size of each of the dimensions... (unless you keep track of them yourself (:... in an array for instance)Yann2012-12-20 08:20:26
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Dec 20, 2012 4:06 pm

Well Dictionary, Webstorage are internal data storage. They are very similar except WS can save long term where as Dictionary is only session data. However both would be terrible for as long term data sources.

What you could do is use WebStorage and download your conversation trees by way of ajax on the first time the game is run. This is a good way to reduce the initial download size. However WS isn't really good for multi dimensional arrays. They are Key:Content only only 1 level.

Your best bet for creating a Dialog Conversation Tree would be to either
A. Stick to XML structure which XML is built for such things.
B. Right a plugin that takes advantage of a locally stored file to use your own structure or XML.
C. Built the conversation tree's internally :|

I have difficulties with XML myself, but it really is the best route to go for working with the system to it's best. If your trying to avoid manual coding. You could try looking for a plugin though. I think I have heard one mentioned around here and there.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests