part12studios's Forum Posts

  • ah yes i was going to say, the demo that was provided for me was a file.. but watch out to not click always allow.. it freakin' goes on a save frenzy.. had i think bout 80 files generated on my computer before i could end task!

    Caleb

  • sure thing.. here it is https://www.dropbox.com/s/dvfxbtsi4rk7d1j/PunTest.capx

    yea i just want the simplest way to call on text information and put that information where it needs to go. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Thanks!

    Caleb

  • lol i had the same thing happen.. i was going to share what i was experiencing with my setup.. which i'll post now.. just so you know.. but i'll read and respond to your deeper response once i read through it.

    -----

    yea i pretty much follow you but when i do Array,At(1) i get an error..

    here is what i have so far https://www.dropbox.com/s/tp0x6fgkskac5 ... 0setup.PNG

    this current setup results in this:

    click the button.. the text field shows "Joke1"

    if i make (0) a (1) i get this error https://www.dropbox.com/s/aiui94i2cu58297/error.PNG

  • a small update.. i tried to use Array.At(1) and got an error.. thinking i could access "Joke2" by calling on (1).

  • ok so i have some of this understood, but i'm confused by the example because it just seems like it has a lot going on that i don't need and i'm not clear where what i want ends and what i don't want begins.. because its kinda all woven in together.

    I have a json file that is imported in my test project.. i was able to display the the first value by using

    Array.CurValue and that's way cool.. it displayed in a Text object (standard text, not sprite font) "Joke1"

    but what i don't know how to do next is how to call on any of the values below.. this is what i have setup now:

    {

    "c2array":true,

    "size":[4,1,1],

    "data":[[ ["Joke1"],

    ["Joke2"],

    ["Joke3"],

    ["Joke4"]

    ]]

    }

    it seems like if i could just figure out how to access joke 2 3 and 4.. that would be all i need to know to be able to then use what i do know to call on random text from the list above..

    Sorry to be so dense lol, this is just very new to me and having never used sprite fonts before or arrays it's just made the sample project tougher to discern.

    Thanks!

    Caleb

  • awesome thanks! i'll keep at it with this new info! Thanks to you both for your help with new (and kinda confusing to me) subject

    Thanks!

    Caleb

  • ok i'm trying to break this down to better understand the syntax.. i need a joke and punchline that would go in different text objects.. so i imagine i'll need to make two json files.. is this the right syntax below?

    {

    "c2array":true,

    "size":[3,1,1],

    "data":[[ ["Joke1"],

    ["Joke2"],

    ["Joke3"]

    ]]

    }

    what is the purpose of "c2array"? is it a unique name? I don't cee "c2array" anywhere in the event sheets. If I import two json files i just want to be sure that c2array name is something that either needs to be unique or in common.

    also you mention X, Y, Z? i'm only used to that being used in terms of 3d coordinates. what would the x y and z represent in this case with c2?

    Thanks!

    Caleb

  • ok thanks! Yea otherwise my txt files would be default to ANSI.

    can anyone explain some of the values found in this json file? specificially the header stuff. c2array is fine i guess, but what does "size" mean? 13,6,1?

    {

    "c2array":true,

    "size":[13,6,1],

    "data":[[ I do see he has 13 cards (Card00 through Card12) but i don't understand what the 6 and 1 represent. below the data line you see this ["Card 00"],

    ["Content 01 - Card 00"],

    ["Content 02 - Card 00"],

    ["Content 03 - Card 00"],

    ["Content 04 - Card 00"],

    ["Content 05 - Card 00"]

    ]

    I do see 6 rows although one of them is he header.. not sure if that matters.. but if that is the case then what does the 1 represent in the three numbers "13,6,1"?

    Then i follow the idea that DeckCards1 gets completed.. move on.. I see load Json strong "AJAX.LastData" is this a commonly used command to simply put all of the data that was loaded from the CData2.json into an array?

    I've never used sprite fonts before. I was just looking to use plain text fields for displaying data, but I think I can see what's going on. trying to rebuild something using this as a guide.

  • ok i'm digging in it now. I saw you have a "json" file in there. is this simply making a text file and changing the extension? I was able to open it with wordpad and it looks good so i imagine this is true and will move forward on that assumption but i at least wanted to mention it.

  • sweet thank you so much for this sample! I'll be tackling this head on tomorrow (monday) and report back how it turns out!

    Sincerely,

    Caleb

  • I will definitely look into this and let you know if I get hung up! Thanks for the added explanation! you've been a great help!

    Sincerely,

    Caleb

  • ok so i have the cvs plugin and i see i can load a "cvs string". I have a test.cvs file I exported from Excel.

    I'm just not clear how i "read" the data in a given text file from json. Where would the file reside so that when the app launches it grabs the data? would it go in the generic "file" folder?

    for example.. i found this cool site thanks to a coder buddy of mine.. http://www.convertcsv.com/csv-to-json.htm

    and it gives me this json data:

    [ { "Joke 1":"Joke 2", "Punchline 1":"Punchline 2" }, { "Joke 1":"Joke 3", "Punchline 1":"Punchline 3" } ]

    but then it's like.. where do i stick THIS? and how would I access it still.

    I didn't see any tutorials that talk about "import data ajax"

    Maybe XML would be possible? the code above reminds me of it a little.

    you mentioned "I found putting data in json and loading it into dictionary worked well." how do you actually do that?

    Thanks!

    Caleb

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yea that sounds good. and i think if you look at the play options there is something in there that lets you know the sound is done playing..

    yea if you go and add an event you'll see audio has an "On Ended" which could allow you to string sounds together based on sample length rather than time.. just an option to check into

  • my first thought on this would be to associate each sound to be played with a series of numbers.. and making a variable for that.. so imagine

    PlayNote = 0 (this is your global variable)

    every 1.0 seconds

    set value - Play note - Random (1,12)

    then you'd have

    system - Play Note = 1 Play Note 1 sound

    once while true

    system - Play Note = 2 Play Note 2 sound

    once while true

    etc..

    This would of course just create a bunch of random sounds.. but you may get the idea.. you could manually set the order of what notes you want..

    On start of layout

    Play note 1 sound

    Wait 1.0 second

    Play note 5 sound

    Wait 0.5 second

    Play note 3 sound..

    etc..

    Also you might want to check out the midi plugin someone made (you'll find it under tutorials, just look up "midi"), but bear in mind its only known to work on web. I was unsuccessful getting it to work on iOS, but i'm not too savvy with it and didn't write the plugin.

  • you might be able to achieve that with webstorage? you might not need something that fancy to achieve that specific goal.

    I'm looking to better understand how to store data in the app like extensive text and such without using webstorage.

    Also I know that in some past testing with my coworker, we were able to get C2 to talk to the Google App Engine to pass text data using the AJAX object.. so that might be what you would use to pass json data back and forth.