Posted by Nightmare on October 20, 1998 at 19:33:08:
OK, so I link up this cog in my level. You start out, after a few seconds, you see the "starting" message. Then, as soon as you see the "timer"message, the game crashes and sends you back to the desktop. CogWriter didn't find any errors. Does anyone see anything here that is wrong?
Nightmare
# Jedi Knight Cog Script
# dnli_rand_amb.cog
#
# Plays a random sound at a random ghost popsition at a random interval
#
# 10/20/98 Nightmare
# This COG is not made or supported by LECsymbols
message startup
message timersound sound00
sound sound01
sound sound02
sound sound03
sound sound04
sound sound05
sound sound06
sound sound07
sound sound08
sound sound09thing ghost00
thing ghost01
thing ghost02
thing ghost03
thing ghost04
thing ghost05
thing ghost06
thing ghost07
thing ghost08
thing ghost09int numsounds
int numghostsflex interval
flex interval_randint soundnum local
int locationnum local
endcode
#==================================================================================================
startup:
sleep(5);
print("starting");
settimer(interval+(rand()*interval_rand));
return;#==================================================================================================
timer:
print("timer");
soundnum = rand()*numsounds;
locationnum = rand()*numghosts;
PlaySoundThing(sound[soundnum], ghost[locationnum], 2.0, -1, -1, 0);
settimer(interval+(rand()*interval_rand));
return;
end