larrynachos's Forum Posts

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

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

  • Try Construct 3

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

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

  • Hello, I've been chipping away at a mobile game for a while. I had been previewing on my phone just fine until I added audio to it. Now when I try to preview it does one of three things

    Freezes as a black screen

    Freezes as the loading screen (sometimes blue bar, sometimes red)

    Gave a javascript error (I haven't been able to get a screenshot but it says something like javascript error preview prelude)

    Preview works fine in pc browser. I can preview other mobile projects with sound with no problem, I'm really not sure what's going on. I'll post again if I can replicate that javascript error, but in the meantime, any ideas?

    Using r265

  • Phoenixbowman

    This is one of my thumbsticks, and the easiest to follow:

    Again, it seems like a lot, but it does move pretty fluidly. And if you'd like, you can set the thumbstick (the small inner circle) at 0% opacity so it won't be seen.

    There is a way to do this just with a touch input and without a thumbstick, but imo users tend to slide their thumb around the screen, which makes them have to stop, lift their thumb and bring it back down to the corner. This way it gives them a point of reference for their thumb.

    Sorry to bump such an old post, but I've been using your method for a mobile game I'm working on, but the movement is a bit janky. There are brief moments when it seems to move properly, but usually the direction doesn't change if I am sliding the stick in different directions.

  • Don't use a family,

    when "on collision NPC with NPC" will pick both of those.

    Add an event to pick the smallest of the two. then it will destroy the right one.

    I'm getting warmer, I can feel it. I got it to where the npc with the highest mass will absorb the other one, but I can't get it to see if the mass is 1.25x the smaller one, so a difference of 1 mass will result in absorption. Also, I'm not certain that the number being added to the mass is half the mass of the lower mass object, but instead adding half of the mass of the bigger being itself.

    This is the event I'm using. I had to disable the mass check or else it wouldn't work.

    =============

    BONUS QUESTION, because I don't want to spam with threads lol. I'm trying to redo my npc ai events so that they move more efficiently and realistically. Initially, I just had them picking a random instance of the food object and pathfinding to it, but I want them to chase food that is closer to them, and I want them to recalculate if the food they were chasing is eaten by someone else. I keep having a problem where they all chase the same food in a synchronous movement. I want them to move at different times from each other, to chase food more intelligently and to recognize when the food they're pathfinding to is eaten.

    Here is the event I'm using. I also tried using a state system and an identification system for the food objects, but both options didn't function. Pls halp ;-;

  • If the npcs aren´t in a family yet, drop them in a family (maybe the player too, but that depends) and do

    NPCfamily on collision with NPC

    Okay, that gets me a little further :) but how do I call to the unique instance variables for the big npc and the smaller npc that is being eaten. The family doesn't have an instance variable.

    Also, I'm a goon and put this in the Construct 3 section instead of Construct 2, but the same principles should apply to my issue :L

  • I've run into an issue with an agar.io clone minigame I'm implementing into my game. I have it working where if the player is 1.25x the size of an ai, the player absorbs it. However, I hit a snag when trying to make the ai be able to eat each other as well.

    The event for the player eating Ai is as follows:

    player on collision with npc | Player add npc.mass to mass

    player.mass > npc.mass*1.25 | Npc set mass to 0 (there's another event that destroys an npc when mass = 0)

    However, when I make this event affect npcs vs npcs:

    npc on collision with npc | npc add npc.mass to mass

    npc.mass > npc.mass*1.25 | Npc set mass to 0

    whenever the npcs touch each other, they both are destroyed, regardless of size. I'm assuming it's because cs doesn't know which npc I'm referring to in either instance. Is there a way to fix this? I've done a little research, to no avail. Thank you!

    Bonus question: How do I make the ai run away from the player, as well as each other npcs if they're bigger than 1.25x their own mass? They're using pathfinding and LOS. Right now I have them pathfind to a random point in the layout, but more often than not they just run right into the player, getting absorbed.

    I'd also like a little help on keeping the npcs from bunching up or chasing the same food, as well as something to detect when the food they're chasing has already been eaten by someone else.

    Tagged: