Wave Mode Tutorial?

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
YTF
First Lance Corporal
First Lance Corporal
Posts: 124
Joined: Thu Jul 10, 2008 3:53 pm

Wave Mode Tutorial?

Post by YTF »

I've been wanting to add a multiplayer Wave mode to my map, like Hoth in Mav's Dark Times, but I haven't found anything explaining exactly how to set it up. Can anyone direct me to a tutorial or something?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Wave Mode Tutorial?

Post by DarthD.U.C.K. »

there is no tutorial about it (yet) because it actually a "simple" campaign script
YTF
First Lance Corporal
First Lance Corporal
Posts: 124
Joined: Thu Jul 10, 2008 3:53 pm

Re: Wave Mode Tutorial?

Post by YTF »

Would anyone be willing to show me an example script? I haven't found much using Search..
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Wave Mode Tutorial?

Post by Fiodis »

I doubt there are any in existence aside from Mav's at this point in time. When he chooses to release them, if he chooses to release them, we will all be grateful; but until that hypothetical moment you'll have to learn how to script yourself, I'm afraid.

The general layout: you have timers that, on the elapse of each, spawn an ambush and set off the next timer in the sequence. Then you have the objectives. For a simple wave mode, to just survive until the final wave is over, you trigger a victory on the elapse of the last timer.

That's the general skeleton, as I see it. Now you have to go learn how to fill in the gaps and figure out LUA coding. It's not that bad, once you get the hang of it....
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Wave Mode Tutorial?

Post by Maveritchell »

Fiodis wrote:I doubt there are any in existence aside from Mav's at this point in time. When he chooses to release them, if he chooses to release them, we will all be grateful; but until that hypothetical moment you'll have to learn how to script yourself, I'm afraid.
I'm more than happy to show it to anyone who can use it; unfortunately if you do not have a little bit of scripting knowledge it will not be very useful. No wave mode is ever exactly the same, so you can't just plunk some lines of script into a new .lua and have it work for any map.
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Wave Mode Tutorial?

Post by RepSharpshooter »

Battle Arena 2.0 has a wave mode as well. It's just a timer that elapses triggering the Ambush() lua call.

I would benefit from seeing how you did yours, Mav. I'm running into the issue that in order to be able to spawn different unit classes, I have to make more and more local teams, which hits the limit. Ultimately I'd like to find a way to be able to spawn any unit class in a certain number via lua.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Wave Mode Tutorial?

Post by Maveritchell »

RepSharpshooter wrote:I would benefit from seeing how you did yours, Mav. I'm running into the issue that in order to be able to spawn different unit classes, I have to make more and more local teams, which hits the limit. Ultimately I'd like to find a way to be able to spawn any unit class in a certain number via lua.
Shoot me a PM if you need it. I used different local teams for different groups of classes, but depending on what you want to do there could be a number of ways to try. You can always start with one local team, ambush it, add a unit class to it, ambush it again, etc., rinse and repeat with other local teams. If you want to spawn specific units at specific times it might get tougher, but a unit can only be spawned if it's on a team. You can always spawn units and kill them if they aren't the right unit (and iterate through that cycle until you get the unit you want) - I ended up having to do that on one (or two?) of my wave modes.
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Wave Mode Tutorial?

Post by Frisbeetarian »

Couldn't you just set variables to many of the inputs for SetupTeams and update them between ambushes?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Wave Mode Tutorial?

Post by Maveritchell »

Frisbeetarian wrote:Couldn't you just set variables to many of the inputs for SetupTeams and update them between ambushes?
SetupTeams is run in ScriptInit; it isn't updated once the map has loaded. Simply, you can't modify/remove team parameters once a mission starts, you can only add to them.
YTF
First Lance Corporal
First Lance Corporal
Posts: 124
Joined: Thu Jul 10, 2008 3:53 pm

Re: Wave Mode Tutorial?

Post by YTF »

If you wouldn't mind, Mav, I would very much like to see your scripts. I am somewhat of a beginner at BF2 LUA coding, but I do know a few things, and I would be willing to learn anything else that is involved. ^^
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: Wave Mode Tutorial?

Post by [RDH]Zerted »

Maveritchell wrote:...You can always spawn units and kill them if they aren't the right unit (and iterate through that cycle until you get the unit you want)...
I think it would be easier to just set the unit's class before spawning it. SelectCharacterClass should do that. It's in the docs...
Post Reply