Another Brick in The Mall

Another Brick in The Mall

Zbyt mało ocen
Modding guide
Autorstwa: The Quadsphere
How to create graphical mods, product mods, and more.
 
Oceń  
Ulubione
Ulubione
Usuń z ulubionych
Basics
Here are instructions on how to create and publish your own mods for the game.
Mods can provide graphical modifications, alternate gameplay conditions and additional content (such as new products).

First things first, you should get yourself familiar with this folder (copy/paste this path to the Windows search bar or the file explorer):

%appdata%\..\Local\Another Brick in the Mall\workshop\

Tip: create a shortcut to this directory on your desktop for easy access.

In

%appdata%\..\Local\Another Brick in the Mall\workshop\in\mods

create a new folder and give it a unique name for your mod (use latin characters to avoid compatibility issues).

In this new folder, create a new text file (right-click in the folder in explorer and select New > Text Document) and rename it to moddata.xml (remove the .txt extension, the full filename should be moddata.xml).

Tip: Although you can use Notepad to edit moddata.xml, you might want to use a proper XML editor such as Microsoft XML Notepad[www.microsoft.com].

Copy/paste the following code in your moddata.xml file:

<?xml version="1.0" encoding="utf-8" ?> <ModData> <ModName> <english>Your mod's name</english> </ModName> <ModAuthor>Your name or nickname</ModAuthor> <ModShortDescription> <english>A short description of your mod's features</english> </ModShortDescription> </ModData>

You should replace the content in <nodes></nodes> with your own.

Please note that when a node has <english></english>, it means that it is localizable.
Use the API language codes referenced there to add translations as desired.
For example, to add a french translation to your mod's name:

<ModName> <english>Your mod's name</english> <french>Le nom de votre mod</french> </ModName>

Next you need an image to showcase your mod in-game and on the workshop (aka the capsule).
Create a 1024x576 PNG image and save it as capsule.png in your mod's folder.
You can save the image below to serve as a temporary capsule (right-click > Save image as...).



At this point, although your mod does nothing yet, you can test it in-game to verify that it is detected and appears properly.
Go to the New game menu and to the Manage mods menu.




If your mod is not there or has errors, you might want to check the console.log file for possible errors, and double check the instructions above.

Tip: if you enable the debug overlay (F1) on the Manage mods menu, the folder names of mods will appear, which might come in handy later.
Graphical mods
Graphical mods can 'patch' existing art (sprites, tiles and UI) with custom art.

The game's textures are usually located in
C:\Program Files (x86)\Steam\steamapps\common\Another Brick in the Mall\data
If you installed the game elsewhere, you can access the game's local files from your Steam library: right-click on the game in your library > select Properties > select the 'Local files' tab > press 'Browse local files'.

There are 3 textures there you can patch:

sprites01.png (a 4096x4096 PNG which contains most of the sprites in the game).


Tip: Yes, the bottom half of sprites01.png is empty, it is reserved for content mods. In this section we only want to replace 'vanilla' art.

tiles01.png (a 2048x2048 PNG which contains the tiles, walls and roadwork art for the game).



gui.png (a 2048x1024 PNG which contains the user interface art for the game).



Your patch will be a png image file (give it a relevant name) that will replace art at specified coordinates in a given texture. Of course, it should be located in your mod's folder.

The <GfxPatch> node structure in the XML looks like this:

<GfxPatch> <target>sprites01.png</target> <patch>mypatch.png</patch> <offset_x>0</offset_x> <offset_y>1280</offset_y> </GfxPatch>

In this example, the mypatch.png image will be pasted onto the sprites01.png texture at coordinates (0,1280).

Add as many <GfxPatch> nodes as you need within the <ModData> node, and don't forget to add the corresponding png files.

Now for a practical exercise, let's say we want everyone in the game to sport a clown nose (because why not?).

First, locate the noses in sprites01.png and write down their coordinates and the size of the space they occupy.



So the noses occupy a 512x64 space located at coordinates (512,1472).
Select the (512x64) area, crop the image and replace the noses with clown noses.
You should now have a png image that looks like this:



Save it as clown_noses.png in your mod's folder.

Now your moddata.xml should look something like this:

<?xml version="1.0" encoding="utf-8" ?> <ModData> <ModName> <english>Clown fiesta</english> </ModName> <ModAuthor>John Doe</ModAuthor> <ModShortDescription> <english>Everyone's a clown... </english> </ModShortDescription> <GfxPatch> <target>sprites01</target> <patch>clown_noses.png</patch> <offset_x>512</offset_x> <offset_y>1472</offset_y> </GfxPatch> </ModData>

Let's try it out:

A game changer, surely :P

Please note: empty (transparent) space in your patch image will replace existing art. You can use this to remove cosmetic features.

For example, to remove noses from characters, create a fully transparent 512x64 PNG, rename it to blank_512x64.png and create the following <GfxPatch> node::
<GfxPatch> <target>sprites01</target> <patch>blank_512x64.png</patch> <offset_x>512</offset_x> <offset_y>1472</offset_y> </GfxPatch>

There you go: characters without noses!
If you want to remove eyes, change the offset coordinates to (0,1472). For mouthes (0,1536).
Floor tiles mods
In addition to modifying existing floor tiles as described in the Graphical mods section, you can add extra floor tiles to the game.

Each added floor tile type needs a 512x64 png image with 8 64x64 tile variants (It can be the same tile depending on the style, the game will randomly use one of the variant for each cell the tile is applied to).

The <FloorTile> node is simple:

<FloorTile> <tiles_gfx>myfloortile.png</tiles_gfx> </FloorTile>

Simply reference your image in <tiles_gfx>.

You can add as many <FloorTile> nodes you want in a single mod (<ModData>), but please note there is a limit of 20 extra floor tiles per game (any extra tile will be ignored).

You might want to subscribe to this mod for reference:

https://steamcommunity.com/sharedfiles/filedetails/?id=1645061903
Product mods
Ever felt that a specific product was missing from the game? Product mods let you add custom products to game's economy.

Modded products require a <Product> node with a name and specifications for the product and up to 3 images for on-shelf representation.

Let's take a look at the <Product> node:

<Product> <codename>unique_food_shelf_prod</codename> <name> <english>Food shelf product</english> </name> <specialty_name> <english>Food Product Store</english> </specialty_name> <subtype>2</subtype> <display_type>1</display_type> <depletion_rate>10</depletion_rate> <base_demand>30</base_demand> <base_price>10</base_price> <quality_distribution>3</quality_distribution> <expires_in_hours>240</expires_in_hours> <requires_research>0</requires_research> <horizontal_gfx>food_shelf_horizontal.png</horizontal_gfx> <vertical_gfx>food_shelf_vertical.png</vertical_gfx> <checkout_gfx>food_shelf_checkout.png</checkout_gfx> </Product>

<codename> is a unique non-localizable codename for the product. Use latin characters. Do not change after the first publication to the workshop!

<name> is the localizable name of the product.

<specialty_name> is the localizable name of the product's specialty store.
This is optional and only used if the <quality_distribution> of the product is 3 or more (Tier 3 demand).

<subtype> is the sub-category of the product.
Accepted values are:

  • 2 - Food
  • 3 - Beverages
  • 4 - Household Items
  • 5 - Health and Beauty
  • 6 - Tools and Materials
  • 7 - Electronics and Appliances
  • 8 - Clothing
  • 9 - Media
  • 10 - Press and Print
  • 11 - Plants and Gardening
  • 12 - Misc
  • 13 - Sports and Outdoors
  • 14 - Toys and Games

<display_type> is the type of shelf/display that is used for the product.
Accepted values are:

  • 1 - Food shelf
  • 2 - Fridge only
  • 3 - Fridge or food shelf (suitable for drinks)
  • 4 - Table
  • 5 - Cloth rack
  • 6 - Pallet
  • 7 - Non-food shelf

<depletion_rate> is the percentage of stock that is depleted from the shelf when a customer buys an item.
Accepted values are: 1 - 100

<base_demand> is the base demand. This value is relative to the demand of all the other products.
Accepted values are: 0 - 200

