R0J0hound's Forum Posts

  • Sub events are only run when their parent event runs. Anyways here it matters because or the else’s. An event with an else will only run if the event on the same level above it doesn’t run.

  • Make event 9 a sub-event of event 8 and it works.

  • Well the input events are run top to bottom.

    You have it so if you tap on either red circle it closes the menu, then third event runs because it’s not tapping on anything.

    I thought maybe rearranging the events would be an option but that causes the menu to be instantly destroyed so you don’t see it.

    But here’s this for a solution. Have one on tap event and have it do just one thing depending on what was tapped on.

    on tap
    -- touch is over sprite1?
    -- -- close menu
    -- else
    -- touch is over sprite2?
    -- -- close menu
    -- else
    -- — close menu
    -- — create menu
  • Cool that you reposted it.

    I’ve replied to topics before only to have the topic later deleted. Which is kind of a bummer especially if the reply was detailed.

  • My apologies then, I’m not really being helpful with the request.

    I just work around stuff.

  • Cape/cloth physics is much like rope physics. Basically it’s made of a bunch of point that have velocity and fall with gravity. Then you keep track of the distances between pairs of points, and move them closer toward each other if they are too far away.

    Anyways one way is to use the physics behavior and connect them together with joints.

    Another is to use event based physics. Look up rope or cloth physics for examples.

    In c2 you have a third party plugin like paster to distort the image. Or you can just fake it with sprites.

    As far as the simulation itself you’ll just have to tune parameters. Maybe more air resistance or less gravity. A more elaborate sim might do the physics in 3D, or limit not only the distance between points but the bending angle. Also another idea is to make the air drag depend on the angle of the parts of the cape, probably a lift/drag model like planes use. Finally adding collisions with the player or with other parts of the cloth itself could look cool. It just depends how deep you want to go.

  • A lot of browsers have an option to disable webgl2 so you can utilize that for easy testing on your system.

    To make the export use just webgl1 you can edit the runtime after exporting. Just look for .getContext(“webgl2”) and remove the 2.

  • Yea, I’m pretty sure that was where the NaNs come from.

    Glad the idea works

  • With 3D the mouse plugin and probably touch will give you a point on the 3D ground plane. This isn’t always useful though.

    Typically you’d want to add a 2d layer and grab the mouse/touch from that so you get standard 2d values.

  • It’s system->compare two values

    With loopindex as the first value and 1 as the second.

  • I’ve found wait 0 is more like, run at the end of the event sheet.

    You can test that with something like:

    Var prev=0
    Every tick
    — set prev to tickcount
    — wait 0
    — subtract tickcount from prev
    
    Compare: prev =0
    — set text to “same tick”
    Else
    — set text to “another tick”

    And yes, wait should pass the selected object list to when it’s done.

  • Interesting. So the on timer event is more a fake trigger since it picks all the done triggers at once. I think I’ve seen that before but honestly I seldom use that behavior.

    Anyways, the on timer and on game pad press are more exemptions to the rule than consistent with what most other things do.

    I guess the manual could be more explicit about it but I’d wager it’s more an oversight than anything.

    I think I found out about those things with some tests when helping someone debug something that wasn’t working correctly. It’s mostly a subtlety that’s not always an issue.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Besides using browser.log() you can use sprite.pickedcount to see how many objects are picked.

    In general I assume most triggers just have the one relevant object picked at a time. “On created” for example will be run for each object you created. So no for each needed in triggers.

    Ultimately the plugin/behavior could be made to pick multiple instances at once but I can’t think of any examples. Are there any that don’t stick to the standard?

    Triggers are like functions, they will be jumped to. But there is something called a fake trigger that’s used sometimes that looks like a trigger but is run in place.

    “Keyboard: On key pressed” is a trigger.

    “Gamepad: on button pressed” is a fake trigger, which is the same as:

    Game pad: button down

    Trigger once.

  • If the tile size is 32x32 you can do it with the following. Basically the horizontal distance plus the vertical one. It’s called Manhattan distance after the city.

    int(abs(Player.x-goal.x)/32)+int(abs(player.y-goal.y)/32)

  • For the view, you just need to change the 3D camera angle. But if I pick this up again at a later date it can be made to have a different sloped ground and direction of gravity to make change the view of the dice.

    To have two dice? Hmm... right now it’s not very modular. One way would be to clone all the object types and make the cloned instance have the same values in the instance variables. Then duplicating all the events and using the replace object feature to make the duplicated events use the cloned objects.

    Even then the two dice won’t interact with each other without further collision code.

    In general I just need to revisit this eventually and make it more modular.