R0J0hound's Forum Posts

  • Without imagepoints you'll need 3 variables. Two for the positional offset from the center of the parent object and one for the angle difference.

    For the positional offset you can either save it in rectangular (x,y) or polar(angle, distance) coordinates.

    For rectangular:

    every tick:

    --- set child position to parent

    --- child: move child.dx pixels at parent.angle degrees

    --- child: move child.dy pixels at parent.angle+90 degrees

    --- child: set angle to parent.angle+child.angdiff

    For polar:

    every tick:

    --- set child position to parent

    --- child: move child.dist pixels at parent.angle+child.ang degrees

    --- child: set angle to parent.angle+child.angdiff

    To calculate the offset it's probably easier to use polar.

    set child.ang to angle(parent.x,parent.y,child.x,child.y)-parent.angle

    set child.dist to distance(parent.x,parent.y,child.x,child.y)

    set child.angdiff to child.angle-parent.angle

  • As it is C2's renderer doesn't let you pass anything but numbers to shaders.

    There are a lot of other values that you can pass to webgl in shaders, including lists of numbers, textures and even lists of textures.

    http://webglfundamentals.org/webgl/less ... -glsl.html

    [quote:24fpga9v]gl.uniform1f (floatUniformLoc, v); // for float

    gl.uniform1fv(floatUniformLoc, [v]); // for float or float array

    gl.uniform2f (vec2UniformLoc, v0, v1); // for vec2

    gl.uniform2fv(vec2UniformLoc, [v0, v1]); // for vec2 or vec2 array

    gl.uniform3f (vec3UniformLoc, v0, v1, v2); // for vec3

    gl.uniform3fv(vec3UniformLoc, [v0, v1, v2]); // for vec3 or vec3 array

    gl.uniform4f (vec4UniformLoc, v0, v1, v2, v4); // for vec4

    gl.uniform4fv(vec4UniformLoc, [v0, v1, v2, v4]); // for vec4 or vec4 array

    gl.uniformMatrix2fv(mat2UniformLoc, false, [ 4x element array ]) // for mat2 or mat2 array

    gl.uniformMatrix3fv(mat3UniformLoc, false, [ 9x element array ]) // for mat3 or mat3 array

    gl.uniformMatrix4fv(mat4UniformLoc, false, [ 17x element array ]) // for mat4 or mat4 array

    gl.uniform1i (intUniformLoc, v); // for int

    gl.uniform1iv(intUniformLoc, [v]); // for int or int array

    gl.uniform2i (ivec2UniformLoc, v0, v1); // for ivec2

    gl.uniform2iv(ivec2UniformLoc, [v0, v1]); // for ivec2 or ivec2 array

    gl.uniform3i (ivec3UniformLoc, v0, v1, v2); // for ivec3

    gl.uniform3iv(ivec3UniformLoc, [v0, v1, v2]); // for ivec3 or ivec3 array

    gl.uniform4i (ivec4UniformLoc, v0, v1, v2, v4); // for ivec4

    gl.uniform4iv(ivec4UniformLoc, [v0, v1, v2, v4]); // for ivec4 or ivec4 array

    gl.uniform1i (sampler2DUniformLoc, v); // for sampler2D (textures)

    gl.uniform1iv(sampler2DUniformLoc, [v]); // for sampler2D or sampler2D array

    gl.uniform1i (samplerCubeUniformLoc, v); // for samplerCube (textures)

    gl.uniform1iv(samplerCubeUniformLoc, [v]); // for samplerCube or samplerCube array

    Some of those could be useful additions to request.

    To do it without official support could be very tricky.

    In webgl/js if you compile a shader you first need to get the variable location in the shader with something like:

    var offsetLoc = gl.getUniformLocation(someProgram, "u_offset");

    Then you'd set the uniform before drawing using one of the functions listed above.

    So basically it's rather simple in just javascript, but you can't do that for C2 since you need it to work with the runtime's batch renderer to get the effect to be applied to anything else the runtime draws. Modifying the batch renderer isn't trivial and is best left to be done by Scirra since a lot of other things in the runtime and editor would need to be done to accommodate it.

    You could just do your own webgl renderer in a plugin to render to a texture that c2's renderer could then draw, but I haven't had much luck in the past grabbing what's already been rendered to modify.

  • Savvy001

    It's an issue with this plugin. Speciffically it has to do with pasting stuff that has effects. C2's runtime has had updates with it's webgl renderer and I haven't kept up since my pc doesn't use webgl currently.

    crugh

    It only does png currently, but here's how to change it to do jpeg instead if you wish.

    Open paster's runtime.js, then find

    canvas.toDataURL()[/code:3o99y0qo]
    and replace it with:
    [code:3o99y0qo]canvas.toDataURL("image/jpeg", 1.0)[/code:3o99y0qo]
    Where the "1.0" is the quality from 0.0 to 1.0.
    
    @Cipriux
    "quad" is just short for quadrilateral.  All the "draw quad" action does is let you specify the coordinates of the four corners of a quad to draw. It indeed lets you draw a image in a distorted way, but a perspective transformation isn't one of them.  Look at previous pages in this topic for examples.
  • rekjl

    I think he's using construct classic, not construct 2.

    pillaystation

    By default the xaudio2 plugin is not global so it gets destroyed when the layout ends.

    Make the object global (It's an object property) so it won't be destroyed when the layout changes.

    If you do that you next need to make sure there is only one xaudio2 instance. The usual way is to only have it in the first layout your game runs and on none of the other layouts.

  • One way could be to compare the x positions of the colliding objects.

  • I've not encountered that.

    Is the dictionary on the current layout you're editing?

  • Not Unity. Since it says it was done with the help of bitfrost, it probably uses their engine:

    http://www.bifrostent.com/#technology

    The PSP and PS4 ports of their engine are likely kept to themselves due to a NDA with Sony.

  • This plugin should help:

    Basically you'd take the change of the mouse's position and multiply it by some sensitivity value to get the amount to move the sprite cursor.

  • It can't still be made in construct classic if it runs on ps4. Construct classic is windows only. It looks to be reimplemented from scratch by bifrost entertainment.

  • The analyzer expressions of the audio plugin would be a good place to start looking. I haven't messed with it at all so I don't have any more knowledge beyond that.

    I second the recommendation to just ask the player the gender. Forcing the player to say his name has two issues. One, it makes your game unplayable for players with no microphone. Also unless the game uses the microphone as part of the game mechanic it would be out of place.

    Second you risk angering the player if you guess their gender wrong.

  • Since Construct classic isn't being developed anymore the most you can do is work around it.

    In all the time I've used Construct I've never encountered that error, so it's likely rare.

    Try:

    Re-opening construct.

    Rebooting.

    If it happens a lot you'll have to identify a cause and then change your project to not do that.

    My only shot in the dark idea for the cause could be you've run out of video memory. If you use a lot of big images it can be easy to do since the editor needs video memory and when you run the game it also needs video memory. But it's just a guess.

  • liquidmetal

    Imitation is the sincerest form of flattery. That said, it was also thought to be a of clone to Construct Classic. You can find a topic discussing this on these forums. It turns out as I recall that both projects are about as old as each other and Gamedevelop's author was unaware of Construct when he was first making it. But regardless I don't see an issue, ideas aren't copyrighted, and if it's a good one then why not use it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a few other miscellaneous experiments, some old, some new.

    https://www.dropbox.com/s/jnjcxc6hb8wu4 ... .capx?dl=1

    /examples28/boom.capx

    This is an attempt at a type of explosion. I was shooting for the look of a mortar explosion.

    No behaviors used. One interesting bit is I used a drag force on the particles that's based on their speed and size which allowed smaller particles to travel farther than the big ones which gave a nice effect.

    https://www.dropbox.com/s/36fg2ook2g085 ... .capx?dl=1

    /examples28/parser.capx

    A simplish calculator that parses and evaluates a typed equation. It tells you what's wrong if the equation is invalid. I never cleaned it up so it has a lot of debug stuff in it.

    https://www.dropbox.com/s/lchsartewcoo3 ... .capx?dl=1

    /examples28/event_physics3.capx

    An endeavor to implement physics for boxes without any behaviors. It's a constraint based solver based on some online guides. It's not perfect, but I learned a few things with it.

    https://www.dropbox.com/s/bhz8rpwuuq8j6 ... .capx?dl=1

    /examples28/voxel_isosurface.capx

    This generates a voxel isosurface that you can rotate a bit for a 3d illusion. There's some commented out stuff for other shapes but I never updated it to work right with the latest changes of the capx. Left click destroys it.

  • It could be webgl related perhaps? Not sure, I don't use webgl currently.

    It possibility could be that the timing of when c2's canvas is copied is when the canvas is between redraws when it's cleared? That's my only guess and it could be entirely wrong, also when I've looked into a solution in the past I've not had much success.

    A third possibility is no value is ready when invoking a download at that moment. Just a thought and since the built-in snapshot action has a "on canvas snapshot" condition, it may be a possibility. An idea could be to assign the last line of the script to a global var, and in events and then every tick check if the global is set before saving it.

    But taking a step back it may help to just use the snapshot action, since that is known to work.

    Here's how:

    https://dl.dropboxusercontent.com/u/542 ... pshot.capx

    use low quality fullscreen scaling

    set the canvas size

    zoom out the layout so the same stuff is seen.

    wait 0 so c2 has a chance to adjust the layout

    scroll to the center

    take snapshot.

    Then after the snapshot set everything back to what it was.

  • Edelplastic

    I think I didn't explain it well. Here is what all the parameters of the "draw line" action should be. I just used the standard names of objects to make it more clear.

    sprite.x-canvas.x

    sprite.y-canvas.y

    mouse.x-canvas.x

    mouse.y-canvas.y

    "rgb(0,0,0)"

    2