Code:
# Eggshells fall
#
# By Edward
symbols
message startup
message entered
message pulse
surface floor
sound fall
sector room
message fallingeggs
thing theegg0
thing theegg1
thing theegg2
thing theegg3
thing theegg4
thing theegg5
thing theegg6
thing theegg7
thing theegg8
thing theegg9
thing theegg10
thing theegg11
thing theegg12
thing theegg13
thing theegg14
thing theegg15
thing theegg16
thing theegg17
thing theegg18
thing theegg19
thing theegg20
thing theegg21
thing theegg22
thing theegg23
thing theegg24
thing theegg25
thing theegg26
thing theegg27
thing theegg28
thing theegg29
thing theegg30
thing theegg31
thing theegg32
thing theegg33
message touched
int i=0 local
int x=0 local
end
#
code
startup:
SetPulse(1);
return;
entered:
if(GetSenderRef()!=floor) return;
i=1;
call fallingeggs;
return;
pulse:
if(GetSectorPlayerCount(room)==0)
{
i=0;
for(x=0; x<34; x=x+1)
{
MoveToFrame(theegg0[x],0,100);
}
}
return;
fallingeggs:
while(i==1)
{
x=rand()*33;
if(GetCurFrame(theegg0[x])==0)
{
MoveToFrame(theegg0[x],1,3);
PlaySoundThing(fall,theegg,1,-1,10,0x80);
WaitForStop(theegg0[x]);
}
sleep(0.1);
}
return;
touched:
for(x=0; x<34; x=x+1)
{
If(GetSenderRef()==theegg0[x])
DamageThing(GetSourceRef(),1000,0x1,GetSourceRef());
}
return;
endOK, the problem is this. When theeggs fall, they should give a sound. But it is wierd:
I have done a corner camera effect, and when I'm looking in through that, I don't hear them fall, unless I make a noise, then they all make sounds all at once. When I use my own view, they make a sound, all of them. Even when they've reached frame 1. It sure is wierd...