R0J0hound's Recent Forum Activity

  • I just mean instead of creating all those sprites in grid positions and then picking them later, you could just set values in a 2d array and be able to access grids directly without picking. Its main con is it’s less visual than using sprites.

    Other than that the general logic should be the same. Updating only the parts that change instead of the whole thing is a decent idea to make it perform better.

    I don’t have much input about what may be amiss with your event logic though. It’s kind of a more hands on thing and I presently don’t have a whole lot of time for that.

  • You could do something like:

    Var i=0

    On click

    — Set x to ChooseIndex(i, 20, 50, 300)

    — add 1 to i

  • If that runs at the start of your game you can use get a value from the time, for example "Hello"&int(time/0.2).

    Other than that, you could use an instance variable instead of a static variable.

  • You could do it with an array. That would avoid the overhead of picking. Beyond that you could do it with js to be a bit faster. Finally, you could do it with a few effects which is faster still:

    dropbox.com/scl/fi/ircvqkuu0p86ako11h34u/frontline_w_effects.c3p

    That works great as purely a visual. If you wanted to access those edges you'll probably need to do one of the other methods.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're probably on the right track for a way to do that. Basically, drawing to a 2d grid and then looping over it to find the edges.

    Your screenshotted events aren't working because you first pick one point, but you can't pick the second point when the first is already picked. A quick fix would be to add a "pick all point" condition after the finding if the point was blue.

  • What have you tried so far? Generally most would just use the physics behavior for that. Turn off gravity and add a lot of linear damping to the balls so they slow down.

    That would basically be sliding circles and can look good enough and is easy to do.

    More advanced would be to model the balls as actual 3d balls with more elaborate physics. That would be done by either wiring in a general 3d physics library or rolling your own specialized 3d physics.

  • So a damped spring works well for getting the position to match but since the target is moving we probably want to match the velocity too.

    If you assume the target is moving at a constant velocity or with a constant acceleration it’s fairly easy to predict where it will be in the future. Ideally you’d take the predicted path and the path of the crosshairs and solve it so that they cross paths at the same time. But I can think of a few reasons why that would be hard to calculate.

    Alternately maybe we could modify the formula a bit. It’s basically -spring*dx/dt-damping*velocity. So the damping is applied to the total velocity. Instead we could damp by the relative velocity. That would let it settle on the path the target is moving instead of lagging behind. So something like this? I haven’t tested it.

    Scope: Add -0.005*(scope.x-target.x)/dt-0.1*(scope.vx-target.vx) to vx

  • You mentioned a rubber band so you could do that with a damped spring. Basically add two variables for xy velocity: vx,vy. Then do the following. You can tune it by changing the 0.005 and 0.1 values. You can use any value from 0 to 1. The first value is the strength of the spring and the second is the amount of damping to apply.

    Compare: dt > 0

    -- add -0.005*(scope.x-target.x)/dt-0.1*vx to vx

    -- add -0.005*(scope.y-target.y)/dt-0.1*vy to vy

    -- scope: set position to (scope.x+vx*dt, scope.y+vy*dt)

  • Probably you’d just need to make a feature request to do that if the export doesn’t have an option to remove the title bar.

    Webview2 doesn’t come with much of a js api like nw.js did. It also has no command line switches. One rabbit hole you could explore are “wrapper extensions” as mentioned in the sdk manual. That would let you make a plugin in c++ land which has far less limits on what is possible. Presumably you could make a plugin that uses the winapi to get the current process, then the window, and from that change a flag to hide the title bar. Could be a pretty big time sink to figure out and do though. I won’t venture it since I just use the free version and never use exports.

    Making an official feature request is probably the easiest approach.

  • Do you have a project you’re trying to open that relies on those versions?

    Even though the GitHub doesn’t have the updated 0.24 files it does have the change log from 0.23: two expressions and a fix. You could update it to a 0.24 release yourself.

    It’s simple enough to change the version to 0.24 and add the two expressions to the plugin. I’d imagine they have two number parameters for x and y. You’ll have to guess the ids of the expressions unless you have a project that uses them, in which case you can find the ids in the event sheet xml file. But if you had to guess I’d imagine they were 0 and 1 based on how the actions are numbered. That would at least let you open your project and be compatible with the real 0.24 release.

    Implementing the js side of the expressions should be simple enough.

    The fix for “block using object” would be the most involved, but not too bad. At a glance the plugin uses a 2d array to store the cost of cells and if they are blocked. When it uses an object to block it loops over all the cells that overlap the objects bounding box and sets them. So I’d assume there was a simple typo or oversight in 0.23 that needed correcting.

  • I don’t have an example. The way to load a data url is simple. For example use the “load frame from url” action of the sprite object.

    Start of layout

    — Sprite: load frame from url "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAwFBMVEUcdLVRaKWfbHD5VlL9WFX/W1H1T2igEeOwUn2naGL8VFL/WlXbUU9mO0ZrQT+lPmjlp6r0cnP/VU/uT0tFPkoWNkcSLT8eMz3rdne0rLjJnqaTWF8vSVlGUV8gLTwgLz37UEv9XVnFkpqPpLNzgY83RlYlM0JHX3XDTlDqUk/2UExZVmN1hpeTpat2fpR0GOe4Sk3pVVLqVlMoLDsZLjo9RmSPPPaFAP/TUFD7WFP0VlNEOEYSMDtQLlCLAOd6AP8xRjMWAAAAH0lEQVQIW2NkYIQCDhhDAMaQgDEUYAwNGMMAxrCA0gAgEAEhAJ4eUwAAAABJRU5ErkJggg=="

    That replaces the current frame with an 8x8 version of your avatar.

    You can convert an image into a dataurl with tools online, or in construct with the drawing canvas, or with JavaScript I suppose.

  • You could load an image from a dataurl to get an image without a file. You just have to do that in events. A data url has the file encoded as a base64 text string. The main drawback is base64 is 33% larger than a normal file. It could similarly be done with audio files.

    In a more complex fashion you could load a file you previously encrypted with some js or into the binary object. Then you’d decrypt it and convert it into a dataurl to then load into the sprite or audio plugin. That would avoid the size increase but you’d add to the loading time to do the decryption and conversion.

    Probably you’d only do that for a few spoiler images. It would be laborious for doing that with a full sprite animation. Not to mention you’d lose the optimization of images being sprite sheeted together.

    Bear in mind you can’t load images into all the plugins at runtime. For example spritefont and tilemap don’t have that capability. Also loading images into tiled backgrounds load it per instance so that would be inefficient.

    Probably look at the cryptography object.