View unanswered posts | View active topics It is currently Tue Apr 23, 2024 9:25 am



Reply to topic  [ 3 posts ] 
 Mission Help 
Author Message

Joined: Fri Mar 19, 2010 4:14 am
Posts: 20
Reply with quote
Post Mission Help
I'm trying to make a mission, but I need some help. for some weird reason, the map now crashes the game whenever I try to load it.
It worked fine, but when I was tinkering with the Lua and using some coordinates from it, something happened and now it makes it crash. What should I do?

Can you also help me with:
1. I don't know how to give the actors weapons
2. How do I make the Gamemode only let my level be loaded on the map
3. How do I make the objective be to kill the enemy brain
4. While I was trying to figure this out, something weird happened, and the game crashes whenever I load the level

Thanks in advance for any help.


Attachments:
File comment: help please
battle.rte.rar [45.93 KiB]
Downloaded 316 times


Last edited by adwuga on Sat Apr 23, 2011 11:25 pm, edited 1 time in total.

Sat Apr 23, 2011 6:42 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: Mission Help
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!


Sat Apr 23, 2011 9:02 pm
Profile

Joined: Fri Mar 19, 2010 4:14 am
Posts: 20
Reply with quote
Post Re: Mission Help
Thanks for all the help everything worked

It wasn't the extra end that caused the game to crash, but that was messing up the script and giving me console errors. what caused the game to crash was that I accidentally deleted the terrain file, but I had cortex command open while I did this, so I could still play my level until I closed it. for some reason the game wouldn't catch the missing file, until I changed the name of the .rte. I changed it back and now it works. thanks for the help.

one more thing
I have a few enemy actors who are supposed to attack the player's brain, but instead they attack each other.
this is their spawn script
Code:
local soldier = CreateAHuman("Soldier Heavy" , "Coalition.rte");
          soldier.Pos = Vector(1861 , 985);
         soldier:AddInventoryItem(CreateHDFirearm("Assault Rifle" , "Coalition.rte"));
         soldier:AddInventoryItem(CreateHDFirearm("Shotgun" , "Coalition.rte"));         
         soldier.Team = self.CPUTeam;
            MovableMan:AddActor(soldier);

adding soldier.AIMode = Actor.AIMODE_BRAINHUNT does nothing
the rest of the actors are on the level, not in the script


Attachments:
File comment: here is my rte
battle.rte.rar [46.48 KiB]
Downloaded 291 times
Sun Apr 24, 2011 5:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.059s | 16 Queries | GZIP : Off ]