R0J0hound's Recent Forum Activity

  • I only vaguely remember what the code was and haven’t been on my computer in weeks. But let’s see.

    I think I meant that you’d need to add the uvs to the mesh object when loading the obj file. The uv array would need to be 2/3 the length of the verts array to work. And as I recall it first is in a normal js array then that’s put into a typed array to be useable with webgl.

    I still say it’s better/simpler to just open the obj file in a 3d modeler and re-export it with uv’s.

    That other two triangle thing is unrelated. The plug-in draws to a texture and those two triangles make up a quad so that texture can be drawn to the screen.

  • Another way is to set the gravity to zero and manually apply acceleration to the objects. VelocityY = velocityY + gravity*dt

    You can use forces instead where force=mass*gravity but the values for many things in the physics behavior are off by factors of 50 so you may need to scale values accordingly.

    You could also in concept undo any motion do to gravity by manually applying a reverse acceleration.

    Vy = vy-gravity*dt/2

    Y = y - vy*dt

    Vy = vy-gravity*dt/2

    However that would only work if the object didn’t have any collisions and you may lose a little precision from the calculations.

    You also possibly could apply a force to counteract gravity but the values need to be spot on.

    Anyways that’s just some alternate ideas if you need a more immediate solution.

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

  • Try Construct 3

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

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

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound