R0J0hound's Recent Forum Activity

  • Mario games handled it by checking the vertical velocity of Mario when hitting the enemy.

    Mario collides with enemy

    Mario y velocity >0

    — kill enemy

    Mario collides with enemy

    Mario y velocity <=0

    — kill Mario

  • The 3d that construct provides is pretty simple. Basically just some 3d objects you can place, and the ability to rotate the 3d camera. Construct’s collision system, and most behaviors are 2d so the 3d is mostly cosmetic.

    You can place most object’s xy and zelevation, but you are limited to rotations around the z-axis. And the included 3dshape plugin has a limited set of different meshes you can use.

    The mesh distort feature of sprites can be used to make other shapes and do rotations on other axis’s with some math. The only caveat with meshes is mesh points can only have zelevations greater than 0. It’s just something you have to workaround.

    Motion, collisions and raycasts in 3d are mostly done manually with events or js. Basically done from some existing algorithm or some math.

    At its lowest level you have the 3dcamera with the look at action, distort meshes and math. A lot is possible with this but it’s mostly used to do things that aren’t exactly simple.

    For the math you could look up any 3d math tutorial which probably covers some vector math, rotations, spherical coordinates and some matrix math. But in practice you probably don’t need to use all of it.

    Often users utilize the third party 3d object plugin to do stuff easier. It loads meshes in the gltf file format with animations. It lets you rotate objects in any way and includes behaviors for 3d physics and raycasting. It’s not free though. But it seems to try to push what you can do with 3d in construct.

    In construct’s editor you cannot change the camera’s angle in 3d so it’s not ideal for designing levels in many cases. So some have experimented with the workflow of designing the level in blender.

    At this time there is an issue with amd rx cards where if you have objects with transparency it will render wrong. Official response is it’s a driver bug, and amd needs to fix their driver. So you may have to deal with broken rendering for some users. Scirra doesn’t have hardware to reproduce the issue, and from what I can tell users with the issue haven’t found a way to effectively report the issue to amd to maybe get it corrected. On the plus side the author of that third party plug-in have been trying to find a patch to work and the issue.

    Anyways, myst was pre-rendered as I recall. Videos transitioning as you moved around and maybe a cube view box to look around the room.

    You could go all 3d though. Mostly just a matter of getting the mesh in there. To interact with stuff you could do this low tech but effective technique to do the raycasts. Basically have a 2d layer you can get the mouse from. And use a system expression to convert the xyz of the object on the 3d layer to the 2d layer and compare the distance or something.

    The final bit would be the camera transitions. It should mostly be motion along a path. Same as in 2d but with z too.

    Overall 3d is doable in construct but it’s mostly doing stuff yourself or using workarounds.

  • You want to detect a collision without a collision? Any reason you can’t enable the collision?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On disk or on a server it’s considered a file such as png.

    Once the file is loaded and decoded into an array of pixels in memory it’s an image.

    To render the image it needs to be copied over to video memory which is a texture.

    In webgl for example you’d first create an html image object from the png then a webgl texture object from the image.

    If you delve into webgl you can get pixels back into an image. Basically render the texture to a framebuffer and call getpixels to get an array of the pixels. Then create an html canvas of the same size, get an image buffer from that and copy the array of pixels to that. Finally canvas.imageUrl will give a data url (aka base64 version of a png) that you can load into an image or download. That’s basically how taking a screenshot works.

  • The sdk manual says nothing about getting a texture’s image.

    Take all my suggestions with a grain of salt. I can only go by what I find in the manual. When actually making a plugin you have the other tool of using console.log with whatever object you’re curious about and then you can then browse that object from the browsers debug console. That would let you confirm the things the manual lists as well as show anything not mentioned.

  • At edit time and at runtime there are sdk functions where you specify how the object is drawn in your plugin.

  • If you got the texture then it’s just a matter of using it in the render function I suppose.

  • The object property gives an id, and you can use one of the runtime methods to get the object class from the id. Object class is just the base of object type so you should be able to use the methods of either. From the object type you can use get image to get an animation interface where you can get the texture.

    This is based on looking through the sdk docs.

  • Probably the best way to debug it is to be very verbose about displaying the raw text every step of the way. Aka line by line, text before replace, text after replace, and the regex expression used.

    The issue is bbcodes and regex both have special character combinations and you have to be careful. Even posting about it on the forum is problematic since it uses a form of bbcode too.

    If it becomes too unwieldy using regex you could utilize your parser you’re using to assemble the text maybe?

    Anyways, good luck

  • I didn't notice it in the docs about bbcodes. But if you use

    \.[.

    it will give you a [ character and it won't become a bbcode. Example:

    [color=red]red[/color] Text is done with [color=red]red[/color]

    edit:

    Bbcodes get messed up on the form, so here's a screenshot of what i meant:

  • Well, if you modify that js snippet to add the event listener to the document instead of a textInput control then it will keep the tab key from jumping around the browser window.

    This is what I mean by what I said about letting you type with the tab key in a spritefont.

    dropbox.com/scl/fi/1392o042wut3fuzj6vik5/SpritefontTextInput.c3p

  • Ah. Well if you’re just getting the key pressed from the keyboard object you can forget about that JavaScript.

    Just add a tab character to the spritefont, set its width, and you’re good to go. You’ll probably have to type tab in something like notepad and copy/paste it over unless construct supports escaped characters like \t.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound