R0J0hound's Forum Posts

  • My guess would be to look into the json your website is generating.

    Maybe it’s mistakenly putting a width of 370 but it only contains 342 elements in the array in the json?

    Im guessing the size part of the json is largely ignored when it loads and instead it relies on the size of the data? It’s something you can test.

  • Ah, maybe the sdk2 update broke something with the scripting interface? I can’t test, I haven’t really used my computer in weeks.

    You could file a bug report. Or if you’re up for some deeper testing on your end before you report you could spot check some older releases in case it’s a regression. I’d check the versions before the sdk2 changes started.

    An unsupported way to do it is to bypass the script interface of the plugin and access the object instance directly. However that seems to be officially frowned on and they are trying to hide how to do that more.

    Worst case you could just access the values from the event sheet side. If you want to access it from JavaScript you could make an event sheet function to get the values and call it from js.

  • It’s probably when you’re accessing it that’s the issue. I’m guessing that onbeforeprojectstart runs before the the plugin’s object type is initialized. I mean since it’s undefined when you call it that makes sense.

    Maybe try calling it from the runonstartup callback, or at least some point after things are defined.

    construct.net/en/make-games/manuals/construct-3/scripting/using-scripting/script-files

  • I mean that has nothing to do with construct. But you can wait on their reply if they even do reply.

    Here is the current standard way of writing to the clipboard from the browser if you want something to mess with now.

    developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText

    If it doesn’t work then you need to somehow look at the errors and exemptions that are usually shown on the browser console. If you can’t access the browser console then you need to display it another way. Worst case clipboard access isn’t supported in the browser engine that app you’re using. Only workaround then is to make an editbox with the text and let the user select and copy it. Or you could do your own fake clipboard if you’re only copying/pasting within your game.

  • That particular way to access the clipboard is depreciated in most browsers. There’s a newer way you could try. Just google the clipboard JavaScript api. But in general clipboard access doesn’t seem well supported across browsers. No idea what the telegram mini app supports, maybe it has a different way to access the clipboard.

    Looking at the error console after running that code could possibly give the error.

  • Here’s some older examples of custom solutions for wall sliding.

    construct.net/en/forum/construct-2/how-do-i-18/8-direction-behavior-slide-95148

    Wall sliding usually works by finding the closest direction an object can move and stop overlapping. Also the velocity is canceled along that direction.

    No idea how construct is doing that under the hood currently, but in c2 it would do the push out by checking positions around the object’s starting position till a free space was found.

    In the examples above it would treat the player as a circle and find the closest distance from the player to the edges of the box to find the closest direction. But there are other ways.

  • Your parents may be onto something.

    If your goal is to not get a job and just make and sell games to make a living then I’d see that as uncertain future too. And that’s me only knowing you have passion for game development. Your parents are closer to the situation and probably have better advice than strangers online.

    However, I doubt they’d be opposed to you working for a game development company and earning a living that way.

    Either way as long as you’re living at home or financially dependent on your parents then they will try to steer you toward a path where they see you making a stable living and being independent.

    It never hurts to have a different stable job and do game development on the side till you’re at the point where you find it viable to make a living off of it. I mean whatever you do your goal should be to be able to live off what you make.

  • There isn’t a way to reverse an export back to an c3p file, and I don’t think anyone would be happy if there were.

  • The pathfinding behavior (or most all construct behaviors for that matter) only work for 2d. That means in 3d it works on the xy plane where z=0. The obstacle map for the pathfinding behavior relies on 2d collisions so we are limited by that too.

    Most you can do is vary the z of the objects as they move along the path.

    More complex could be to to transform the pathfinding to a different plane or wrap the plane onto a 3d surface. That would entail having the pathfinding done as normal and transforming the resulting position in some way. Main problem with that is visualizing it so you can design the maps.

    Things like tunnels, overhangs or multiple levels simply isn’t possible. Well other than just having a separate path per layer and having a manual transition between levels to switch. That does have its limitations on the kind of levels you can do and you’ll have to work around things like the pathfinding map being shared between behaviors as an optimization.

    Second option is to roll an event based solution. For simplicity we could just have a list of nodes and a list of connections between the nodes. Nav meshes would be more complex since they also define walkable areas, not just lines.

    Anyways building those lists is tedious in construct. Making a way to mostly automate it would have to be done on a game by game basis. Probably an in game editor would be the easiest way to define them, or somehow exporting a rough 3d approximation of the 3d level to a 3d format that you can load into blender or something and create the mesh on top and then load back into your game. So overall there is some tooling you’d need to do to make defining the mesh doable. Simplest would be to a grid based array of nodes since that’s easy to generate. But you may want to modify it more somehow.

    The second part is the actual pathfinding over the mesh. An algorithm such as Astar isn’t too complex and works well with lists of nodes and connections. Most implementations you can find just do something grid based since it’s simpler.

    Anyways after that you’d either get no path or a list of nodes to move to the goal.

    The final part is moving along the path. The move to behavior comes to mind or you could do something else.

    For something like in your screen shot you could get away with something much simpler than all that. Just move enemies toward the player and wall slide around walls. If the player is on a higher platform move the enemy to the closest ramp to move up. Then if you have any places the enemy gets stuck you could you just detect if the enemies are there and move them away.

  • Does the last release 280 not work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe the images you’re using aren’t premultiplied by the alpha?

    The engine assumes that images are already like that but there are likely images out there that aren’t.

  • I guess one way could be to slice the ground plan in half by a horizontal line then use mesh distort to make the two halves of the hole. I can almost guarantee that the game did something simpler like using a stencil or just changing the depth function. But we are limited with what we can do 3d wise.

    If you stick to isometric then just having a sprite fit the front of and back of the hole and zordering it with other objects should work.

    Using 2d physics for 3d physics probably wouldn’t look great in most cases. Probably the idea could be to enable the object’s physics when their y is close to the hole’s y. Then for the hole you’d have two boxes on either side of the hole for its collision.

    3d physics would look better and there’s probably a reasonable minimum physics engine needed.

  • That example is a bit old. The pathfinding and moving events can be tightened up a bit, and instead of listing the UIDs of neighboring nodes you could just stretch edge sprites between nodes. It would be more visual anyways.

    A plugin for this would only be useful if it could place nodes/connections on the layout in a visual interactive way. The editor sdk doesn’t have anything to allow this though. So you’d end up having to still use node sprites and edge sprites then make events to tell the plugins the nodes and connections.

  • This is how I use arrays for data like that.

    Here is some example data: 0, name, x, y

    The 0’s will be changed in events so we can sort by any property we want. See the end of the post.

    0, “orc”, 15, 34
    0, “fish”, 100,100
    0, “axe”, 5, 55

    Which is an array of size (3,4,1). Indexes of the values are:

    (0,0), (0,1), (0,2), (0,3)
    (1,0), (1,1), (1,2), (1,3)
    (2,0), (2,1), (2,2), (2,3)

    So you access values with array.at(item, property)

    Item is 0 for the first, 1 for the second and so on.

    Property is

    0 - sort value

    1 - name

    2 - x

    3 - y

    Now to sort the list you’d first copy any property you want to sort by to the first value in the line and sort by x.

    On function sort(property)
    — Array: for each x
    — — array: set (array.curX, 0) to array.at(array.curx, property)
    — [blank event]
    — — array: sort by x
  • The physics behavior triggers on collision when it’s it detects a collision and does a collision response.

    Typically the collision is fully resolved so there’s no overlap by the time a user added overlap check is done. It doesn’t when there’s a high impulse because it sometimes can take a few frames to push things apart in the physics engine.