Jump to content

Cyrem
 Share

Recommended Posts

PATCH DOCUMENTATION FOR CAFETERIA

If you do not have Cafeteria or don't know what it is, go to the Cafeteria Topic first.

 

 


 

WADP Files

A WADP file is a standard WAD file with the same format as LEGO Rock Raiders' WAD files. The extra "P" means "Patch". It's used to bundle all the necessary files for a patch into a single file for easy distribution. A WADP file has two necessary files for it to be identified by Cafeteria as a patch it can execute. These two required files will be covered in the next section.

 

WADP Anatomy

A WADP file must have 2 files in the root directory. These files must be called info.xml & script.txt (lowercase) so they are correctly identified.

  • info.xml

    This file provides information about the patch for the patching system. Inside it contains information about the patch such as its name, author, version and more. It also contains information to help the patching system to prioritize your patch and IDs to check for any patches that may be incompatible with each other.

  • script.txt

    This file is the script that Cafeteria will run in order to apply your patch. The contents contains commands, one per line similar and it will tell Cafeteria what to modify in the CFG and WAD. The format is similar to standard command line.

 

Info.xml

The required contents of an info.xml file (for version 1 of the patch system) are as follows. All these elements are REQUIRED. It is however best to create this file using the Developer Tools in Cafeteria itself, rather than writing your own. If this file cannot be found or if it is invalid, it will not appear in the Mod Manager of Cafeteria.

Standard Format:

<?xml version='1.0'?>
<patch system="1">
                <name>My Patch Name</name>
                <author>Username</author>
                <version>1.0</version>
                <description>This is a little info about my patch.</description>
                <uid>rru.lrr.username.mypatchname</uid>
                <priority>1</priority>
                <dependency>rru.lrr.username.myotherpatch,rru.lrr.username.someotherpatch </dependency>
                <incompatible>rru.lrr.username.badpatch</incompatible>
</patch>
  • System: This defines the patch system to use to apply this patch. In the future, changes to the system will occur and this number will increase, you should always use the latest version.
  • Name: This is the human readable name of your patch. Do not include a version number here.
  • Author: This should be your username.
  • Version: This is a human readable version number of your patch.
  • Description: This is information about what your patch does.
  • UID: This is a unique identifier for you patch, it is used to internally identify your patch when processing. This is required to be in the format: rru.lrr.[username].[patchname] . This should be in lowercase and contain no spaces. You should never re-use across different patches, this is to say if you make a patch that changes textures and another patch that adds models, these should have different UIDs.
  • Priority: By default this should always be 1. (This property is depreciated since Cafeteria 1.0 BETA 1).
  • Dependency: This is a comma separated (no spaces) list of UIDs of other patches that a user needs for this patch. If a user does not have the patches in this list, your patch will not be applied.
  • Incompatible: This is a comma separated (no spaces) list of UIDs of other patches that this patch cannot be installed with. If an incompatible patch has been installed before your patch, your patch will not be applied.

 

Script.txt

CFG Commands

  • CFG:AddProperty - Adds a property to a block.
    CFG:AddProperty <block path> <property name> <property value>
    
  • CFG:SetProperty - Changes the value of a property.
    CFG:SetProperty <property path> <value>
  • CFG:RemoveProperty - Removes a property from a block.
    CFG:RemoveProperty <property path>
    
  • CFG:RenameProperty - Changes the name of a property.
    CFG:RenameProperty <property path> <new name>
    
  • CFG:AddBlock - Adds a new block { }
    CFG:AddBlock <parent block path> <block name>
    
  • CFG:ClearBlock - Clears properties from a block and/or removes child blocks. This will not remove the block itself that you are clearing.
    CFG:ClearBlock <block path> <remove children TRUE/FALSE>
    
  • CFG:RenameBlock - Renames a block
    CFG:RenameBlock <block path> <new name>
    
  • CFG:InsertCFG - Inserts the contents of a CFG file from the Patch WAD into a block.
    CFG:InsertCFG <parent block path> <patch file path>
    

WAD Commands

  • WAD:AddFile - Adds a file from the Patch WAD to a directory.
    WAD:AddFile <patch file path> <wad file path>
    
  • WAD:AddFilesFromDirectory - Adds a directory of files from the Patch WAD to a directory.
    WAD:AddFilesFromDirectory <patch directory path> <wad directory path>
    
  • WAD:RemoveFile - Removes a file from a directory.
    WAD:RemoveFile <wad file path>
    
  • WAD:RenameFile - Renames a files in a directory.
    WAD:RenameFile <wad file path> <new name>
    
  • WAD:InsertReplaceFile - Replaces a file with another file or adds it as a new file if it doesn't exist.
    WAD:InsertReplaceFile <wad file path> <patch file path>
  • WAD:ReplaceFileData - Replaces the data of a file in a directory with the data of a file in the Patch WAD. (No file names are changed)
    WAD:ReplaceFileData <wad file path> <patch file path>
    
  • WAD:CopyDirectory - Makes a copy of a directory.
    WAD:CopyDirectory <wad directory path> <wad directory path of copy>
    
  • WAD:RemoveDirectory - Removes a directory and all it's files.
    WAD:RemoveDirectory <wad directory path>
    
  • WAD:MoveDirectory - Moves a directory to a new path.
    WAD:MoveDirectory <wad directory path> <new wad directory path>
    

Block & Directory Paths

These paths are formatted the same, and must finish with a final backslash.

Block Path: Lego*\Main\

Directory Path: Interface\RightPanel\

 

Property & File Paths

Again these are the same, however they do not feature a final backslash. File paths must include a file extension.

Property Path: Lego*\Main\LoadingText

File Path: Interface\RightPanel\CrystalSideBar.bmp

 

If a parameter in your scripts contains a space, for example in a directory path, enclose the parameter in quotes e.g "This Folder Has A Space"

 

Comments

You can put comments in scripts. Comments should begin with a double forward slash.

// This is a comment
  • Like 9
Link to comment
Share on other sites

  • 1 year later...
trigger_segfault

Note that script.txt needs to be formatted using CRLF ("\r\n") newlines. Otherwise it seems that everything will be treated as a single line, (which I think was executing successfully because the first line was a comment). Some editors like VSCode may not use this format by default.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.