Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Blow that door!
Blow that door!
2001-10-10, 5:02 AM #1
ok..I need some help...I'm trying to create a cog that when you try to activate it normally, it simply gives you a broken sound. But when you damage the door with explosive damge or force destruction blast damage only the door makes a creaking sound and then the door falls over. Now I've made a cog so far..but right now it isn't working...so I need your help with it...thanks in advance!

symbols
message activated
message damaged

thing door linkid=1

int damageType local
int speed=

sound creaksound=
sound brokensound=
end

## Code Section
code
activated:
if (IsThingMoving(door)) return;
if (GetCurFrame(door) != 0) return;
if (GetSenderId() != 1) return;
PlaySoundThing(brokensound, door, 1, -1, -1, 0);
return;

damaged:
if (GetCurFrame(door) == 1) return;

damageType = GetParam(1);

if(damageType & 4) // FIRE
MoveToFrame(door, 1, speed);
PlaySoundThing(creaksound, door, 1, -1, -1, 0);
else
if(damageType & 8) // FORCE
MoveToFrame(door, 1, speed);
PlaySoundThing(creaksound, door, 1, -1, -1, 0);
return;

end




[This message has been edited by Jedi_Merlin (edited October 10, 2001).]
2001-10-10, 7:25 AM #2
Not sure if this will work but try:

symbols
message activated
message damaged

thing door linkid=1

int damageType local
int speed

sound creaksound
sound brokensound

end

## Code Section
code
activated:
if (IsThingMoving(door)) return;
if (GetCurFrame(door) != 0) return;
if (GetSenderId() != 1) return;
PlaySoundThing(brokensound, door, 1, -1, -1, 0);
return;

damaged:
if (GetCurFrame(door) == 1) return;

damageType = GetParam(1);

if(damageType & 4) // FIRE
{
MoveToFrame(door, 1, speed);
PlaySoundThing(creaksound, door, 1, -1, -1, 0);
}
else if(damageType & 8) // FORCE
{
MoveToFrame(door, 1, speed);
PlaySoundThing(creaksound, door, 1, -1, -1, 0);
}
return;

end

Basically, just put brackets around your if statements, and took out the '=' with no values...

↑ Up to the top!