<base_price> is the base value (determines cost/ sell price) of the product.
Accepted values are: 1 - 200

<quality_distribution> is the distributed demand for your product between tiers of quality/rarity. It determines if there is demand for a sub-category specialized store, or a product specialized store, or none of these.
Accepted values are (with demand for Tier 1/Tier 2/Tier 3):

  • 0 - no specialization (100/0/0)
  • 1 - standard (75/25/0)
  • 2 - high sub-category (50/50/0)
  • 3 - specialty (30/30/40)
  • 4 - high specialty (10/30/70)
  • 5 - no middle (30/0/70) - typically for products in the 'Misc' sub-category
  • 6 - only specialty (0/0/100)

<expires_in_hours> is the expiration time in hours before an item becomes obsolete/expired.
Accepted values are: 1 - 240000

<requires_research> is used to tie a product to a research project.
Accepted values are:

  • 1 - Cold chain
  • 2 - Alcohol license
  • 4 - Frozen food supplier
  • 5 - Chemical supplier
  • 6 - Clothing supplier
  • 7 - Electronics supplier
  • 8 - Media supplier
  • 9 - Appliances supplier
  • 10 - Tools supplier
  • 11 - Luxury supplier
  • 30 - Tobacco license
  • 31 - Newsagent supplier
  • 32 - Plants and Gardening supplier
  • 33 - E-Cigarettes supplier

<horizontal_gfx> references a 128x128 png with full and half-full representation for the product on horizontally oriented shelves/displays.

<vertical_gfx> references a 128x128 png with full and half-full representation for the product on vertically oriented shelves/displays. (Please note: pallet products do not have a vertical orientation).

<checkout_gfx> references a 32x32 png with a single item to be displayed on the checkout counter.

You should subscribe to this mod:

https://steamcommunity.com/sharedfiles/filedetails/?id=1557693902
Once steam has downloaded the mod and you run the game once, the demo mod data will appear in:
%appdata%\..\Local\Another Brick in the Mall\workshop\in\mods\1557693902\

It includes demo products for each display type and Photoshop templates to help overlaying your images correctly.
Disable vanilla products
<DisableVanillaProduct> let's you remove a vanilla product from the game's economy. This should come handy for mods or scenarios that aim to completely or partially replace the vanilla products with custom products.

Each <DisableVanillaProduct> node references a vanilla product with the localizable xml name ProductName_*.
Here is the code to disable all vanilla products:

<DisableVanillaProduct>ProductName_FastFood</DisableVanillaProduct> <DisableVanillaProduct>ProductName_CasualDining</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FineDining</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Bowling</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Movies</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ArcadeGames</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Bar</DisableVanillaProduct> <DisableVanillaProduct>ProductName_CoffeeShop</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Liquor</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Soda</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Candies</DisableVanillaProduct> <DisableVanillaProduct>ProductName_BottledWater</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Beer</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Wine</DisableVanillaProduct> <DisableVanillaProduct>ProductName_CannedFood</DisableVanillaProduct> <DisableVanillaProduct>ProductName_BreakfastCereal</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Snacks</DisableVanillaProduct> <DisableVanillaProduct>ProductName_IceCream</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Milk</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Cookies</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Dairy</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FreshMeat</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SlicedBread</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SaucesandSeasoning</DisableVanillaProduct> <DisableVanillaProduct>ProductName_RiceandPasta</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FrozenVegetables</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FrozenPizzas</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FreshFish</DisableVanillaProduct> <DisableVanillaProduct>ProductName_CoffeeandTea</DisableVanillaProduct> <DisableVanillaProduct>ProductName_PetFood</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Detergents</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SoapandShampoo</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Cosmetics</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ToothCare</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Deodorants</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ShavingCreamandRazors</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Diapers</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ToiletPaper</DisableVanillaProduct> <DisableVanillaProduct>ProductName_LightBulbsandElectricity</DisableVanillaProduct> <DisableVanillaProduct>ProductName_CarTools</DisableVanillaProduct> <DisableVanillaProduct>ProductName_HandTools</DisableVanillaProduct> <DisableVanillaProduct>ProductName_PowerTools</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Toys</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Books</DisableVanillaProduct> <DisableVanillaProduct>ProductName_DVDsandBluRays</DisableVanillaProduct> <DisableVanillaProduct>ProductName_MusicCDs</DisableVanillaProduct> <DisableVanillaProduct>ProductName_VideoGames</DisableVanillaProduct> <DisableVanillaProduct>ProductName_BedSheets</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FirstAid</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Drugs</DisableVanillaProduct> <DisableVanillaProduct>ProductName_MenShoes</DisableVanillaProduct> <DisableVanillaProduct>ProductName_WomenShoes</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FreshFruits</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FreshVegetables</DisableVanillaProduct> <DisableVanillaProduct>ProductName_FreshBread</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Jewelry</DisableVanillaProduct> <DisableVanillaProduct>ProductName_LaptopComputers</DisableVanillaProduct> <DisableVanillaProduct>ProductName_GameConsoles</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Smartphones</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Tablets</DisableVanillaProduct> <DisableVanillaProduct>ProductName_MP3Players</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Cameras</DisableVanillaProduct> <DisableVanillaProduct>ProductName_TVSets</DisableVanillaProduct> <DisableVanillaProduct>ProductName_T-Shirts</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Pants</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Dresses</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Shirts</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Jackets</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Coats</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Cookware</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Dishes</DisableVanillaProduct> <DisableVanillaProduct>ProductName_PadsandTampons</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Juices</DisableVanillaProduct> <DisableVanillaProduct>ProductName_MenUnderwear</DisableVanillaProduct> <DisableVanillaProduct>ProductName_WomenLingerie</DisableVanillaProduct> <DisableVanillaProduct>ProductName_WashingMachine</DisableVanillaProduct> <DisableVanillaProduct>ProductName_DishWasher</DisableVanillaProduct> <DisableVanillaProduct>ProductName_DryingMachine</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Fridge</DisableVanillaProduct> <DisableVanillaProduct>ProductName_GreetingCards</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Newspapers</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Magazines</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ComicBooks</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SchoolSupplies</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Tobacco</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ECigs</DisableVanillaProduct> <DisableVanillaProduct>ProductName_GardeningTools</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SoilFertilizer</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Plants</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Flowers</DisableVanillaProduct> <DisableVanillaProduct>ProductName_Backpacks</DisableVanillaProduct> <DisableVanillaProduct>ProductName_SportsBalls</DisableVanillaProduct> <DisableVanillaProduct>ProductName_BoardGames</DisableVanillaProduct> <DisableVanillaProduct>ProductName_ActionFigures</DisableVanillaProduct> <DisableVanillaProduct>ProductName_DishWasher</DisableVanillaProduct>


Please note that if you use this full list without adding new custom products, the game will crash. At least one valid product should be active for the game to run properly.

Also, research projects and zones tied to vanilla products will still be active.
Gameplay Mods
Gameplay mods let you change gameplay conditions to create custom game modes/difficulty settings.

Here is a <Gameplay> node with all the currently tweakable variables set to their default values:

