Hi!
This COG is to teleport an object to somewhere else with some nice fancy graphics. But...
All works well. Nothing in chamber, make a sound (nope). But, when I place something there (example I placed was a Sequencer) the console (con) and me got teleported to the destination, but not the stuff in the chamber. HELP!
/Edward
This COG is to teleport an object to somewhere else with some nice fancy graphics. But...
Code:
# Teleporter
#
# By Edward
symbols
message startup
message activated
message pulse
thing inthere local
sector chamber
template upstuff
template dissapear
template extra
surface door0
surface door1
surface door2
surface door3
surface door4
surface door5
thing destination
thing emitter
thing con
int i local
int on=0 local
sound doors
sound going
sound nope
thing player local
thing ont local
end
#
code
startup:
SetSectorAdjoins(chamber,1);
for(i=0; i<6; i=i+1) {
SetAdjoinFlags(door0,0x2);
SetFaceGeoMode(door0,0); }
SetPulse(0.1);
return;
activated:
If(GetSenderRef()!=con) return;
player=GetSourceRef();
If(on!=0) return;
on=1;
PlaySoundThing(doors,emitter,1,-1,10,0xC0);
for(i=0; i<6; i=i+1) {
ClearAdjoinFlags(door0,0x2);
SetFaceGeoMode(door0,4); }
Sleep(1);
inthere=FirstThingInSector(chamber);
if(inthere==-1)
{
PlaySoundThing(nope,player,1,-1,-1,0x0);
sleep(1);
}
else
{
on=2;
sleep(1);
SetSectorAdjoins(chamber,0);
PlaySoundThing(going,emitter,1,-1,10,0xC0);
sleep(1);
inthere=FirstThingInSector(chamber);
while(inthere!=-1)
{
CreateThing(dissapear,inthere);
TeleportThing(inthere,destination);
CreateThing(dissapear,inthere);
ont=inthere;
inthere=NextThingInSector(ont);
}
sleep(1);
on=1;
SetSectorAdjoins(chamber,1);
sleep(1);
}
PlaySoundThing(doors,emitter,1,-1,10,0xC0);
for(i=0; i<6; i=i+1) {
SetAdjoinFlags(door0,0x2);
SetFaceGeoMode(door0,0); }
on=0;
return;
pulse:
if(on!=2) return;
CreateThing(upstuff,emitter);
return;
end
All works well. Nothing in chamber, make a sound (nope). But, when I place something there (example I placed was a Sequencer) the console (con) and me got teleported to the destination, but not the stuff in the chamber. HELP!
/Edward
