oosyrag's Forum Posts

  • If you're playing online from a browser, there would presumably be no malicious executable on the local device for the app to execute in the first place. My concern was for an NW.js app that is downloaded to be run locally, which could potentially be bundled with additional executable files.

    On the other hand, you're already downloading an executable in the form of the NW.js app and running it anyways, so it's not really a big difference in the end.

    There are better things to worry about regarding children online.

  • Assuming your background is tiling, you simply extend it past the viewable area and center it horizontally or vertically under the player whenever the player moves a distance that is a multiple of the tile size in the respective direction.

  • Ok, so there's two parts to this. There are a few ways to go about it, but without knowing if you have a grid or array system in place already, I'll be using the system condition Pick overlapping point.

    On clicked, if the cursor is not over a cannon, check the 8 spots around the clicked location to see if a cannon exists (9 really, just to make it easier to loop through, even though we already know there's no cannon where we clicked). We'll check each overlapping point for a cannon, and pick it if it's there. If there are any (picked count > 0), then place the cannon. We'll use a system for loop for x and y location, from -1 to 1, multiplied by the width/height of the cannon (or your grid size basically) to go through each position. If there are no cannons picked/found, that means that was not a valid place to put a cannon and nothing happens.

    + Mouse: On Left button Clicked
    + Mouse: [X] Cursor is over Cannon
    + System: For "x" from -1 to 1
    + System: For "y" from -1 to 1
    + System: Pick Cannon overlapping (Mouse.X+LoopIndex("x")×Cannon.Width, Mouse.Y+LoopIndex("y")×Cannon.Height)
    + System: Cannon.PickedCount > 0
    -> System: Create object Cannon on layer 0 at (Mouse.X, Mouse.Y), create hierarchy: False, template: ""
    

    Instead of creating at mouse x and y you should use whatever snapping system you have to align it to your grid.

    If there is already a cannon where we clicked, we will be (randomly I'm assuming?) placing a cannon in one of the 8 spots around it, that doesn't already have a cannon. We'll need local variables to keep track of which position we randomly chose, check those positions, and then only if it's valid place the cannon and stop the loop. There will also need to be a way to stop the loop if every spot around the clicked cannon is unavailable. This part is significantly more complicated, haven't quite got it working yet. Maybe using a permutation table with the advanced random plugin would be the cleanest way instead of just randomly picking spots around the target...

    dropbox.com/scl/fi/mszw7bwp4vvglgmjo9siw/neighborcheckexample.c3p

  • Performance wise, pinning is more or less the same as moving or updating the position every tick, don't worry about it.

    While it is commendable to try to avoid every tick events whenever possible, it is indeed often necessary and suitable for certain purposes, such as displaying/updating the position of a moving object smoothly.

    If you wanted to waste time optimizing, you could add an additional condition and variables to keep track of past x and y position to compare with to check if the position of the player actually changed before running the action to update the location of the health bar. But that would be silly. (Don't do that.)

  • dropbox.com/scl/fi/n8obqdjizvv58o4bn6i28/quadrifoliumpathexample.c3p

    A quadrifolium is a polar equation, so you'll want to describe it in terms of rotations. Specifically, it has a sine curve with an angular frequency of 2, that is, for every full rotation, the sin cycle should complete twice. We happen to conveniently have both rotation and sine behaviors available to us.

    To rotate it, change the starting angle.

    PS: To adjust the duration of the cycle, you'll have to change the speed of the rotation and period of the sine wave proportionally. Rotation speed is in degrees per second, and sine period is seconds per cycle. Again, you want two sine periods per (360 degree) rotation cycle for a quadrifolium. So 360/rotatespeed will get you seconds per rotation cycle, and divide that by 2 for the desired sine period.

  • Add an instance variable to keep track of the state of the character, isClimbing or not, that you can check. If not climbing, then move onto the ladder and set the variable. If already climbing, then don't.

  • The most straightforward way would be to add a condition that checks if mouse/touch is overlapping a checkmark before doing the place action.

    How are you displaying the checkmarks? You can use the exact same logic to see if it is a valid location to place a cannon.

  • If you don't have obstacles, you don't need pathfinding. You can try tween, moveto, or bullet instead.

    If you do need pathfinding for some reason, then more information about your game would be needed to help troubleshoot.

    For starters, use as large a cell size as you can that still works. And make sure you're not finding a path every tick, it should only be done once until needed again.

  • Also note that many commercial RTS games with pathfinding do actually allow overlapping. Broadly speaking, they either use a system of de-collision at given intervals or at the final destination, or they use a steering/flocking algorithm that applies forces to avoid collision.

    Of course preventing overlapping completely is a thing that exists and possible as well, but it often causes issues with pathfinding when traffic happens. There are examples of developers getting this to "work", and then abandoning it later after realizing it causes more problems than otherwise.

  • You do not have permission to view this post

  • dropbox.com/scl/fi/4v2sedjay6c4tcwm278fb/dissolveandburnexample.c3p

    Now with burn layer.

    Pretty happy how the effect itself turned out - you can change the look and feel significantly by adjusting the tween duration and ease, octave setting for the noise, burn texture, timing between the dissolve and burn, noise type, adding some motion/rotation/animation to the burn texture ect.

    Pretty not happy with how many layers it takes and the redundant base sprite and burn/dissolve masks, along with all the associated events. I'm 99% certain it can be refactored but my brain is not cooperating at the moment. I've never been particularly comfortable layering blend modes in Construct but I'm sure there's a more compact way to do this somehow... aiming for a single base sprite with the flame texture and one mask (maybe 2 are needed for this approach).

    Also the burn texture can probably be drawn with some simple noise on the drawing canvas too, instead of using a sprite.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • construct.net/en/make-games/manuals/construct-3/plugin-reference/nw-js

    See the section in the manual regarding using file paths correctly on the NW.js page.

    It recommends writing to NWjs.UserFolder & "myfile.txt", however I would additionally recommend putting it in a directory unique to your game, as well as saving the file as .json if you'll be saving data in json format. Alternatively, use an obfuscated/unique/encrypted format you are familiar with.

    You want to use the NW.js Write text file action, with your array.asJSON as the content to write. Or whatever else type/format of data you're saving. Dictionary.asJSON works well as well, and is more similar to LocalStorage in terms of keys and values. Save to your dictionary as you normally would have to LocalStorage, with the additional step of writing the dictionary to disk as a file through NW.js when desired.

    To load, you can use the ReadFile() expression (into your load dictionary or load array action). You can get information about the file location with the NW.js action List files along with the UserFolder, ListCount, and ListAt() expressions to confirm and validate the existence of save files.

  • Oh I see. I don't think you can run another executable from your project. That sounds like it would be a huge security issue.

  • Export to NW.js or Windows (WebView2).

    Consider reading the fabulous manual.

    construct.net/en/make-games/manuals/construct-3/overview/publishing-projects

  • Do not mix physics with other movement behaviors.

    If you're using physics, use physics actions to move objects.