PantuTheDog's Recent Forum Activity

  • Thanks for the push in the right direction bloodshot! Searching for how to use the 'pick nth instance' has led me down a trail of discovery (even if your reply didn't on its own solve my problem).

  • Apologies if the title doesn't make it very clear what I'm trying to do. I haven't been able to find an answer to this question anywhere in the forums or the manual, and no doubt part of the reason is because I can't figure out how to phrase exactly what I'm trying to do. I'm sure it's possible though.

    Basically I have lots of instance of a physics object (let's call it PhysicsLine), which is in the shape of a line. I already have it set up so that some instances of PhysicsLine are connected together by limited revolute joints, to create what looks and acts like a chain of lines, or like a string. On screen there can be multiple such 'chains' or 'strings' which are not connected to each other. As part of acheiving this I have an instance variable in PhysicsLine called 'LineSection'. Every instance of PhysicsLine which make up one 'chain' or 'string' shares the same value in 'LineSection', and only instances of PhysicsLine which share the same value in their 'LineSection' instance variable end up connected to each other.

    What I want to do is tell the game to disable physics collisions between all instances of PhysicsLine which share the same value in their 'LineSection' instance variable. But I can't seem to figure out how to get it to select, say, only the instances for which LineSection = 1, and then in the action 'Disable Physics Collisions with PhysicsLine' have it also know to only select instances of PhysicsLine for whic LineSection = 1.

    This is a problem I'm having in this particular scenario, but it's a more general problem I've often run into. Is there a general trick I'm missing to getting Construct2 to filter an object type down to a select few instances, and then have those instances interact with another filtered down group of the same object type?

    Anybody's help would be very, very much appreciated! I feel like my ability to program lots of things would be vastly improved if I knew how to do this.

  • Thanks blackhornet, I'll give this a go. But what do you mean by 'temp'?

  • Ok so perhaps the subject didn't quite fully explain what I'm trying to do here.

    Basically, I have no problem filtering one object type down to some specific instances and then filtering another object type in the same event, and then performing an action relating only to those two sets of instances. eg:

    If object type 'block' has x position greater than 100, and if object type 'block2' has x position less than 100, THEN change 'block' sprite to 'sprite 2' and change 'block2' sprite to 'sprite 2'.

    In this case the action will only trigger if both conditions are true, and when it does trigger it will ONLY affect the instances of 'block' and 'block2' which were filtered by the conditions.

    My problem is trying to get scenarios like the following to work:

    If object type 'block' is overlapping a point 'block x, block y - 10', then check to see if 'block' has it's 'clearabove' instance variable set to 'true'. If it does then set 'block's instance variable 'clearabove' to 'true'.

    As you can see my problem is that unlike in the first case, where the two instances I wish to compare and filter are of different object types (and thus would not confuse Construct 2's object filtering system), in this case I wish to retrieve the value of an instance variable relating only to instances of 'block' which meet certain conditions (which I have highlighted as 'block') and then I wish to manipulate ONLY the instances of 'block' which meet separate conditions (which I have highlighted here as 'block'.

    I can't find any way to do this without Construct just treating all 'block's as one and the same and filtering them twice (once to see if they overlap the point, and another to see if their 'clearabove' instance variable is true), when really I want two separate filterings to occur. Kind of like filtering 'all people in the room' into 'girls' and 'boys', and then using the results of tests made on the girls to determine the actions that will be taken against the boys; as opposed to filtering 'all people in the room' into 'girls' and then filtering all of those into 'boys', resulting in no instances being selected at all.

    Does anybody know how I can go about doing this? It's been driving me up the wall!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've never tried to install a patch to Construct 2 before. Once I've extracted the files from the 7Zip folder how do I go about using them to get the debug window popping up in my games?

  • Thanks everyone. No-one's offered a perfect way to do what I need done yet, but Vtrik's suggestion should get what I need done for now, at least in a rudimentary way. It'll be fine for getting the ball to jump off surfaces in the right direction, but later in development I'll need a more precise way of calculating which side of the ball is touching surfaces so I can get it to gravitate towards the part of whichever surface it is touching, kind of like a ball of velcro rolling along velcro slopes.

    Still, a proper implementation in the next update of Construct 2 of the system being able to return the x,y co-ordinates for the point of collision would be very much appreciated. I'm sure it would come in handy for plenty of developers in a variety of conceivable situations.

  • Construct 2 is incredible! I can't thank you guys enough. I'll definitely be purchasing a personal copy as soon as I come into some money.

  • Hi Ashley. Thanks for all the work you've done helping develop Construct. Is there any possibility we could see a feature implemented soon that lets you check the point at which the extremities of two objects collide? I am currently developing a game which requires me to return the x,y position of the place at which two physics objects touch/collide, both of which have complex bounding boxes made up of several collision points.

    I can envision countless useful ways such a feature could be implemented into people's games. For mine I need to know the point of collision so that my character, which is a ball, can be made to 'jump' off of curved surfaces at a 90degree angle to them, but without knowing the point of collision it is impossible for me to assign a physics impulse on the ball away from the point of collision.

    Be the answer 'yay' or 'nay' I would greatly appreciate hearing back from you on the matter. Thanks a bunch!

    Tom.

  • Having a feature built into the next update that allows the system to return the x,y co-ordinates of where two objects are colliding would be phenomenally helpful for me!

  • In your example the position being detected is always the position BELOW the centre of the ball, which is fine when the surface on which the ball is rolling is perfectly flat, but as the angle of the surface changes such that the ball is now rolling up or down a hill (or even around a loop) I need to be able to detect the point on the edge of the ball which is touching the surface. Hope this makes it more clear!

  • Sorry, maybe I didn't make myself quite clear. It is necessary for me to know the x,y position of the point at which the Ball is touching whichever surface it is touching at that point in time. Knowing the x,y position of the ball isn't enough, because the x,y position of the ball will only tell me where the centre of the ball is; not the x,y position of the edge of the ball which is touching the nearest surface. For instance, if the Ball's co-ordinates are thus: Ballx = 100, Bally = 100, and the ball has a diameter of 20, and there is a flat surface directly beneath the ball on which it is rolling, then the point at which the physics collision is occuring (the point I need to know) would be something like x=100, y=110. However if the surface the ball is rolling on is NOT directly beneath the ball or is curved then figuring out the co-ordinates of this collision point is much more tricky for me.

    Is there no way Construct 2 can automatically return the co-ordinates of a physics collision between two objects; i.e the point at which they are touching?

  • Hello lovely people of the Construct 2 forum!

    I'm fairly new around these parts, and have just started developing my dream game which I am confident (and I hope not unduly) will be amazingly fun to play when I finish it. Think Sonic the Hedgehog meets Fez.

    Anyway, other than some basic experience with GameMaker when I was a young teenager programming is utterly alien to me, although having just completed a masters in philosophy I'd hope to think that solving logical problems is not. With that in mind I hope somebody out there can help me with the following problem:

    Basically I have a ball rolling on top of various sloped surfaces, all of which are physics objects. If the ball is BALL1 and the slope sprite which BALL1 is rolling on at this particular moment in time is SLOPE1, I need to figure out a way of determining the x,y co-ordinates of the bit of SLOPE1 which is closest to BALL1. i.e How do I figure out the position of the bit of the slope which the ball is currently touching? I'd love to go into more detail about why I need to know this but as somebody who is completely new to game development I'm still not familiar with how much of my 'concept' I should be making public and how much I should be keeping under wraps. The reason I need to know this is for a fairly integral gameplay mechanic after.

    Anyway, sorry I haven't given you much to go on in terms of letting you in on the actual end-result problem I need solving, but I'm confident that if anybody can help me with this specific mathematical/logical problem I'll be able to get the game to do what I need it to. I would treat whoever showed me the light with regard to this problem as I would somebody who had pledged me �1000 on Kickstarter. Really, without being able to figure this out I can't progress with development on my game. I will be eternally grateful to whoever can give me some guidance here!

    Thank you so much!

    PantuTheDog

PantuTheDog's avatar

PantuTheDog

Member since 8 Jul, 2013

None one is following PantuTheDog yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies