Physic Objects + Drag&Drop control

This forum is currently in read-only mode.
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • You should use Containers for that instead of Families. This is pretty much the sort of thing they were made for.

    http://sourceforge.net/apps/mediawiki/c ... Containers

  • Okay, thanks, we switched to using containers and put all the bodyparts in one. As far as I understand the concept of containers, if I spawn one object of the container, the other ones get spawned automatically as well. The problem is, that hinges which I defined for bodyparts earlier at the start of the layout seem to get ignored and the bodyparts are spawned un-hinged (and still at the very same coordinates they are in the layout editor as well). Any idea what we're doing wrong ?

    http://www.oinobareion.at/~hullux/undersiege.0.01.cap

    Also, since we started including sounds, is there any quick-and-easy solution to play a sound once (and only once) when a collision between objects happens ? (On collision with object => xaudio2 autoplay sound starts like ten different instances of the same sound, probably because the collision seems to last for a while)

    cheers

    barneygumble44 & der_luemmel

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:d3spc1aa]The problem is, that hinges which I defined for bodyparts earlier at the start of the layout seem to get ignored and the bodyparts are spawned un-hinged (and still at the very same coordinates they are in the layout editor as well). Any idea what we're doing wrong ?

    That is normal. When you spawn a contained object, the other objects in the container will be created at their default location in the layout. You still need to move those objects to their proper spots and make hinges for them. Just make sure you have those actions in the same event as the one where you spawn the primary object and they will automatically be picked.

    As for the sound issue, maybe you could make a variable called "playSound" in your objects or something. Make it a very short timer. When the objects collide, check to see if the timer is going. If not, play the sound and set the timer. If the objects collide again before the timer runs out, don't play the sound and set the timer to start over again. That should take care of objects that are "rubbing" against each other.

    Better solution, maybe:

    You could make the sound play based solely on the amount of force that the objects hit each other at. If two objects are just rubbing up against each other then the force would be very low. If they strike each other at speed then the force would be much higher. You could find a value in between and use that as a cutoff point. Here's a thread on how to calculate the force of two physics objects hitting each other:

    Be sure to read the whole thing, I got the calculation wrong and Davioware posted the correct one.

  • thx again

    we now moved every object to the proper spot and then created the hinges...

    http://www.oinobareion.at/files/undersiege.0.01.cap

    but as you can see, the knight falls apart right from the beginning. It seems that the thing with the hinges doesn't work

    any ideas?

  • I don't know, I'm tired .

    I'm gonna go have a nap. How about you mess around with it a while and see if you can come up with a workaround? Maybe do some experiments and see what's going wrong. Who knows, it might be a bug or something. Or maybe not. Anyway, it's nap time.

    *yawn* G'night. Catch you later.

  • Hi deadeye

    We really appreciate your help! After thinking about the whole thing again, we decided to change our concept a little bit. In the current version the soldier is attached to a gibbet that appears as soon as the three cannonballs are wasted. The gibbet, as well as the soldier fade in. When the soldier collides with a castle element, he fades out and a new soldier appears under the gibbet. Or at least, that's what it should do. When you take a short look at our project, you'll see that there is a problem: the soldier doesn't fade out correctly, only parts of it. And as a result of this, the new soldier doesn't get spawned. There must be some kind of logical issue in the event sheet "es_gameMechanics" - but we can't figure it out. Can you help us?

    http://www.oinobareion.at/files/undersiege.0.01.cap

  • Hi deadeye

    We really appreciate your help! After thinking about the whole thing again, we decided to change our concept a little bit. In the current version the soldier is attached to a gibbet that appears as soon as the three cannonballs are wasted. The gibbet, as well as the soldier fade in. When the soldier collides with a castle element, he fades out and a new soldier appears under the gibbet. Or at least, that's what it should do. When you take a short look at our project, you'll see that there is a problem: the soldier doesn't fade out correctly, only parts of it. And as a result of this, the new soldier doesn't get spawned. There must be some kind of logical issue in the event sheet "es_gameMechanics" - but we can't figure it out. Can you help us?

    http://www.oinobareion.at/files/undersiege.0.01.cap

    Tried your cap and it just comes up saying congratulations on to the next level, then quits. And part of the catapult thing is spinning around incredibly fast.

    Edit: Nevermind, fixed it.

    Errr.. redo it and use groups?

  • hello again,

    we are now able to present a first prototye of our game...

    http://www.oinobareion.at/files/finalgame_scirra.exe (~12MB, version without sound)

    thanks for your help, especially to 'deadeye'

    we would be very happy about some feedback. there are some bugs that we still deal with, but at least it is playable...

    let us know, what you think.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)