Setup a 7-Dimensional Array

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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

    Add value 3 at key "myNumber"

    you can retrieve it by doing

    Dictionnary.Get("myNumber")

    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:

    Add value "My awesome dialog here!" at key "arc_day_timeOfDay_place_theInteractive_characters_Objects_Items_Default_AutoDialog"

    if you do

    dictionnary.Get("arc_day_timeOfDay_place_theInteractive_characters_Objects_Items_Default_AutoDialog")

    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)

  • 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.

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