R0J0hound's Forum Posts

  • pick by uid can pick the new objects at any time. It is the exception to the rule.

    Functions and "on created" are run as if they were placed where the object was created or where the function was called. So no, they are not top level. For example:

    this:

    +-------------------+
    | on function "move"| sprite: set x to self.x+32
    +-------------------+
    +-------------------+
    | on sprite created | sprite: set opacity to 50
    | pick all sprite   |
    +-------------------+
    +-------------------+
    | start of layout   | create sprite at (0,0)
    |                   | call function "move"
    +-------------------+[/code:rahmbimr] is the same as this:
    [code:rahmbimr]+----------------------+
    | start of layout      | create sprite at (0,0)
    +----------------------+
       +-------------------+
       | pick all sprite   | sprite: set opacity to 50
       |                   | sprite: set x to self.x+32
       +-------------------+[/code:rahmbimr]
    
    For the case of needing to do something to all the instances right after a new instance is created I usually use a   variable or a group that i set or enable when i need to do something.
    
    global number zsort=0
    
    sprite: on created
    --- set zsort to 1
    
    start of layout
    --- create sprite at (10,10)
    
    zsort=1
    --- sprite: sort
    --- set zsort to 0
  • Have you tried re-uploading the images?

    when i go to the image url with the browser the image doesn't show.

    http://snya.comxa.com/test4/images/sprite-sheet0.png

  • The main issue is sprites can't be skewed. So without third party plugins the best you can do is fez like rotations:

    Of course you may be able to do an isometric view with lots of animations of the the cube rotating.

    Alternatively you can skew images with the paster plugin. You can look here:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not really a bug, it's just doing it how the javascript % does it. Also apparently there isn't a consensus in the computer world what % should exactly do when one of the values is negative. See here, the sign of the result varies depending on the language:

    https://en.wikipedia.org/wiki/Modulo_operation

    For an always positive remainder you could do one of these:

    (a%b+b)%b

    a-int(a/b)*b

  • A quick way would be to use a variable like this:

    global variable once=0
    
    on collision
    once=0
    --- set once to 1
    --- do stuff
    
    every tick
    --- set once to 0[/code:239878ee]
    
    That way you'd only get one event per tick on that object type.  Actually you'd want an instance variable instead to have one collision per instance per tick.  Or if you wanted only one trigger per pair of instances you could use a dictionary to keep track of it like:
    
    [code:239878ee]on collision
    X dictionary: key exists min(sprite.uid, sprite.chipmunk.otherUID)&":"&max(sprite.uid, sprite.chipmunk.otherUID)
    --- dictionary: add key min(sprite.uid, sprite.chipmunk.otherUID)&":"&max(sprite.uid, sprite.chipmunk.otherUID)
    --- do stuff
    
    every tick
    --- dictionary: clear[/code:239878ee]
    
    I do not know if the chipmunk library has anything to help with that.
  • https://dl.dropboxusercontent.com/u/542 ... rsect.capx

    dist = distance between centers

    ang = angle from one center to the other

    Then from the first center you move r0 pixels at angle ang+acos((r0^2 -r1^2 +dist^2)/(2*dist*r0)) to get to the left intersection point. You can also use -acos to get the right intersection point.

  • That doesn't make sense. What in particular are you looking to solve with that diagram?

    Is P0 the player and P1 the enemy and you want to find p3?

  • lolpaca

    Look here for a visual of what they are. You can ignore the math.

    https://en.wikipedia.org/wiki/B%C3%A9zier_curve

    The curves made of 3 points are the "quadratic curves" and 4 points are the "bezier curves".

    The first and last points are the end points and the points in between are control points.

  • If the pixelate effect is getting broken on export then, yes report just that. Don't include the outline effect in the report, since third party stuff can't be in bug reports. If it gets fixed then the outline effect will likely be fixed as well.

  • Oh wait, I had the logic reversed. You want it to loop as long as either of the variables is 0, and my example only stops when one of them is zero. Add an "else" to fix it.

    +--------------+
    | while        |
    +--------------+
       +-----------+
       | trueA = 0 | set trueA to 1
       |   -or-    | set trueB to 1
       | trueB = 0 |
       +-----------+
       +-----------+
       | else      | stop loop
       +-----------+[/code:2lvl4d64]
  • The version this was changed:

    https://www.scirra.com/construct2/releases/r102

    A discussion about it with input from ashley:

    r102-breaking-change-questions_t73647

  • Here's a way you can structure it. Basically make the while and infinite loop and use the "stop loop" action to stop it.

    +--------------+
    | while        |
    +--------------+
    |  +-----------+
    |  | trueA = 0 | set trueA to 1
    +--|   -or-    | set trueB to 1
       | trueB = 0 | stop loop
       +-----------+[/code:n47tyopg]
  • Mithrill

    That has been mentioned before I think. I think it's related to export in general, but I can't test on my machine since I can't use webgl. Best I can tell the pixelwidth/pixelheight variables that C2 provides to shaders is giving different values on export.

    Try the same test you did with this effect on the pixelate effect since it also uses those variables. If the results are different then that would make a good bug report since it involves only vanilla C2. If the results are the same then the problem is with how I used the variables in this shader, but I don't see the issue.

  • alextro

    Haha, thanks for pointing that out. I typed that too fast and spellcheck let me down.

  • There are three lists internally:

    Instance list

    New list

    Sol list

    By default the sol list will be the instance list, which you then filter. When you create an object it's added to the new list and the sol is set to it. The pick all sets the sol to the instance list and since the new list isn't added yet those objects aren't picked. Then at the next "top level" event the new list is merged into the instance list.

    You can search the forum for "top level" for some more discussions/explanations of this. In one of the change logs had a fix where before "pick all" would pick the new ones too. This was fixed to prevent cases of infinite loops.

    Alternatively the pick by uid can pick objects from the new list. It's the exception to the rule.