R0J0hound's Recent Forum Activity

  • Looks like you’re creating the four objects in specific locations. You could compare the x and y to pick specific ones. You could give the object an instance variable and set the variable to something unique when you create it.

    Start of layout
    — create sprite at 100,100
    — sprite: set var to “left”
    — create sprite at 200,100
    — sprite: set var to “right”
    
    On clicked on sprite
    — sprite: var= “left”
    — — do something
    — sprite: var= “right”
    — — do something else
  • Had another look at getting cleaner formulas than what C3 uses internally and here we are:

    Looks like c3 rgb values are 10bit +1? alpha is 10bit. Anyways here's the conversions.

    red = round(int(-color / 2^38) % 2048 * 255/ 1024)
    green = round(int(-color / 2^24) % 2048 * 255 / 1024)
    blue = round(int(-color / 2^10) % 2048 * 255 / 1024)
    alpha = round(-color % 1024 * 255/ 1023)

    Tested with thousands of random colors and it works flawlessly so far.

    Note:

    C3's rgb expressions only return negative numbers which mean the colors are stored in 10bit per component, and works with the above formulas.

    If you're curious, positive values mean it's a color with 8bit per component color=r*256*256*256+g*256*256+b*256+a where each component is a value 0-255. C3 still supports colors like that but you'd have to generate them manually. Also you'd need different formulas to extract the components. However that's easily found online if needed.

  • I don’t believe so. Likely the waits are checked after the event sheet runs or something.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not really. You'd just need to pick your poison.

    Using sprites for everything is one way but picking isn't great to deal with when comparing different instances of the same type.

    You can avoid using the array plugin with text variables to some extent. To access data you need to parse the text. To modify the text you often need to rebuild it.

    Data plugins such as json or array are rather abstract but are useful if you can wrap your head around them. There may be other third party plugins that maybe are simpler? Anyways one pro about data plugins is avoiding using picking as much.

    Javascript can make it easier to deal with data but I guess that depends on what you're comfortable with.

    At a small scale I've seen just using a bunch of variables work too. But that tends to require more events.

    In practice I figure out what I want to do on paper first and how it should work. The last step is to figure out how to do it in construct using the least amount of features as possible.

  • Simplest would be to just make a tiled background of a grid and use that.

  • There's a third party 3d plugin that lets you load and rotate any 3d model.

    There's also a third party plugin that lets you rotate any object in 3d.

    You can also utilize distort meshes to do the rotation.

    Here is the only function you need to do rotation. Here it's just xy, but you can modify it to do xz or yz rotation. You can also combine them for a simplified expression.

    newX=x*cos(a)-y*sin(a)

    newY=x*sin(a)+y*cos(a)

    When using distort meshes the points xy position are defined in the 0-1 range so you'd map a layout xy to mesh with:

    meshX = (x-sprite.x)/sprite.width+0.5

    meshY = (y-sprite.y)/sprite.height+0.5

    The 0.5 is when the origin is centered.

    dropbox.com/scl/fi/o65y9e62zd2wmqko554ic/3d_card_flip.c3p

    To make the cards two sided it calculates the normal and does some math to see which side of the card is facing the camera.

  • You can do it with the qarp() expression.

    x=lerp(ax, bx, t)

    y=qarp(ay, (ay+by)/2-400, by, t)

    where ax,ay and bx,by are the two endpoints and t is a variable that you'd gradually change from 0 to 1 and vise versa to go back.

    In the example I just set t to a triangle wave that ping pongs from 0 to 1 and back with abs((time/duration+1)%2-1) since it matches your example.

    alternately you could just do set t to clamp(self.t+dir*dt/duration, 0, 1) where dir is -1 or 1, and the clamp avoids overshoot. You could then compare if t is 0 or 1 to see where it's landed.

    dropbox.com/scl/fi/zxa5wnncpmhyrovadxia0/jumpArc.c3p

  • The sprite's outline shows because it's drawn before the walls. To fix you need to somehow make it draw after the walls. I know 3d layers have a setting to do the drawing based on distance or zorder. Maybe try one of those. In the zorder case you can then set the sprite's zorder to bottom or something like that.

  • The light actually has its own frustum and it may very well be off. Ideally it contains the whole scene.

    But I’ll be honest here it’s unlikely that I’ll be doing any more changes to this plug-in any time soon.

  • How are you placing the dotted lines?

    It looks to just be nodes with a tiledbg stretched between nodes to make the lines.

    You could do an evert like this.

    On clicked on node
    Node overlaps line
    Pick all node
    Node overlaps line
    — Node var=5
    — — set text to “connected”
    — else
    — — set text to “not connected”
  • Fiddled with it a bit and here are my findings.

    There isn't a way to render a scene from a different camera angle in the same frame. If we could there is probably a way to calculate where we'd position the camera from the mirror. The second issue is the drawingCanvas doesn't work with 3d meshes since they have no zbuffer and it doesn't seem to transform 3d relative to itself. We could render one frame from the mirror, save that with canvasSnapshot, and render the next from the game camera, but that is slow and would flicker annoyingly.

    What we can do is duplicate the objects and position them in mirrored locations behind the mirror. We'd want the duplicate objects to only be visible in the mirror so one idea is to have the duplicate objects on a layer with force own texture and have a mask sprite over the shape of the mirror to limit drawing to that area. If all the duplicate objects are behind the mirror this should work fairly well. It will be a problem if any part of the objects are in front of the mirror since the masking will fail then. We can improve that by not duplicating objects that aren't in front of the mirror or culling by a view frustum through the mirror. Still to better fix it we'll need to clip the individual polygons by the mirror, but this requires all your meshes to be done with a distorted sprite per polygon.

    The masking sounds like it should work, and does in the simple mirrored floor case, but I'm curious if we may run into issues with wall mirrors or something.

    Anyways here's a semi-simple floor mirroring test by duplicating things.

    dropbox.com/scl/fi/tg6b00a8oeaiuwaaw7i5u/floor_mirror.c3p

  • Canvas doesn’t seem suitable for that. Try pasting 3d stuff onto it and see that it has no zbuffer so it looks wrong.

    Anyways I’ve seen people do mirrored floors by duplicating the 3d stuff below.

    Another guy did portals by using a mask and duplicating the 3d stuff behind the mask. He didn’t post an example though so you’d have to experiment in that area. It doesn’t seem like it would work but I admittedly don’t understand some subtleties of constructs renderer

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound