dop2000's Forum Posts

  • Have you tried oosyrag's version? It's pretty cool.

    Here is with LOS raycasting:

    dropbox.com/s/djkilpaho46uuch/BorderAim.c3p

  • > If the events are at root level, they are executed on every tick.

    Why are they excluded?

    "Executed", not "excluded". Because that's how Construct works. All events are executed on every tick, unless they are triggers or functions.

    It's all local, so nothing is fetched remotely. All I'm doing is loading in a local JSON file that is embedded with the project.

    It still may require 1-2 ticks to be fetched, or maybe even longer on a slower machine. So you should not start checking JSON keys until it finished loading!

    Try this code:

    JSON has key "maps.test" -> Browser Log "HAS key, "&tickcount
    Else -> Browser Log "NO key, "&tickcount
    

    Open browser console and check the messages. You will probably see a couple of "NO key" before "HAS key" appear.

    I keep running into strange scenarios...

    JSON.CurrentKey works only inside "JSON For Each" loop. If you need to get current path outside the loop, use JSON.path expression.

  • When then I don't understand what you are struggling with. Where do you store these JSON strings after you get them from the server? What is the JSON structure?

    In pseudocode, you need do something like this:

    Array For Each X element
     JSON Parse (string for this X)
     Array set at X=Self.CurX, Y=1 value:JSON.Get("key_for_Y1")
     Array set at X=Self.CurX, Y=2 value:JSON.Get("key_for_Y2")
     Array set at X=Self.CurX, Y=3 value:JSON.Get("key_for_Y3")
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Where do you get these five JSON strings from? Are they stored in files, or in another array or do you request them from a server?

  • They could just permanently 'toggle disabled' the code or something, so you could at least review it and replace it below those lines

    As I understand, the reason why it's not possible in C3 is because its code editor is visual. It can not display an event or action from the missing plugin, because it doesn't know how. (this info is in the missing plugin)

    The only option is to skip all these events, actions and conditions. And there is a good chance that the project will become corrupted without them - there may be orphaned Else-blocks, missing functions, broken hierarchies etc.

    Also, I guess, Scirra developers want to avoid complaints from people whose projects became unusable because of that.

  • Sorry, it's a bit difficult to understand. If you set array height to 4, you will have 3 additional elements for each X index.

    Or are you asking about an array inside of JSON object?

  • Is the gun always pointing horizontally (not rotating to mouse position)? Then you can simply do this:

    Aim set angle to (-recoil)

    Or when the sprite is mirrored:

    Aim set angle to (180+recoil)

  • There may be an easier way. You can add a border around the edges of the screen, using invisible sprites for example. Then cast a ray from the center of the screen to the target, using Line Of Sight behavior. Detect where the ray hits the invisible border, and position your magnifying glass in that point.

  • Not sure what you mean. You need to select Android(Cordova) option, then in the next dialog you will be able to choose Android Build - Debug APK

  • File size in a browser game affects loading time. But for memory usage the image dimensions in pixels are critical. So if there is a lot of transparent space around the image, cropping it will reduce memory usage.

    What is the maximum memory usage in your game? You can see it if you right click on the project name, select Tools, Project Statistics.

    My estimation that if it's under 1GB, it should be fine for a browser game.

  • Chech out this demo:

    dropbox.com/s/srgf9lme08by9wa/JSON-RecursiveRead.c3p

    I find it quite useful - it shows full paths for all keys in JSON.

  • edsonticjoy Congrats, the game looks really nice! I love how simple and clean the graphics is!

  • I've used such effect in Construct 2, I think it was called "Force 16 color palette":

    construct.net/en/forum/construct-2/effects-31/effect-force-colors-119594

    Maybe you can find someone who would port it for C3.

    If you find that or similar effect, you can apply it to the entire layout.