<Gameplay> <sim_speed>1.0</sim_speed> <starting_money>200000</starting_money> <demand_mode>0</demand_mode> <prices_mode>0</prices_mode> <demand_amplitude>0.1</demand_amplitude> <demand_frequency>0.1</demand_frequency> <staffneeds_mode>0</staffneeds_mode> <shoplifting_mode>2</shoplifting_mode> <rats_mode>1</rats_mode> <events_mode>1</events_mode> <roadwork_fac>1.0</roadwork_fac> <maintenancecost_fac>1.0</maintenancecost_fac> <margins_fac>1.0</margins_fac> <salary_fac>1.0</salary_fac> <interest_fac>1.0</interest_fac> <foundationscost_fac>1.0</foundationscost_fac> <objectscost_fac>1.0</objectscost_fac> <storecheckout_time>250</storecheckout_time> <selfcheckout_time>500</selfcheckout_time> <ordercounter_time>200</ordercounter_time> <fastfood_eatingtime>1500</fastfood_eatingtime> <finedining_eatingtime>3000</finedining_eatingtime> <coffeeshop_eatingtime>1500</coffeeshop_eatingtime> <bar_drinkingtime>1500</bar_drinkingtime> <fastfood_cookingtime>1000</fastfood_cookingtime> <finedining_cookingtime>1500</finedining_cookingtime> <toilet_time>800</toilet_time> <speed_fac>1.0</speed_fac> <patience_fac>1.0</patience_fac> <sociability_fac>1.0</sociability_fac> <addskill_fac>1.0</addskill_fac> <satisfaction_upmod>1.0</satisfaction_upmod> <satisfaction_downmod>1.0</satisfaction_downmod> <hunger_upmod>1.0</hunger_upmod> <hunger_downmod>1.0</hunger_downmod> <bladder_upmod>1.0</bladder_upmod> <bladder_downmod>1.0</bladder_downmod> <nausea_upmod>1.0</nausea_upmod> <nausea_downmod>1.0</nausea_downmod> </Gameplay>

You don't have to include all the variables in your mod, you can use only one or a few, the other non-included variables will be set to the default/sandbox value.

Please note that any sandbox setting set by the player from the new game menu will be overridden by gameplay mods.

Also note that, unlike product mods settings, these values are not clamped to ensure run-time safety. Nonsensical values will most likely crash the game or create random, possibly severe, bugs. Use common sense and stress-test your mods before publishing.

<sim_speed>
The simulation speed in seconds per minute: how many real-time seconds it takes to advance one minute in-game at x1 game speed. The default value is 1.0 second per minute. Any value under 0.74 is unsupported and will create problems, use at your own risk!

<starting_money>
Sets the starting money for a new game.

<demand_mode>
0 - standard demand
1 - random demand

<prices_mode>
0 - standard prices
1 - random prices

<demand_amplitude>
How much demand changes for each product.

<demand_frequency>
How often demand changes for each product.

<staffneeds_mode>
0 - no staff needs
1 - staff hunger and bladder needs enabled

<shoplifting_mode>
0 - no shoplifting
1 - mild shoplifting
2 - serious shoplifting
3 - massive shoplifting

<rats_mode>
0 - no infestations
1 - mild infestations
2 - severe infestations

<events_mode>
0 - no random events
1 - standard random events
2 - frequent random events
3 - constant random events

<roadwork_fac>
<maintenancecost_fac>
<margins_fac>
<salary_fac>
<interest_fac>
<foundationscost_fac>
<objectscost_fac>
Factors (coefficients, multipliers) to various costs, minimum salary and base interest rate.

<storecheckout_time>
<selfcheckout_time>
<ordercounter_time>
<fastfood_eatingtime>
<finedining_eatingtime>
<coffeeshop_eatingtime>
<bar_drinkingtime>
<fastfood_cookingtime>
<finedining_cookingtime>
<toilet_time>
The in-game time taken to complete various actions.

<speed_fac>
<patience_fac>
<sociability_fac>
Factors to how efficient characteristics are.

<addskill_fac>
Factor to any increase to a worker's experience (skill).

<satisfaction_upmod>
<satisfaction_downmod>
<hunger_upmod>
<hunger_downmod>
<bladder_upmod>
<bladder_downmod>
<nausea_upmod>
<nausea_downmod>
Factors to statuses increasing (*_upmod) or decreasing (*_downmod).
Publish to workshop
Once you're happy with your mod, copy its folder from:
%appdata%\..\Local\Another Brick in the Mall\workshop\in\mods
to
%appdata%\..\Local\Another Brick in the Mall\workshop\out\mods

You will now be able to upload it to Steam from the main menu (F1 -> upload/update mod).
< >
Komentarzy: 2
LivelyEngineer 10 marca o 18:42 
Are we not allowed to make whole new things like making new stores as mods or staff rooms?
[82DK-✠] JaY 17 listopada 2018 o 7:04 
I can not upload my mod I have added it both in the in/out mods but still, do not work the game crashes telling me I have not done it. Halp! :steamsad: