Physic Objects + Drag&Drop control

For questions about using Classic.

Post » Tue Jan 12, 2010 11:26 am

ok, I checked that, but the sprite spawning the family members is not in that family. any other ideas what might cause the problem ?

cheers, barneygumble44

[url:31nwxcpq]http://www.oinobareion.at/~hullux/undersiege.0.01.cap[/url:31nwxcpq]

edit: I forgot, the game is supposed to go like this: You've got 3 catapult balls each round and if you don't manage to destroy the castle using them, you start catapulting your very catapult crew ;). The crewman character consists of five individual sprites hinged together and organized into a family, the problem occurs when I want to spawn the family and only individual members (bodyparts, that is) get spawned.
B
2
G
3
Posts: 14
Reputation: 878

Post » Tue Jan 12, 2010 6:20 pm

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
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 14, 2010 8:20 pm

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 ?

[url:1aimvgb4]http://www.oinobareion.at/~hullux/undersiege.0.01.cap[/url:1aimvgb4]

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
B
2
G
3
Posts: 14
Reputation: 878

Post » Thu Jan 14, 2010 8:46 pm

[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 ?[/quote:d3spc1aa]

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:

viewtopic.php?f=3&t=5330

Be sure to read the whole thing, I got the calculation wrong and Davioware posted the correct one.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 14, 2010 11:00 pm

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?
B
2
G
3
Posts: 14
Reputation: 878

Post » Thu Jan 14, 2010 11:14 pm

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.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jan 16, 2010 11:51 pm

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
B
2
G
3
Posts: 14
Reputation: 878

Post » Sun Jan 17, 2010 3:53 am

[quote="BarneyGumble44":33wzw3xi]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[/quote:33wzw3xi]

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?
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Jan 20, 2010 9:56 am

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.
B
2
G
3
Posts: 14
Reputation: 878

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests