Santhenar's Recent Forum Activity

  • Haha, thanks so much!

  • I want to set the default layer for when I drag objects into the layout.

    I had it set earlier but I can't remember where the option is :S

    Cheers!

  • Hi!

    Capx file here:

    www1.datafilehost.com/d/00c621cc

    So I have a cat with a tail, the tail is made of segments joined together by the Pin behaviour. I want to be able to add segments to the tail at runtime, but I'm not too sure how to go about it.

    The problem is that each segment has to be correctly pinned to the preceding segment, so the code has to be able to identify how many segments there are... I suppose I could use the count functionality to determine the number of instances and then use an asston of IF statements to determine where to add the segment.

    A further problem is adding the segment in the right place, the best way to do this is to call the "create object" function from the preceding segment and then attach the new segment to an image point. But I'm not sure how to make that work correctly at runtime no matter how many segments you already have.

    Any help would be great!

    And feel free to use the tail script for whatever, it's not perfect but I'm pretty pleased with how it works.

  • Thanks, I think I've found a workaround for my original problem, but the reason I don't want to use IF statements is as follows:

    What I'm doing is setting a value AngleOfMotion which dictates the movement of an object. I want to set AngleOfMotion each tick using the variables AngleOfMomentum and AngleOfGravity. So what I want is for AngleOfMotion to start off as AngleOfMomentum and then move towards AngleOfGravity. But there are constantly random forces acting on the object which change the AngleOfMomentum, so I'm basically trying to figure a way to get an object to fall in a natural arc, but still react to any forces applied to it. Without using built in physics (they <img src="smileys/smiley35.gif" border="0"> everything up).

    And I confuse myself just thinking about it :P

    So I suppose what I was looking for was:

    AngleOfMotion = (Half way between AngleOfMotion and (Half way between AngleOfMomentum and AngleOfGravity))

    That's where it starts to get complex.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi again mathemancers!

    Okay so I need to normalize a variable.

    i.e. I have variable X and variable Y, and I want Y to always tend towards X. So if Y is greater than X, reduce Y. And if Y is less than X, increase Y.

    Normally I would of course do this using IF statements, but that's kinda infeasible (or unreasonably complicated) for what I'm currently working on and I'm really hoping there's a maths algorithm than can be used here.

    Cheers!

  • I've managed to get it working pretty nice with my own little physics system, the tail flows about and flaps in the breeze like a scarf.

    The only problem left is gravity. Just moving each node of the tail towards the floor doesn't work properly.

    I need to... I need to add a gravity function to my custom physics thing. Yes that's what I need to do. But how would I do that. Currently it takes an angle of motion and a velocity to work out momentum. What I ideally want is for the angle of motion to slowly move towards 90 degrees (downwards), that way things will fall in a realistic arc. And when the angle is below the horizon I need the velocity to increase rather than reduce.

    Hmmm.... . .. . ... .. . .. . . . . . ..... . . .   

    The problem is that currently the angle of motion is set every 0.00001 seconds, so it can't gradually change. I guess I'd need a separate variable for the angle of momentum which would affect the angle of motion. So the angle of motion would take in the effects of gravity alongside momentum.

    Hmmm... I think maybe I need some coffee.

  • Maybe... Maybe if each node of the tail had some momentum variables such as speed and angle, and used that for movement.

    But how would I calculate their momentum? Perhaps take a snapshot of their position each tick, and compare to the position next tick, then use this to calcuate their velocity and angle of motion, then move them accordingly.

    hmm... I'll give it a go.

  • Additional note:

    I have tried to use limited rotate joints but that either makes the tail stiff, spasm-ey, and still heavy and clunky. And I know there is a 'Mass' option in the physics properties, it just doesn't seem to do anything?

  • Hi everyone!

    Today I am trying to make a character with a tail. I want the tail to flow realistically and follow the movement of the character.

    So far I have done this by making the tail a series of nodes pinned together using the Rope style Pin functionality. This looks very nice, but I also want the tail to have physical properties, I want it to have momentum and gravity. (Most importantly to fall and trail along the ground)

    However using the built in physics gives me some really messed up results. The tail twitches and spasms and actually pushes the player around. Plus it feels as heavy as a sack of sand. I can't find a way to actually adjust physics properties such as mass and gravity for specific objects, which seems a rather gross oversight.

    So I guess my question is... how can I give the nodes of my tail mass and momentum?

    I'm just looking for any neat ideas that people may have!

  • Mon dieu!

    Changing the order appears to have fixed it! Fingers crossed, but you may be some kind of wizard, because I was sure I had already tried this.

    But yes, all seems fine now!

    I shall toast to your health!

    fo'serious.

    All I need now is to make the gates spawn the correct distance away from the player and I'm pretty much done!

  • Hi everyone!

    I've set myself a mini challenge to create a game within a short space of time. Specifically, I won't be sleeping until it is complete.

    I've been working on it for about 12 hours now, and I'm almost done, but my brain is a little frazzled.

    Anyway, I need some help. I have a system whereby the player moves through a 'gate' and must be pushing a specific button as they pass through the gate. Like a rhythm game, a'la guitar hero or Marvin Spectrum.

    The problem I have is that it works really intermittently. The score is supposed to increase when you press the correct button when going through the right kind of gate, but sometimes it does and sometimes it doesn't. More often than not it doesn't. There doesn't seem to be any rhyme or reason to it either, you can get several of the same gate type in a row and it will work on some but not others. I'm at a loss...

    Here is a pic of the code that governs this process:

    i.imgur.com/wVCqWRF.png

    Help meeeeee, I'm so close, then y'all can play it!

  • Although there is something I'm still struggling with...

    So in your

    x = h * cos (a) + c_x

    y = h * sin (a) + c_y

    formula, (a) is the angle of the circle. But what if I want it (a) to be relative the the position of an object on the edge of the circle. So if object (o1) is at 270 degrees, then I want to place object (o2) at 300 degrees. But if (o1) is at 300 degrees, the I want to place (o2) at 330, and so forth.

    Ok, so do that I need to be able to calculate the current angle (a) of object (o1)... Bearing in mind that the circle itself is rotating as (o1) rotates around it. Ummm.... Can I do that?

Santhenar's avatar

Santhenar

Member since 24 May, 2013

None one is following Santhenar yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies