Alright, I've made a cog in which you activate an arcade machine, and you play a wipeout style game. Rather than mess with controlling another template, I opted for changing the player 3do/physics. Now, the problem comes in if the player is killed while in the game (nothing hurts you, so the only way to do it is t-tab-kill) What should happen is, the player gets transported back to the arcade machine, 3do changed back to normal, physics back to normal, and the placeholder template (one that is created to look like the player playing the machine) is removed. But instead, the game crashes. The odd thing is, it worked untill recently, when I fixed some code that has nothing to do with this. Here is the code:
The reason it's set up like that is because the code refuses to run while under the killed message. I'd preferr it there, so if you could help with that too, I'd be gratefull
[come to think of it, the game-winning code is virtually the same. Could it be teleporting the player after he's dead thats screwing it up?]
------------------
Project leader of TDIR
[This message has been edited by Shred18 (edited March 22, 2003).]
Code:
if(GetThingHealth(player) < 1) { SetThingModel(player, GetThingModel(guy)); TeleportThing(player, guy); DestroyThing(guy); DestroyThing(attatchment); ParseArg(player, "puppet=ky2.pup"); ClearPhysicsFlags(player,0x400); ClearPhysicsFlags(player,0x100); ClearPhysicsFlags(player,0x40000); SetInvAvailable(player,1,weap1); SetInvAvailable(player,2,weap2); SetInvAvailable(player,3,weap3); SetInvAvailable(player,4,weap4); SetInvAvailable(player,5,weap5); SetInvAvailable(player,6,weap6); SetInvAvailable(player,7,weap7); SetInvAvailable(player,8,weap8); SetInvAvailable(player,9,weap9); SetInvAvailable(player,10,weap10); SetInvAvailable(player,21,ki); SetInvAvailable(player,25,charging); SetInvAvailable(player,25,kaoken); SetInvAvailable(player,30,throw); SetInvAvailable(player,31,sense); SetInvAvailable(player,32,melee); SetInvAvailable(player,40,bact); SetInvAvailable(player,41,ir); SetInvAvailable(player,42,field); ClearActorFlags(player,0x800000); StopSound(hs, 0); SetMaterialCel(arcademat,0); SetPulse(0.0); }
The reason it's set up like that is because the code refuses to run while under the killed message. I'd preferr it there, so if you could help with that too, I'd be gratefull
[come to think of it, the game-winning code is virtually the same. Could it be teleporting the player after he's dead thats screwing it up?]
------------------
Project leader of TDIR
[This message has been edited by Shred18 (edited March 22, 2003).]