Wertle's Forum Posts

  • You can sort of do what you want with families (put the object in a family and then do Object is overlapping Family), however you'll still run into the problem with this in a loop, because the sprite that was just created isn't available yet when the event to do the overlap check is called.

    I would have thought that using the Object's "on created" event and doing the collision check in there would have worked, as I assume when that event fires then you are guaranteed that the sprite exists. However, when I did a test, it only partially worked. Perhaps it isn't guaranteed to be put in a family before the "on created" event fires?

    storage.wertle.com/construct2/Overlapping%20issues.capx

  • lunarray

    Works like a charm! Thank you!

  • Good to know, thanks!

  • Hello! I'm having some trouble with this behavior that could be just me misinterpreting how it works.

    I'm using it to tween the height of a sprite based on another instance variable, but the resulting height of the sprite does not match up with the target height that I set in the event sheet.

    .capx here: storage.wertle.com/construct2/LiteTweenIssue.capx

    Basically you steer the red block to pick up purple blocks, then go over and drop them in the bucket. Then I tween the meter, setting the target height to be the number of things the bucket contains.

    However, the resulting height of the tween is not the target height, so I'm a little confused as to where it is getting its target height. Please advise!

    (as a side note, I tried to print the LiteTween.Target property and got a js error in Chrome, i left the line in but disabled it if you want to see)

    EDIT: Notice that if you change the tweened property to Size it seems to scale as expected, but if you use Height, it seems to scale up an arbitrary number that is not related to the set target value.

  • Is there a way to do a mixed and/or condition? Such as...

    (condition a and condition b) OR condition c

  • Do you have a .capx you could share? It might make it easier to devise a solution to see exactly how you're spawning things.

  • You could assign your sprites an instance variable based on where they spawn (like sprites that spawn at this cluster get ClusterID=1 or something).

    Then you could have an event that picks all the sprites with a certain instance variable, and you can use the expression Sprites.PickedCount to get how many of them there are.

    Would something like that work?

  • Is it possible that the array is getting re-initialized in the common event sheet when the new layout is loaded?

    I'm doing some things with global arrays but I haven't gotten to the point yet where I'm reading from the non-layout event sheet. When I get to that I'll keep an eye out for this!

  • I realize that, but it was just for a structure example, not a functional example.

    In a real case it would be for wanting to perform an action when you are assured that the loop has finished, so for example if you were looping through something to initialize a bunch of things, and then wanted to do an action only when you were certain everything had been initialized.

  • Thanks!

  • Hi, I just want clarification on event order in the case of events that follow a loop. If you have an event just after a loop, does it only run when the loop has completed for that frame? Or does it run the same frame that the loop began?

    For example, in this case, will the "trigger once" event ONLY run when "SomeLoop" has completed?

    <img src="http://storage.wertle.com/construct2/loopquestion.PNG" border="0" />

  • Here's mine: 10-second Dragon Feeder.

    ludumdare.com/compo/ludum-dare-27

    I'll be sure to go through and play all of these after work today!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!

  • Here's an isolated case that I threw together. When the ball hits the pink surface, I want the ball to behave as though the surface absorbed its shock, so slow it down, yes.

    So are you saying that I should manually set the ball's velocity on collision with the pink surface?

    storage.wertle.com/construct2/Example.capx

  • I feel like this is a simple question and I'm just searching for the answer incorrectly.

    I'm making a physics puzzler where different surfaces do different things to a falling/bouncing object.

    I've got surfaces that bounce it away and surfaces that launch it like a speed boost, but the one that's giving me trouble is a surface that slows down the object when it hits, kind like a sticky wall or some kind of shock absorber. I wasn't sure what settings I needed to adjust and if I needed to adjust them on the surface object or the bouncing object or both, and playing around with various numbers in the objects wasn't getting me anywhere.

    Do I need to do something to the bouncing object on its collision with the sticky surface in the events?