Adding Hero Assault to an existing map?!

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
Janarus
Posts: 2
Joined: Wed Apr 08, 2015 2:52 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Adding Hero Assault to an existing map?!

Post by Janarus »

Hey. I've been somewhat in and out of the modding community for a little while (I've made a few unfinished maps here and there). I do have a question, however. I was wondering if there was a way to add Hero Assault mode to an existing map. I have the source files for a map WITHOUT Hero Assault, and me being very new to adding game modes, etc... How do I add Hero Assault to this map?

And, if possible, is there a way to take the characters from a conversion pack map (Such as Coruscant Hero Assault) and use those characters instead of the default?

Like I said, I'm getting back into modding from just starting on it over four years ago, this is all gray for me. Thanks

-Janarus

No need to create a second topic. The mods move things to their proper positions. ~A Mod
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: Adding Hero Assault to an existing map?!

Post by [RDH]Zerted »

You can add a game mode by making a new map, but in your lua mission script you load the other map file instead of yours. Have your addme add the new game mode to the existing map.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Adding Hero Assault to an existing map?!

Post by AnthonyBF2 »

You could simply create a stock empty map, and use dc: to call an existing constructed level.
Then copy that built map level file to you addon's directory so it can be read.

Ensure that you know which data layer you're reading. If you were going to use tat2.lvl for example, the layer would be tat2_tdm

Whole example:

ReadDataFile("dc:TAT\\tat2.lvl", "tat2_tdm")

This will expect TAT folder with tat2.lvl to be in:
Star Wars Battlefront II\GameData\Addon\MODid\data\_LVL_PC\

You can do the same thing with characters and side if you already have the constructed .lvl files.
Janarus
Posts: 2
Joined: Wed Apr 08, 2015 2:52 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Adding Hero Assault to an existing map?!

Post by Janarus »

[RDH]Zerted wrote:You can add a game mode by making a new map, but in your lua mission script you load the other map file instead of yours. Have your addme add the new game mode to the existing map.
Okay, so I create a basic default map, and have the lua mission script load the other map's files instead of the default map's? How exactly do I do that, I never had to mess with 'lua mission scripts' before.

Also, what do you mean by having my addme add the new game mode?

Sorry if I'm asking really basic questions, I always dealt with building the maps and then sent them over to my modder for all the rest :P




EDIT
anthonybf2 wrote:You could simply create a stock empty map, and use dc: to call an existing constructed level.
Then copy that built map level file to you addon's directory so it can be read.

Ensure that you know which data layer you're reading. If you were going to use tat2.lvl for example, the layer would be tat2_tdm

Whole example:

ReadDataFile("dc:TAT\\tat2.lvl", "tat2_tdm")

This will expect TAT folder with tat2.lvl to be in:
Star Wars Battlefront II\GameData\Addon\MODid\data\_LVL_PC\

You can do the same thing with characters and side if you already have the constructed .lvl files.

I did all of this, and it seems to work okay... But it crashed with a FATAL ERROR saying it couldn't open mission.lvl

How do I fix THIS?
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: Adding Hero Assault to an existing map?!

Post by [RDH]Zerted »

If you've built maps before, then you probably know they have different layers. When you start a map, SWBF2 loads one or more layers. If you want to add a new game mode, you have to know which layer you want to load. The basic steps are:

1) Create a new mission script (or better yet, copy an existing hero assault script)
2) Change the script to load the proper layer from the map (see anthonybf2's post). You'll be editing the ScriptInit section.
3) Add the mission script to the related .req file (mission.req?)
4) Create/copy/edit an addme.lua
5) Edit the addme to include your new mission/game mode.
6) Munge and play test.
7) Fix your memory pools.
15) Play test online with other people
16) Write up really nice installation instructions and/or make an installer
17) Release map

I'm not going to get much more detailed than that. Read documentation include in the mod tools. Follow the steps for creating a completely new map, then simply change the script to load the other map instead.

Since you already have the source to the map you're editing, there's probably a few tutorials on here on how to add a game mode. Find them (check the Everything You Need sticky topic). You don't need to understand every step before you get started. Just make sure to keep backups if you don't know what you're doing.

Edit: For the mission.lvl error, you likely didn't add your new mission script to mission.lvl. To do that you need to edit mission.req. The req files tell the munger which files to include when building the .lvl files.
Post Reply