Page 1 of 1

Mission Scripting

Posted: Sun Feb 07, 2010 5:44 pm
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?

Re: Mission Scripting

Posted: Sun Feb 07, 2010 6:16 pm
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.

Re: Mission Scripting

Posted: Sun Feb 07, 2010 11:57 pm
by SW_elite
Okay, thanks.

Re: Mission Scripting

Posted: Mon Feb 08, 2010 2:24 pm
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.

Re: Mission Scripting

Posted: Mon Feb 08, 2010 4:13 pm
by SW_elite
Good, ill use those tips, now im gonna get a tut.

Re: Mission Scripting

Posted: Mon Feb 08, 2010 4:27 pm
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!

Re: Mission Scripting

Posted: Mon Feb 08, 2010 9:27 pm
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:

Re: Mission Scripting

Posted: Mon Feb 08, 2010 10:17 pm
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).

Re: Mission Scripting

Posted: Thu Feb 11, 2010 5:49 am
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.

Re: Mission Scripting

Posted: Thu Feb 11, 2010 9:55 am
by [RDH]Zerted
Respawn it. There's a function for respawning objects just as there is one for killing objects.

Re: Mission Scripting

Posted: Fri Feb 12, 2010 12:16 am
by SW_elite
so i would write, respawnobject("cp1_c")

Re: Mission Scripting

Posted: Fri Feb 12, 2010 12:29 am
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.

Re: Mission Scripting

Posted: Fri Feb 12, 2010 3:59 am
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?

Re: Mission Scripting

Posted: Fri Feb 12, 2010 5:15 am
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'?

Re: Mission Scripting

Posted: Wed Feb 17, 2010 2:32 am
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?