MobileMojo_Games's Forum Posts

  • So, I am using the plugins from Rex for signing into google. It works when I test it on Opera browser trying to log into google and show a play button, but no on the apk, either debug or released.

    Ive tested on different phones and with the emulators. It basically does not open the pop up window for google login for the user.

    Any ideas?

  • Alright, I made two example capx :

    First one is basic, it saves and load the array and update the global variables :

    https://drive.google.com/file/d/1xq6FTed8jhtOrgkKI8yHFUKpXeScQ_u9/view?usp=sharing

    Second is more complex as it also displays the content of each saves on screen :

    https://drive.google.com/file/d/1QbhycuMy43jMu5Pcse-WAi4WaYEzoNsC/view?usp=sharing

    Don't hesitate to ask if you need more help

    I LOVE these! I just need to make an overwrite feature for them just make sure the player is sure they want to do so, and I can implement this idea easily :) Thank you so much, I will actually go ahead and mark this solved because this is EXACTLY like my flow so far, just easier to understand haha! TY and happy coding!

  • WOW, thank you very much I will look into these and learn something from them to fix what I have and mark solved when it works out :) You have been a great help, let me know what I can do to return the favor!

    I want to note for anyone that views this thread, there is something important I learned while working to create this save/load system.

    When you make a game, create global variables to use for updating instance variables because the global variables can be used easily to save to the arrays and should be done in three ways:

    1. Upon change of an instance variable

    2. Upon exiting/saving purposely or if a force close happens

    3. Automatically every X seconds (i.e. like MC does with say 3 minutes etc)

    Saving:

    a. Update all the global variables from the instance variables

    b. save the global variables to the array

    c. save the array to local storage

    Loading:

    a. load from local storage into array(update it from save data)

    b. update global variables from array - this way you can EASILY update instance vars

    c. update instance variables from global variables

    That is a flow of save and load I found EASY for me to follow! Ans when I add stuff, I just set the next array positions of XY to the key and value and save it again!

    Now, I will look into these files you have created and see how I can utilize that flow with them to create a multiple save system and make sure I dont make more arrays than I need :P

    God Bless!

  • Thank you for the help. I could be overthinking something so Ill keep chugging :) You dont have to make one if you dont want to but if you do, thank you for everything!

  • Here is a video of what Im doing. I hope it is helpful. Note: In the video I had changed the global save variable to enable and disable for testing. After the video, I changed it back and it still had the same errors or uneventful actions. :P

    youtu.be/AoZKw2tlUH8

    Subscribe to Construct videos now
  • > I'm not sure of why you want to use multiple arrays, is that to display the datas of each saves on a menu screen? Like health, level, weapons, etc

    Exactly, yeah either display, load, or whatever I need to do with that information. Each slot has an array to save to. :)

    What is even more strange is, I can load it from another layout lol. It works when tested the EXACT same way in code from another part of the game. Do you think clearing the array first has a setback on this? I give it time before I try to load it again so I wouldn't think that would be an issue. I just need to make sure I can load it when I need to. Thank you again for your time, I appreciate it very much

  • I'm not sure of why you want to use multiple arrays, is that to display the datas of each saves on a menu screen? Like health, level, weapons, etc

    Oh, so I have 3 arrays, one called playerGameSave1, and 2 and 3. So, each array is going to be used for each "gameslot", that way I can have different values for the players stats and info for each load. SO, if you wanted to load game 2, then it reads from playerGameSave2.Json, and if it does not exist it creates the array information with default values so it doesn't mess with gameslot 1 or 3.

    Each array will hold ALL of the game variables, global and local. The variables will be updated (global for example) when the array is loaded and overwritten when requested or upon autosave of that slot.

    The current issue with LocalStorage I have at this moment is loading it. I did the proper loading setup, but it does not load into the array I select for it to load into, according to debug. Ill show my code for loading:

    So, when the game starts, it will have a blank array and if not, it creates one. If you have never played the game, it will use that array to update, save, and then eventually load. So, say I changed things that needed saving. I update the values in the global variables, and local variables for gameplay, and then the array is updated and then saved AsJson in Local Storage. All is well so far. So, then the loading part.

    LOADING:

    Let me just simplify it. Say I have a button that when clicked, should load the Json into the proper array. I say when clicked, >LocalStorage > get item "[key used to save array]". In my case, this key is "gameData1". So after get item, I make another event saying: LocalStorage > On item "gameData1" get, action: with the proper array:Load from JSON string> LocalStorage.ItemValue.

    This does not load the array. I do clear the previous array too in testing to see if it loads properly then wait before loading and still nothing loads. Hope that makes sense :) The info IS, in fact, correctly saved and its format is correct. So, the LocalStorage has this information in that specific key that cannot be loaded even with simple actions.

  • When I set array.AsJson I am supposed to put the name of the array in "array" correct? So, if my array is named save1, then it would be save1.Json, correct?

    Also, on item get....do I have to load all the items individually this way or can I load the array fully at once? Thank you again for the help! I will be reading and testing the rest of the night :)

  • Ok, cool so NWjs isnt necessary at all because I dont want any manipulation outside of what the game stores and loads. Thats good to know! TY

    So, I have my array that has variables that include the game slot, player name, and then all of the in game vars so far that I have :) I have an issue loading the JSON to array though at the moment.

    When I go to load the Local Storage information for say, slot 1, I do the proper get then on get flow but it does not load correctly. I was wondering then if this is because I am using "set" in the array instead of "insert" maybe because in the long run, these arrays will be expandable.

    SO, what I am thinking is, based on what Ive read, -Do I have to have the initial array always match the W, H, D of the saved array in Local Storage for it to load properly? If so, and I want to make it dynamic, I dont know how I could impliment a dynamic array into Local Storage if the load has to match the current blank arrays dimensions. I heard something about having to make them all 3 dimensions regardless. But That is as far as I have got on reading so far :P

    Thank you for the help, I will focus on Local Storage ONLY for now and test with that to see if I can get the LS to load back INTO the default array.

  • [SOLVED]

    CURRENT GOAL: To create a save for each game slot to the users pc, using arrays into JSON and NWjs and/or Local Storage.

    CURRENT ISSUES:

    1. I cannot figure out how to save those arrays using NWjs, IF I even need to use NWjs.:::

    The save of anything with SAVESTATEJSON is not saving anything, and in fact the save file has 0kB. Nothing saves.

    2. I cannot figure out how to load Local Storage, as I am wondering if I need NWjs and/or AJAX, etc.:::

    I cannot LOAD Local Storage back into array without knowing where Local Storage saved to.

    What is not working? NWjs saving to local folder. It WILL save the file! BUT...it will not save data to that file.

    Question 1: What is the best (not easiest) way to do this? I.e. Arrays or dictionaries then JSON with NWjs or Local Storage or both, etc?

    Question 2: Am I on the right track? I have it where it saves the arrays. Check. I have the arrays saving to Local Storage. Check.

    NOTE: I am using arrays to make the save sizes smaller and traditionally for large data in the end.

    -If I save the array, it updates Local Storage just fine. Thats about as far as I have got successfully with multiple tests. So, I have my arrays. Good. Now, what way is best to save the way I need and load the way I need? Having all these options confuses me on what works and doesnt and what goes together or not, etc etc.

    photos are included of what Ive done simply with testing.

    P.S.I am a bit slow, so please don't attack my intelligence. I have head injuries. Somehow I have to state that because someone always judges me. Please dont. I just want to see if there is help. Thank you all for helping if you can. I am patient as hell, so Ill communicate until WE can get it to work! Coffee or beer money for whomever gets this resolved with me! LOL

  • Thank you I will check it out. Looks promising

  • I am making a thing where you can create lines on a grid and when the first and last lines are connected, I want to have the inside filled with something graphically to show it as a "shape".

    Is this possible in construct 2, using user-input as the shaping control rather than preset shapes?

    At the moment it is concentrated on merely graphical representations.

    Thank you

  • Ahhh I gotcha. So if I code it with the picking all inside the same condition it works :)

    If I code it where pick all is a sub-event, it doesn't.

    Are we not allowed to have "Else" condition without another condition unless its a Boolean to the first condition then?

    I read that when using "Else" we cant define a different comparable condition, that it has to be the opposite of the first condition (true, false).

    But doing it this way lets us compare more advanced conditions it seems, which I need! hehe

    I get that having to pick all first works before picking frame and then slot :)

    Thank you for the help :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am working on my own inventory system. I have tried different ways to make this work.

    When I use this code:

    What it does is:

    - if inventory is empty, it adds to the first slot just fine.

    - if the same item frame exists in the inventory, it adds the numb fine but ALSO creates a new item in the next slot and adds 1 as if the inv hadnt the item at all.

    So, I believe my "Else" is not correct, as it is supposed to return false for first, or if the first is true, is it not supposed to neglect the second statement?

    Thank you for your help :)

  • thanks