Hidden "Walls" - Solution


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]

Posted by Antony Espindola on July 13, 1998 at 04:51:36:

In Reply to: Don't follow????? posted by Myrddraal on July 12, 1998 at 20:04:04:

I had the same problem as any door model is obvious,
as well as a slashable grate. BUT I managed to get
round it...
Looking at the Slashable Grate cog, I noticed that
it did some freaky things with the adjoins. The way
it works is to set the adjoins and surface so you
can't pass through. When it gets damaged, it then
sets the adjoins so you *can* pass through it!
Simple enough, so I hacked it about and made my own
which sets a surface to not drawn and passable,
then after a time sets it back again.
This gives the effect of the wall "disappearing" for
a short while and then being placed back!
Here's the COG:


# Jedi Knight Cog Script
#
# ANT_HIDDEN_WALL.COG
#
# This Cog makes an whole surface (hidden wall) disappear
# when a surface (button) is shot or activated.
#
# by Antony Espindola
# http://www.Horrible.Demon.co.uk/
#
# Please give credit if you use this COG!
#
symbols

message damaged
message activated

surface button mask=0x408
surface frontface mask=0x448
surface backface mask=0x448
sound dosound=beep1.wav
float SleepTime=2.0
int active=0 local

end

## Code Section

code

damaged:
activated:
if (active == 0)
{
active=1;
SetWallCel(button,1);
PlaySoundLocal(dosound, 1, 0, 0);

// unadjoin and untexture surfaces
setadjoinflags(frontface,2);
setadjoinflags(backface,2);
setfacegeomode(frontface,0);
setfacegeomode(backface,0);

Sleep(SleepTime);

// readjoin and texture surfaces
clearadjoinflags(frontface,2);
clearadjoinflags(backface,2);
setfacegeomode(frontface,4);
setfacegeomode(backface,4);

SetWallCel(button,0);
PlaySoundLocal(dosound, 1, 0, 0);
active=0;
}
return;

end


Please give credit if you use it!



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]