larrynachos's Forum Posts

  • Now my save/load system isn't working at all. Even when the file downloads in preview, the array has an equal number of cells to the "bullet" count, but each cell is blank, instead of being filled with the json data. My code is the same is before, I don't know why this isn't working anymore ;-;

  • Now my save/load system isn't working at all. Even when the file downloads in preview, the array has an equal number of cells to the "bullet" count, but each cell is blank, instead of being filled with the json data. My code is the same is before, I don't know why this isn't working anymore ;-;

  • Hello! I am having a strange problem. I have a save system where an array with tile states, and when the save is complete the array downloads as a .json file. It functions perfectly when I'm testing it, but once the build is uploaded on NG, instead of opening the save window to choose where it's saved, a new untitled chrome window opens with url about:blank, and nothing happens. I have no idea what's causing this, pls help.

    Code:

    Tagged:

  • Hello again! I have a feature in my app that lets users download their custom made levels in .json format, as well as record and download .webms of gameplay. It functions on PC and in android browsers, but when I run the apk, I'm unable to use the filesystem.

    I'm assuming this is because the app hasn't requested access to media and files, but I don't know how to do that. Any ideas? Thanks!

  • Don't forget to included the admob.rewarded.js file on your index.html and you no need to call function load ads in Construct 2 because inside admob.rewarded.js already preload ads automatically.

    So close now, thank you for the help so far! I've got it working so that the ad only plays once and then gives the reward. However, I've built and signed the apk (turned istesting false), pushed the update to google play, but the only ad that displays is the test ad. I'm assuming I've skipped a step somewhere, but I can't figure out what.

  • You no need to load the reward video on the start layout, this will automatically load the reward video for the first time when your game start also after user close the rewarded video.

    If you want to manually load the reward video then mark as comment or delete:

    > admob.rewardvideo.prepare()

    then call exec js manually inside C2 via browser exec js:

    > admob.rewardvideo.prepare();

    I had turned auto show on to see if that was the reason my ads weren't showing, so that might have been causing the loop. But when I had disabled it again, I was getting that black screen problem. Here's the codee I'm using.

  • Got a little further by changing auto show to false, but now my main menu won't load, I'm left with a black screen

  • > Hello again! I'm trying to test ads with Admob, but nothing happens both when I preview in browser and when I tested a debug apk on my phone. I believe I have the proper interstitial ID set (however, am I supposed to put the App ID somewhere? I just pasted it into the banner ID since I don't use any banner ads). By the way, there is a third option on Admob for rewards that I wanted to use, but I don't see an ID slot for it in the CS2 plugin.

    >

    > I want to let the player earn a life by watching an ad. I have the event set so that when the life icon sprite is tapped, to preload interstitial ad. Then on interstitial received, to show it. But when I run my game, it doesn't do anything. Any thoughts? Thanks in advance!

    AdMob ads only can appear on native mobile platform, if you want to try I have video tutorial for "AdMob Rewarded Video Ads" https://youtu.be/xHjw3McA4z4

    Hello! I have used your method, and after I though I had it all worked out, I ran into problems.

    My first issue was that after I triggered the ad, the ad would continue to loop over and over again. Even if I tried to cancel the reward, another ad would just pop up right away.

    So I realized a couple of things I did wrong, I called the function with parameter load within the show parameter, but after changing that and re exporting and everything, my problem got even worse! Now as soon as I launch the app, I'm met with a black screen briefly before I was spammed again with ads. Any ideas?

  • > I can open your capx as it uses 3 Plugins, but looking at your Picture of the Events this is what I see

    >

    > On your Function "On Save" you are downloading the JSON Array "edit_objectdata_AMASTER" before you save all your Info of the Objects of the Level, The Array "edit_objectdata_AMASTER" download AsJson it should be at the last Event after you save all the Info on it.

    >

    > Also on the same Function "On Save"

    >

    > Make sure you set the size of the Arrays to = 0 before you use the Expression Insert so you don't create extra Empty Cells on the Arrays

    > Example:

    > Before the Loop set Array Size

    >

    > W = 0

    > H = 1

    > D = 1

    >

    > Then use the Loops to save the data example to save the coins:

    >

    > -set Array Size

    >

    > W = 0

    > H = 1

    > D = 1

    >

    > -Then For Each Coin: Array Coins Push Front Coin.AsJSON

    >

    > Note: The Array Sizes you set them Once only and outside the Loops, probably at the Beginning of the Function on Event 78, set all your Array Sizes there

    >

    >

    > =--------------------------

    >

    > Now if you Did what I Wrote above you should have each Array as 1D = 1 Dimensional Array

    >

    > so you need to change the Events On Function "BuildLevel" Especificly the Loops that you use on the Array

    >

    > -Instead of using Array For Each XYZ you need to replace it by Array For Each X Element

    Just saw what you said about pushing the value in the front of the array instead of inserting one. I also moved the events where the master array is setting its values to the other arrays as json into its own function called "compileArrays". It's getting me a little closer, but now when I load up the project, the scale is off and some of the objects are mismatched.

  • I can open your capx as it uses 3 Plugins, but looking at your Picture of the Events this is what I see

    On your Function "On Save" you are downloading the JSON Array "edit_objectdata_AMASTER" before you save all your Info of the Objects of the Level, The Array "edit_objectdata_AMASTER" download AsJson it should be at the last Event after you save all the Info on it.

    Also on the same Function "On Save"

    Make sure you set the size of the Arrays to = 0 before you use the Expression Insert so you don't create extra Empty Cells on the Arrays

    Example:

    Before the Loop set Array Size

    W = 0

    H = 1

    D = 1

    Then use the Loops to save the data example to save the coins:

    -set Array Size

    W = 0

    H = 1

    D = 1

    -Then For Each Coin: Array Coins Push Front Coin.AsJSON

    Note: The Array Sizes you set them Once only and outside the Loops, probably at the Beginning of the Function on Event 78, set all your Array Sizes there

    =--------------------------

    Now if you Did what I Wrote above you should have each Array as 1D = 1 Dimensional Array

    so you need to change the Events On Function "BuildLevel" Especificly the Loops that you use on the Array

    -Instead of using Array For Each XYZ you need to replace it by Array For Each X Element

    I caught the mistake on function BuildLevel, where it was repeating only the coin's x element. I also added events to clear the arrays and set their sizes to 0,1,1. However, the levels are still not loading properly. When I load up a save of the default template, only the coins spawn properly, and one of my trampoline2 objects shows up out of nowhere. I'm really at a loss haha, this is a bit disheartening. Let me know if anything in this updated code stands out to you, cause idk what I'm doing wrong. Something in the load process maybe?

  • I'm implementing a level editor into my game, and I've gotten stuck on the save/load function. I'm trying to make the custom levels as simple as possible by having a single JSON file to load to. To accomplish this, I've made several arrays for each object type (coins, obstacles, etc), and then I have a master array that saves the JSON of each array on its x-axis. Then I add another x value for the JSON of the tilemap. My first few tests seemed to work, I could move objects around and then reload the level from the JSON file. However, I quickly ran into problems that I can't identify the source. The Tilemap does not load any data, but also doesn't clear itself, so the tile data from the previous level remains. Sometimes objects duplicate themselves multiple times, or fail to spawn at all. When they do spawn, their height and width are all messed up.

    capx is here if you wanna take a peek and help me out. All the data you're looking for is in the EDITOR layout and event sheet. There is another saving/loading group that is disabled; it's an earlier system I tried using system save states, but it was also not without its issues.

    drive.google.com/file/d/1qyT8soZvwN-WpgXEh9aUDXVFlMcPDXAy/view

    If someone actually took the time to dig in, fix and optimize my system, I wouldn't mind throwing them some money through paypal or something. Thanks in advance :)

  • I was able to download the plugin and the example file a few minutes ago from the links in the first post of the thread. and it works just fine.

    the example doesn't even have the Local Storage plugin in it, so that is not how you use it. The TimeAwayL plugin directly accesses local storage for you. you also don't want to pause the timer while your program is running and then try to start it manually when the program suspends or is closed down. Just use "Get or Start timer" at the start of the layout and just leave it run forever.

    the "timer" is just a time stamp. Nothing actually happens until you check the elapsed time (it just calculates the difference between the initial time stamp and now).

    Construct2 can't do push notifications, but I think there are plugins and 3rd party services that can do that.

    I found a workaround, using the unix timestamp to subtract saved time from current time to get elapsed seconds since app closed. I also downloaded a plugin called PushJS that lets me push notifications, but I want to be able to schedule them for when my timers are finished.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Been trying to get TimeAwayL to work so I can make an idling game for android, but I can't seem to crack it. The example capx no longer exists, so I couldn't look at an example.

    I have it working where if I lock my phone or leave the browser, the timer starts and then pauses when I resume it via the browser object, but I want it so that even if the user closes the app, the timer still counts. It would also be neat if I could push a notification to the user even when the app is off.

    If you can help me, thanks! Here's what I've tried so far:

  • Hello again! I'm trying to test ads with Admob, but nothing happens both when I preview in browser and when I tested a debug apk on my phone. I believe I have the proper interstitial ID set (however, am I supposed to put the App ID somewhere? I just pasted it into the banner ID since I don't use any banner ads). By the way, there is a third option on Admob for rewards that I wanted to use, but I don't see an ID slot for it in the CS2 plugin.

    I want to let the player earn a life by watching an ad. I have the event set so that when the life icon sprite is tapped, to preload interstitial ad. Then on interstitial received, to show it. But when I run my game, it doesn't do anything. Any thoughts? Thanks in advance!

  • Update, so it loads now, just obscenely slowly. I'm not sure why, even with the audio the project doesn't exceed 4 mb. Hmmm...