part12studios's Forum Posts

  • ah yes first time running check would be a nice thing to capture with that. good point. thanks, that's super helpful! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interesting. That's definitely where reading about these objects lacks specifics in the documentation for Construct 3.. yes they explain what the fields are but i feel like they don't really explain the inner workings and some simple examples. this documentation would be well served to give some capx examples because reading about something and applying it are not one in the same.

    Sometime its easier to read if things are broken out more for me. i can see how grouping things would be more efficient but when my dictionary keys were not storing my values it proved to just be a layer of abstraction that was more trouble than it was worth to troubleshoot because i couldn't "see" where things were not working.. i would just have to run and test.. and keep getting nowhere. Now that i see this working with just local storage finally (all i really wanted) I may give dictionaries another pass and see.

    The examples in this thread seemed to deal with strings and that raised a question that I need to save values that are numbers, not strings.. maybe the dictionary string / json stuff was not casting the values in a way to be usable by a numbers variable. just lots of little issues like that.. ultimately i couldn't get dictionaries to work in my situation which was unlike the examples given.

    I'm definitely glad to know there are some things i can do without and just removed them.

    It just isn't clear to me in the documentation. we have to check if an item exists. and we have a if it's missing condition.. so does just checking if it exist then "instantiate" the item? or perhaps "set item" is what creates an item if it doesn't exist?

    So really "Is Missing" isn't needed at all for actual storage.

    I did see that video recently and it looks interesting, but for now it's more than i need in my situation.

    I cleaned up my capx and removed the audio stuff i was using for testing (i like to use sounds to identify if the thing "exists" or not when i was testing that.

    Thanks for that input! I just figured that it made sense that if something doesn't exist, i need to do something to make it become real, but i guess just setting a value and giving it a name creates it in that exact moment..

  • Ok so for anyone who comes across this thread, I wanted to give a working example of how you could manage simple on off settings and build up from here.

    I found the examples that were provided in this thread by others as helpful in seeing it working, but i never understood how the dictionary made things easier for my particular situation, so here is an example of two independent values being stored and recalled correctly and I threw a score value in there as well to show them all working together.

    I just like to avoid complicating anything if it doesn't need it and it felt like the dictionary just added more room for mistakes and confusion and for at least this situation it was the case.

    https://www.dropbox.com/s/na3zdgvvvez80wu/Local%20Storage%20Test%20with%203%20Values.c3p?dl=0

    Thanks everyone who made comments and shared their knowledge. It all helped me work through this. I banged my head on this one for awhile now and just haven't been posting questions. Hopefully this example will save others from experiencing similar frustration for something that may seem obvious to those who got it working but for someone new, is not always the case.

  • it seems to have gone away now. i was signed in (i saw my icon in upper right corner).

    I could click "Launch Construct 3" and it would open it up and i could load a cloud project like normal.

    Just weird

  • i see a buy now tab and my account is good till June of 2020..

  • how you explain it makes sense to me mikal, but i'm not seeing how you would create the local storage object. i'm confused because here is an example that doesn't show any "create item". i'm just not seeing it.

    when the "is missing" is used it just gets used to set some text fields and blank.. no call to create anything.. and this example works. this example would be helpful but it doesn't work with a "on start of layout.." it's click driven.. i need a system that's automatic and done without user involvement.

    dropbox.com/s/rok73tjrrtezk8r/local%20storage%20working.JPG

  • ok one specific question that i don't think i saw a direct answer too:

    - when you check if item exists and it doesn't exist, does it at that moment create it?

    I ask because the "on item exists" is a one time trigger event which makes me think it might get missed if the first time you run it and it checks if it exists, what if it's not done creating the new item, just seems sketchy compared to an action that's constantly looking to see if an item exists.

    - you don't ever have to use item missing condition?

    I can see why it would be nice to have as an option but making sure this isn't a required condition. I could see both sides of it. I think it's not from examples I've seen but part of me thinks it would make sense that a "doesn't exist" condition would be needed to identify it doesn't exist so you could then tell it to create the item.

  • i think it's obsolete now? there is a built in tween plugin now with C3 and it appears to do everything the old one did.

  • gotcha, yea that might be worth looking into. maybe i'll make a casual game where saving data isn't that important.. i found this site called whale cash. seems like it might be viable. Still for me I want account / saving data ideally so this isn't great for an RPG but I do see how it could be cool for a casual game.

  • So to Sotano, that makes perfect sense to be locked in with Kongregate and to require them to approve a game to use their system. This is more than fair for developers who do not want to get into engineering their own monetization solution. It's only reasonable to have some trade-off and i would be more than happy to go that route. There are plenty of games on Kong that are doing very well. As I see it, starting out this is great. If a game were to grow bigger and at some point prove to be advantageous to move to a less limited platform (Kong is big, mind you) then enough revenue is at stake to justify the cost / challenge of growing beyond Kong, but until then I would rather be free to make a game that could be monetized on web with minimal development outside of Construct itself.

    to WackyToaster, that does sound interesting, but it would seem like this kind of service would require lots of eyeballs to make it worthwhile.. In addition while that's great, that would only cover the money side. i'm thinking of a service that would allow me to have an account to store game data as well so (example) an RPG could recall what stuff they have / progress / items.. as well as tracking premium currency and a means to award that for money paid. However for a casual game, one that doesn't require saving data, I could see the affiliate approach being possible. Does anyone know of any casual games that might do this well? A game like slither.io or other more casual / non persistent games could be good perhaps?

  • that's great to know! I'm going to see what i can do with this information this afternoon. thank you so much for the added information and insight. i remember using and struggling a little with webstorage back when that was a thing, but i did get through it.. this seemed similar enough, but the weird thing i was experiencing was this, at it's best:

    i would save text on off to on and sound off.. reload the app and both would be 0.. then i could do things like save text to off and sound on.. and reload the app and both would be 1.. however if both were off.. both would be off.. and if both were on it would be both on.. just weird behavior.. even though each had it's own value name.

  • cool yea i see your point about saving certain things like general progress at various times and locations in a game. In games i've done in the past i've never really needed that, but i can see now how that would be helpful.

    Yea i noticed that wait for previous action is new soon after i posted that. definitely a much needed thing. i've always wondered about that because "wait till any action is complete" to fire off another action would be super helpful. like imagine being able to loop any action by name to say when THIS is done.. do that.. this doesn't

    As for the the wait 0.1.. i didn't know things don't always fire off that quick. so yea this is even better waiting until the action is complete. exciting (and great timing) to have this.

    as for the sequential thing I thought I'd heard that it didn't somewhere, but glad it's not. I'm pretty sure it was more of a general statement about javascript itself, not construct specifically so yea a myth i'm glad to learn can be dispelled.

  • and I will say that i've been reluctant to use functions because i never really understood why i need them since it seems like when something happens doesn't everything fire off inside anyway?

    the only reason i could see using a function is if you see a certain group of events firing off the same way in different places but even then that seems like it's rare because most situations are different anyway.

    Is there some other key reason functions are needed?

    Also I saw you use an action I'd never noticed before.. "wait for previous action to complete".. in my case i was using "wait 0.1 sec" to kinda insure that things fire off in order, but this action looks much faster and controlled.

    Also when you list a series of things for example "on start of layout".. is it always sequential? I've heard it's not with JavaScript. Hence why i was using "wait 0.1" to insure things fired off in order.

  • Hey so I've been looking at the example shared which IS really awesome to see as it does show a local storage saving and such but i'm still struggling to get it to work as I need it too which is slightly different. In the example it works for me so i see it working like that, but in my case i'm dealing with settings.. and i'm needing to check when the app opens to automatically look vs hitting a go buttons which would seem easy to transition but my tests are still coming up short.

    I read the documentation for local storage closer and they too suggest the dictionary and that's great, but my situation just doesn't quite behave like the examples and my attempts to simulate them to line up with the examples are leading to unsuccessful attempts.

    The basic thing i need to understand is unlike your event which has a go button.. i'm doing "on start of layout" and it still feels like i'm not getting a clear idea of order of operation..

    1. you check if "mystorage" exists.. in the "mystorage" missing you just have "" for text.. so when a first time condition happens and "mystorage" is missing.. does it automatically create "mystorage" and instantiate it?

    2. when you confirm "mystorage" exists you get "key1" and "key2" but there is no value in them for the very first time. I need to define a value (i think) to make sure that my logic for the options state in the options screen to be correct. trying to figure out an elegant way to set global variables because my logic currently listens to a "texton" var and "audioon" var that is just 0 or 1..

    i'd like to think i can get value from the key instead, but so far that wasn't working.. but it was hard to know if the key was being set correctly in the first place. i'm just not sure if that's that right thing.

  • well since web games would be web that's encouraging. but yea i understand that wouldn't include a way of saving persistent data. I can't help but feel like Kongregate would likely have a solution for all of that.. but not sure. someone is working on a plugin for Kongregate and sounds like he's interested in adding more features in time.