Battlezone 98 Redux

Battlezone 98 Redux

Not enough ratings
BZP map making guide
By Business Lawyer
This is a work in progress guide, it will be added to and edited as things change or get cleaned up. Feel free to comment if something needs more detail or isn't in this guide.

The BZP is the Battlezone Platform designed for multiplayer games in Battlezone Redux. It enables map makers to present menus which can control how the map operates and has a number of core components which generally enhance the game's features.

This guide is meant for individuals who already know a fair bit about the game's systems and want to leverage what BZP has to offer in their own works.
   
Award
Favorite
Favorited
Unfavorite
Setup
STEPS TO GET THE MAP AVAILABLE TO BOOT UP IN MULTIPLAYER

1) >>> Subscribe to this workshop item. <<<

2) Locate the BZPT.zip file after the workshop item downloads. This is usually located in C:\Program Files (x86)\Steam\steamapps\workshop\content\301650\3429007026

3) Make a new folder called "BZPT" within the game's addon directory. This is usually located here:

C:\Program Files (x86)\Steam\steamapps\common\Battlezone 98 Redux\Addon\BZPT

Extract the contents of the BZPT.zip file to the BZPT folder.

4) If your game's filepath is not steam's default, you will need to open up mpsimple.lua and change the file paths at the top to match your game directory.

5) From here, go into multiplayer and create a game. The map is called "BZP Template".

Structure
Broadly put, BZP's scripts are structured so that there are 4 distinct layers:

1) Stuff that runs globally
Scripts like SBPAi.lua, SBPGlobals.lua, SBPNavLogic.lua etc operate in all game modes. These display UI elements such as floor markers, provide feedback to the players actions, etc. These should generally not be edited or messed with unless you absolutely need a custom behavior to occur at this level. The base map script (mpsimple.lua) looks for and loads all of these modules.

2) The Main Game Menu
SBPGameMode.lua is what loads up when you boot up any map. This controls what game modes you see and if you want to add a new game mode, you would edit this file to do so. It also controls observer mode behaviors which apply to all game modes.

3) Game Mode
GAMEMODE_<gamemode>.lua is the script that gets loaded when the player selects a game mode. Everything that happens from unit selection to countdown to match start happens here.

4) Map Script
<mapname>MAP.lua This allows you to have per-map scripts. Any map paired with this file will run the script contained within. This is primarily used for either missions or environmental effects specific to a map.
IMPORTANT Map Content Information
MAP STRUCTURE
The example map provided is called mpsimple.bzn. This base map file should be mostly empty, containing only 14 spawn points and any path points that the map requires. Spawn points need to be placed as far away from from the main traversible areas as possible, but within map bounds. Avoid placing these remote spawn points on inaccessible high plateaus, as this will negatively impact AI in some cases..

THE GAME MODE SUBMAPS

mpsimple.bzn is the base map... all it does it allow players to load the map. You will also notice these specific files bundled with it:

mpsimple_S.bzn <- Strategy game mode
mpsimple_ST.bzn <- Strategy teams mode
mpsimple_SW.bzn <- Strategy wingman mode
mpsimple_MS.bzn <- Mission mode

All it takes is appending the map mode extension to make the map recognize that mode and make it selectable on game start. Each map is just a BZN file containing the objects that load when the host player chooses that game mode. So, to author a map layout specific to a strategy teams game mode, you'd rename the file to "mpsimple.bzn", edit it however you want, then name it back to "mpsimple_ST.bzn".

PLACING OBJECTS IN SUBMAPS

Game mode submaps handle objects slightly differently...

SPAWN POINTS

- NOTE: All spawn points used in game mode respect the position/rotation of the spawn point itself, you can make the player face any direction you want at start or after dying.

- Strategy game places players based on the order in which the spawn points were placed. If you have a 4 player map, you'll want to place spawns 1-2 and 3-4 across from eachother

- Team game modes handle spawn points very differently. It assumes that spawn points 1-7 are "TEAM A" and 8-14 are "TEAM B". Even if your map only supports 4-6 players, you need to place 7 spawn points for each team. The order of the spawn points is all that matters.

PRE-PLACED MAP OBJECTS

It is now possible to place pre-built map objects which will operate in multiplayer properly. When placing objects, it is critical to understand that the TEAM NUMBER NOW REFERS TO THE SPAWN POINT NUMBER in game mode maps, and that players in those spawn point slots are the ones who actually spawn those objects. This means if you want the first player on team B to start with an armory and 2 scavengers, those objects need to be set to be on team 8, which is the first player on team B. This basically means you can give any player anything you want to start out with! Pre-placed map objects are currently not spawned if the spawn point slot is occupied by a bot (AI Alpha, AI Beta, etc). Any objects on team 15 are always spawned by the host.

Mission game mode omits slots 8-14 and reserves them for AI use.

Using HoloText
HoloText enables you to display text anywhere so long as its stationary. There are some limitations you should be aware of:

- The text cannot be made to move with the player as part of a custom hud.

- The text cannot be scaled. You must use perspective manipulation if you want to give the appearance of scaled text.

The below image demonstrates usage of perspective manipulation to place UI elements.


HoloText is implemented as a global table that all scripts can access. If you look in SBPGameMode.lua, you will see a number of HoloText entries being added within the UpdateTopLevelMenu function. You can copy any of these entries and customize it to place the text anywhere. Usually you'll want to use GameKey() to manipulate where text elements appear, which is why I leave variables like SetX, SetY, and SetZ floating around. Here's an example of a HoloText entry:


When the player can no longer see the HoloText, I strongly recommend clearing the table with:

HoloText = {}

HoloText can display Green, Yellow, and Red text by using formatting tags like <R>, <Y>, and <G>.
HoloText can also display symbols which are denoted by {}. So, if you wanted to draw a Green box, you'd punch in {G}. The full list of supported HoloText characters and symbols are contained within SBPGlobals.lua. Look for the HoloChars and similar tables there.

TIP: A draw direction can be obtained by using GetFront(GetPlayerHandle())
TextOverlays
TextOverlays allows you to put temporary information on the screen. Useful for mission status updates, events, or responding briefly to the player's actions. Below, a player gets a 3 second notification that they received a unit from another player.



You need at minimum 3 files to create a graphic for this:

1) ODF file with "explosion" to use.
2) The material for the ODF to use.
3) The image file.

With these in hand, you can punch in a table entry like this:


So, this text overlay would appear for 2 seconds and alternate between the two ODF files provided at 0.15 second intervals. The alternating is usually used to make the element blink.
Publishing your BZP Map
When publishing your BZP map for use in multiplayer, you must edit the <mapname>.lua file to use the relative filepaths. Just set the 2nd parameter to "nil" here:


Then replace "BZPT" with whatever name your workshop folder was given after uploading your workshop item. Like so:


Re-upload your file, and the game should correctly reference your workshop folder when loading the map.
2 Comments
GrizzlyOne95 31 Jul @ 10:20am 
Great guide and thanks for all your work on this.
Rosario 19 Mar @ 8:47pm 
Outstanding work with this Business Lawyer, thank you for giving your time and energy for the sake of Battlezone!