R0J0hound's Recent Forum Activity

  • You say it old happens in your game, but if you add save/load to the template does it still happen?

    Most plugins do try to save load everything but it could be something that was just overlooked so it would be a bug.

    Other option would be to try to work around the bug. Maybe try to do some things when the game loads to fix the orientation or request pointer lock again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it possible to select a specific instance of an object for a 3D face to use as a face object?

    Yes, you just need to pick a specific instance to use with conditions.

    When an instance of an object is being used as the face of a 3D object can I use the attachment points of that instance?

    Just the image is used when setting the face of a 3d shape. You’d have to calculate that from scratch.

    For example, a unrotated 3dshape with its origin at the bottom center, with the front face set from a sprite. You can then calculate the image point location on the front face with something like:

    ipx = (sprite.imagepointX(1)-sprite.bboxLeft)/sprite.width
    ipy = (sprite.imagepointY(1)-sprite.bboxTop)/sprite.height
    X=3dshape.x +(ipx-0.5)*3dshape.width
    Y=3dshape.y +0.5*3dshape.height
    Z=3dshape.zelevation+ipy*3dshape.zheight

    If the 3dshape is rotated that would be another step:

    NewX = (x-xcenter)*cos(angle)-(y-ycenter)*sin(angle)+xcenter

    NewY = (x-xcenter)*sin(angle)+(y-ycenter)*cos(angle)+ycenter

    Anyways, that’s roughly how it can be done. You’d pick a sprite to use as the front face, set the front face, and calculate the position from that picked sprite on the front face.

  • Competitions like that are fun. It would be cool if they did it again for another type of game. Platformers are the easiest thing to prototype in construct, so it got an edge there.

  • You do not have permission to view this post

  • Trig functions in construct use degrees instead of radians so you don’t have to use pi.

    And yeah you’d only change the 100.

  • Guess it would help to show what you’re trying to use as a formula.

    Here’s one possible formula using sin() and the day as input. Every 100 days it will oscillate between 50 to 90.

    70+20*sin(day/100*360)

    Alternately you can use cosp() which interpolates between two values using a sine wave.

    cosp(50,90, day/100/2)

    The /2 was needed otherwise it would be 200 days for a full cycle.

  • In the json file itself you can only have text and numbers. The parser can be made to run them.

    Anyways, it's not exactly simple but you can make it do whatever you like.

    Here is a partial example using just a dictionary. I ran out of time but it will run stuff like:

    foo=33
    bar=foo/3
    a = a + 5

    I didn't get around to making it handle operator precedence (multiplies before additions), or parenthesis. You can assign a single value or a simple one operator equation. For error checking it knows when it's wrong but I didn't get around to giving anything more than a message that says syntax error.

    dropbox.com/s/w49tbarkexaq3bb/dict_parser_partial.capx

    Overall it's a tradeoff. Polishing up a parser and adding all the features you want vs doing more in the event sheets.

  • Making an expression parser would be useful to do that. It's basically what you're describing. First step is to break the text up into tokens (numbers, operators and names). For speed you could make a regex to do that. Then with the tokens you'd make a parser.

    Here's a rough outline of the grammar the parser could use.

    script: name assignOp exp
    exp: atom [op atom]*
    atom: number | name
    number: digit+[.digit+]
    op: "+" | "-" | "*" | "/"
    name: letter+["." | letter]*

    I've made a few parsers in constuct in the past with various levels of complexity. I think you can get away with making it simpler if you cut out most error checking and order of operations perhaps. I'll try to wip something up with just a dictionary in c2 and that should be able to be translated to C3 and json if it works out.

  • I'd start from scratch. First off it uses the triangle3d plugin, which is older. The rojo3d plugin is better.

    Th 2d one transforms some points with two rotations, then projects them to to the screen. for the 3d you'd need to rotate by the same two rotations. Should be simpler with rojo3d, but i don't have time to create an example at the moment.

  • No raycasting or collision detection was added.

    A raycast could be done by finding the intersection between a ray and a triangle. Well, all the triangles (or less if a spatial partition is utilized) and just keep the closest. You just need the triangles of the mesh to be transformed to world space for each object. Currently that is done on the gpu, so it would have to be done on the cpu.

    In some cases you can do something simpler. Say you just have a heightmap you can query the z at some xy with an array or something. Like say you have the mesh made up in blender you can render the zbuffer from above and load that image to query zheight from pixels. Only 255 levels so it may be a bit coarse.

    Another idea is if you are just using primitive shapes you can do a raycast with signed distance fields (SDF). I made a simple C3 example of this somewhere. It could be useful in some cases.

    If you just need the position of a point on a mesh, you can position another object relative to a different one and you can get the transformed position from expressions. It's probably not what you're after though.

  • I say it's a valid complaint. Things shouldn't just silently disappear.

    In Construct 2 it alerted you when moving a variable to a different scope and it caused things to be removed. And moving a global variable to a group does change it's scope.

    However I tested it in Construct 3 r323 and it doesn't alert you. Sounds like a bug to me since it used to notify you in Construct 2. I guess it's always been that way in Construct 3 since I tested as far back as r100 and it still didn't notify you. It's probably just something they overlooked. I think there is a stickied topic on how they prefer to receive bug reports.

  • I put other. I always start with one sheet, then use functions, groups or other sheets to organize later.