I've been working on a new gametype for JK, where one player randomly begins as a zombie and the rest as gunslingers, until everyone becomes zombies and the round ends. The game begins in a lobby, until someone pulls a switch that lets everyone into the arena and spirits the zombie off to his hiding place.
Here's the code for the switch:
I removed the pulse (which checks for victory conditions, i.e. all players zombified) to see if that were the problem, but it still crashes.
I've never done c/s scripting before, but I gave this a shot (with 0x240), in a clientside cog:
This handles the local view effects for when you become a zombie or gunslinger. For zombies, all sectors become fullbright (so you can see in the dark), red, and blurry, plus you lose your HUD.
For some reason, however, whenever somebody pulls the switch, the host's machine freezes up. Any possible solutions? Thanks.
Here's the code for the switch:
Code:
activated: if(GetSenderRef()==switch && swatch==0) { swatch=1; SetWallCel(switch, 1); PlaySoundGlobal(flip, 1, 0, 0x0); playercount = GetNumPlayers(); player = (Rand() * playercount) * playercount; player = player - (player % 1); Print("1"); // zombie initialization SetThingModel(GetPlayerThing(player), zmodel); SetActorExtraSpeed(GetPlayerThing(player), 0.5); SetInv(GetPlayerThing(player), 121, 1); SetInv(GetPlayerThing(player), 131, 0); // Saber SetInv(GetPlayerThing(player), 122, 0); SetInv(GetPlayerThing(player), 123, 0); SetInv(GetPlayerThing(player), 11, 0); SendTrigger(player, 99, player, 1, 0, 0); TeleportThing(GetPlayerThing(player), zspawn); // <- doesn't work :\ Print("2"); for(i=0; playercount; i=i+1) { if(i!=player) { // Set all non-zombie players as gunslingers. SetThingModel(GetPlayerThing(i), gmodel); SetActorExtraSpeed(GetPlayerThing(i), -0.5); SetInv(GetPlayerThing(i), 121, 0); SetInv(GetPlayerThing(i), 131, 0); // Saber SetInv(GetPlayerThing(i), 122, 1); SetInv(GetPlayerThing(i), 123, 1); SetInv(GetPlayerThing(i), 11, 500); } } Print("3"); MoveToFrame(doora, 1, 3); MoveToFrame(doorb, 1, 3); PlaySoundLocal(buzzer, 1, 0, 0x0); Print("4"); //SetPulse(3); } return;
I removed the pulse (which checks for victory conditions, i.e. all players zombified) to see if that were the problem, but it still crashes.
I've never done c/s scripting before, but I gave this a shot (with 0x240), in a clientside cog:
Code:
trigger: //if(GetSourceRef()==99) { if(GetParam(1)==0) { // Gunslinger num_sects=GetSectorCount(); for(i=0; i<num_sects; i=i+1) { SetSectorLight(i, 0, 0); SetSectorTint(i, '0 0 0'); } SetMapModeFlags(0x0); ClearActorFlags(GetParam(0), 0x800000); } if(GetParam(1)==1) { // Zombie num_sects=GetSectorCount(); for(i=0; i<num_sects; i=i+1) { SetSectorLight(i, 1, 1); SetSectorTint(i, '200 0 00'); } num_surfs=GetSurfaceCount(); for(i=0; i<num_surfs; i=i+1) { SetFaceType(i, 0x2); } SetMapModeFlags(0x4); SetActorFlags(GetParam(0), 0x800000); } //}
This handles the local view effects for when you become a zombie or gunslinger. For zombies, all sectors become fullbright (so you can see in the dark), red, and blurry, plus you lose your HUD.
For some reason, however, whenever somebody pulls the switch, the host's machine freezes up. Any possible solutions? Thanks.