Mission Scripting

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Mission Scripting

Post by SW_elite »

I know this has been talked about many times so I went and had a scroll throught all the topics that had something to do with mission scripting and none of them really help me much, soo......
Can someone please tell me how you make a mission for my map, since I have no idear, and in advance, I allready have the mission scripter and also in advance, thanks! :)

edit: Are there any tutorials for this kind of thing?
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Mission Scripting

Post by Eggman »

There are a few tutorials out there, but since everybody's missions are going to be different, there can't really be any specific tutorial to give you an exact process of how to create your mission, there are only guidelines where you sort of need to fill in the blanks.

We can't "tell you how to make a mission." That's just too broad of a request. Take a look at the documentation, the scripts in the assets, other topics around here - it's a process that can take a long time to figure out.

Also, avoid using the mission scripter if you can. I'm sure it's a handy tool and can make some things go faster, but you really won't learn much if you rely on it.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

Okay, thanks.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Mission Scripting

Post by wishihadaname »

You'll want to follow some of the tuts on GT to figure out how to start and end it. Other then that you can find examples of all the objectives in shipped scripts. Also here are a few screw ups that took me weeks to figure out

1) if you use localized popups make sure that they are not longer then 1-2 paragraphs, if the popup is too long the game will crash without any indication of what went wrong

2) if you have ambush teams a screwup in coding can cause everything else in the map to malfunction without an error

3) beware typos, they can cause every screwup you ever imagined and sometimes don't render an error message

4) start simple and test often, makes debugging easier.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

Good, ill use those tips, now im gonna get a tut.
User avatar
sampip
General
General
Posts: 792
Joined: Mon Mar 16, 2009 12:08 pm
Projects :: Something big. And exciting.
Games I'm Playing :: Battlefield 3
xbox live or psn: masowner66
Location: Zebra

Re: Mission Scripting

Post by sampip »

Eggman wrote: Also, avoid using the mission scripter if you can. I'm sure it's a handy tool and can make some things go faster, but you really won't learn much if you rely on it.
QFT - I've made a few custom missions and I've never really used it - as helpful as it may be. A good tip is to use the stock campaign scripts as reference for an objective/point you get stuck on. There's some really interesting stuff in there that I'm sure you'll find a lot of help on if you get stuck. My first campaign was from editing the felucia script, I just changed some of the objectives and deleted a few that weren't necessary.

And I know this has been said - but always test and check your work. If you rush ahead and do 3 objectives and something goes wrong - you're in big trouble. Do 1 objective at a time, and if you get it wrong, look through what you did and see if you remembered to do everything right. If still not - you can look at a similar objective from the stock campaign scripts and compare yours to that one. If still not, you can post here and I'm sure people will be able to help. Good luck!
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

I need a boost on my first objective, so can someone please help me. What i want to happen in my mission is the AI arent on the map at the start, you have 1min to capture a cp on an island, the AI start spawning, you protect the island cp for arround 1min 50sec. How do ya do that?

I promise that after the first objective ill do the rest on my own. plzzzzzzzzzzzzzz help :yes:
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Mission Scripting

Post by Eggman »

SW_elite wrote:I need a boost on my first objective, so can someone please help me. What i want to happen in my mission is the AI arent on the map at the start, you have 1min to capture a cp on an island, the AI start spawning, you protect the island cp for arround 1min 50sec. How do ya do that?

I promise that after the first objective ill do the rest on my own. plzzzzzzzzzzzzzz help :yes:
That's actually two separate objectives. Check out some of the shipped .luas with similar objectives (lots of maps have them - Kashyyyk, Yavin, Polis Massa, just to name a few). To prevent the AI from spawning, you need to use a line that's something along the lines of AllowAISpawn(false), if i remember correctly. Once you want them to spawn, use the line AllowAISpawn(true).
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

okay, i have hunt set up as my campaign and i also found another way to stop the AI from spawning, i just kill the cp they spawn from, dont know how to get it back though.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Mission Scripting

Post by [RDH]Zerted »

Respawn it. There's a function for respawning objects just as there is one for killing objects.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

so i would write, respawnobject("cp1_c")
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Mission Scripting

Post by Eggman »

SW_elite wrote:so i would write, respawnobject("cp1_c")
RespawnObject("objectname")

So in your case, yes, "cp1_c." I'm pretty sure the capitalization of the letters matters. I've had some cases where I left a letter or two lowercase (as in "Respawnobject") and it didn't work.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

okay, im gonna try script the first objective tonight and ill tell yous if it works, k, i doubt it will.

And how do you add you map into the minimap at the top right, also the map that you see when you press 'M'?

EDIT: Im stil considering using the mission scripter, because it will take way less time to script that way, but on the other hand i wont learn anything. On the other other hand i could use the mision scripter and study the script i make to learn everything i can, your idears?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Mission Scripting

Post by AQT »

SW_elite wrote:And how do you add you map into the minimap at the top right, also the map that you see when you press 'M'?
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Mission Scripting

Post by SW_elite »

Thanks AQT. Okay, so just a couple of minutes ago i tried scripting my first objective but it failed, it is a fairly simple objective, just go take that cp, but it didnt work, so i undid everything and im gonna try again, but with the mission scripter this time.

I followed the minimap tut and I got my map tga from Zero Editer by using the HiResMap thingo. The file is massive and i wanted to make it smaller, but every time i divide the sizes it has an error in the mungelog the the map tga file has to be a square of two. So I changed the tga so it was the right size but now the map is of center and the cp's arent where there meant to be, how do i fix it?
Post Reply