Edit:
Q: How do I make the Gamemode only let my level be loaded on the map?
A: Create a new area with the area editor and give it an unique name (e.g. MyArea). Then you access it from the lua script like this:
Code:
self.MyArea = SceneMan.Scene:GetArea("MyArea")
Now your game mode only run on maps with an area called MyArea.
Q: How do I make the objective be to kill the enemy brain?
A: Check if the brains are alive and end the activity if all brains on a team are dead. You can use objective markers to higlight the brains. The "Zombie Cave" mission script does this below the '-- MARK THE OBJECTIVES' comment.
The function Battle:UpdateActivity() has an extra 'end' in it that probably caused the crash.
One more thing; in B24 each player has a number and that number is decided by controller type (e.g. mouse and keyboard is always player #0 in the default settings). But the script template you are using was written for B23 so your script won't run properly if the player is not player #0. The solution is simple. Look for the '-- Set up players' code in the StartActivity function and replace this
Code:
for player = 0, self.PlayerCount - 1 do
with this
Code:
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
if self:PlayerActive(player) [s]and self:PlayerHuman(player)[/s] then
from the "Zombie Cave" script. This problem probably exist in the DoBrainSelection function as well.
Looking forward to playing your mission!