Posted by Dylan on December 02, 1998 at 21:48:49:
In Reply to: Holodeck and how to do it posted by Kenobi on December 02, 1998 at 03:17:40:
Not too long ago I was thinking the same thing, and I made a COG to do it.
surface switch0 linkid=1 surface vrSurface0 int vrSkyFlag=1 sector vrRunSector0 sound vrRunSnd=forcefieldhum01.wav message activated end # ======================================================================================== code if (vrStatus == 0) for (index=0;index<4; index=index+1) vrStatus=1; if (vrStatus == 1) for (index=0;index<4; index=index+1) vrStatus=0; end
# Jedi Knight COG Script
#
# vrdeck.cog
#
# There is no way I could write every flag into this
# COG! Please adapt this for your own levels if you wish!
#
# VR Environment (Star Trek Holodeck? :) )
# Changes surface(s) with a switch
# Plays "VR Environment" sound
#
# based on 00_doorswitch.cog
#
# by Dylan
#
# http://www.geocities.com/TimesSquare/Portal/9054
# dylan_555@hotmail.com
# This file is not made or supported by LucasArts Entertainment Company
symbols
surface vrSurface1
surface vrSurface2
surface vrSurface3
surface vrSurface4
surface vrSurface5
material vrOffMat=dflt.mat
material vrOnMat=00starry.mat
int vrDirtFlag=0
int vrMetalFlag=0
int vrShallowWater=0
sector vrRunSector1
sector vrRunSector2
sector vrRunSector3
sound vrNoSnd=silence.wav local
int vrStatus=0 local
int dummy=0 local
int index=0 local
activated:
if (GetSenderId() == 1)
{
{
for (index=0; index<6; index=index+1)
{
SetSurfaceMat(vrSurface0[index],vrOnMat);
if (vrSkyFlag == 1) SetSurfaceFlags(vrSurface0[index],0x200);
if (vrDirtFlag == 1) SetSurfaceFlags(vrSurface0[index],0x80000);
if (vrMetalFlag == 1) SetSurfaceFlags(vrSurface0[index],0x100000);
if (vrShallowWater == 1) SetSurfaceFlags(vrSurface0[index],0x40000);
}
dummy=SetWallCel(switch0,1);
{
dummy=SectorSound(vrRunSector0[index],vrRunSnd,2.5);
}
return;
}
{
for (index=0; index<6; index=index+1)
{
SetSurfaceMat(vrSurface0[index],vrOffMat);
if (vrSkyFlag == 1) ClearSurfaceFlags(vrSurface0[index],0x200);
if (vrDirtFlag == 1) ClearSurfaceFlags(vrSurface0[index],0x80000);
if (vrMetalFlag == 1) ClearSurfaceFlags(vrSurface0[index],0x100000);
if (vrShallowWater == 1) ClearSurfaceFlags(vrSurface0[index],0x40000);
}
dummy=SetWallCel(switch0,0);
{
dummy=SectorSound(vrRunSector0[index],vrNoSnd,2.5);
}
return;
}
}
return;
# ========================================================================================