Sanny Builder
In English
In English
  • Introduction
  • Credits
  • Version History
  • Language
    • Data Types
      • Constants
      • Variables
      • Arrays
    • Instructions
      • Opcodes
      • Keywords
      • Classes
      • Expressions
      • Built-in Commands
      • HEX..END
    • Control Flow
      • Labels
      • Conditions
      • Loops
      • Switch
    • Functions
    • Import/Export
    • Directives
    • Comments
  • Edit Modes
    • CustomLabels.ini
    • Code Templates
    • Enums.txt
    • Extensions
    • Opcodes List (SCM.INI)
  • Editor
    • Features
    • Options
      • General
      • Formats
      • Editor
      • Theme Editor
      • Hotkeys
      • Debugger
      • Edit modes
    • Console
    • Hotkeys
    • Opcode Search Tool
    • Command Line Interface
    • Language Service
    • SCM Debugger
  • SCM Documentation
    • GTA Limits
    • GTA III
      • Ped Types
      • Radar Icons
    • Vice City
      • Button IDs
      • Gang IDs
      • Garage IDs
      • Interiors
      • Ped Types
      • Radar Icons
      • Weapon IDs
    • San Andreas
      • Button IDs
      • Gang IDs
      • Garage IDs
      • Haircuts
      • Interiors
      • Particle Effects
      • Ped Types
      • Player Clothes
      • Player Body Parts
      • Special Actors
      • Statistics ID
      • Tattoos
      • Train Types
      • Vehicle Variations
      • Weapon IDs
      • Weather IDs
      • Zones
    • Liberty City Stories
      • Gang IDs
      • Model IDs
      • Player Clothes
      • Special Actors
      • Weapon IDs
      • Weather IDs
    • Vice City Stories
      • Gang IDs
      • Player Clothes
      • Weather IDs
  • Troubleshooting
    • Error Messages
      • 0001: INI file not found
      • 0002: Unknown array type
      • 0003: Error reading script.img
      • 0004: Unknown parameter type
      • 0005: Invalid edit mode
      • 0006: Unknown file header
      • 0007: File not found
      • 0008: Error reading opcodes list
      • 0009: Opcodes list not found
      • 0010: Unknown opcode
      • 0011: Unknown opcode
      • 0012: Incorrect jump instruction
      • 0013: Unknown directive
      • 0014: Incorrect expression
      • 0016: Script not found
      • 0017: Unknown type of variable
      • 0018: Invalid array size
      • 0019: Unknown array type
      • 0020: Variable is not declared as array
      • 0021: Incorrect variable name
      • 0022: Loop counter is not a variable
      • 0023: Unexpected instruction
      • 0024: Error reading integer number
      • 0025: Incorrect counter range
      • 0026: Error reading floating-point number
      • 0027: String is too long
      • 0028: Unterminated string
      • 0029: Invalid debug script ID
      • 0031: Invalid total number of elements
      • 0032: Invalid value in the header
      • 0033: Invalid local variable name
      • 0034: Local variable is out of range
      • 0035: Expected word
      • 0036: Local mission variable is out of range
      • 0037: Debug script not found
      • 0038: Unknown type of array
      • 0039: Invalid element definition
      • 0040: Constant name or value not found
      • 0041: Invalid mission id
      • 0042: Duplicate external script name
      • 0043: Invalid array index
      • 0044: Invalid array name
      • 0045: Invalid array syntax: variable name is missing
      • 0046: Invalid array syntax
      • 0047: Invalid array size
      • 0048: Error reading array size
      • 0049: Not enough parameters for opcode
      • 0050: Not enough parameters for command
      • 0051: Error writing script.img header
      • 0052: Error writing script.img
      • 0053: Recursive include
      • 0054: Label not found
      • 0055: Identifier not found
      • 0056: Label redeclared
      • 0057: Internal label not found
      • 0058: Invalid parameter
      • 0059: Invalid opcode definition
      • 0060: No input file
      • 0061: Empty source
      • 0062: IDE file not found
      • 0063: Mission label expected
      • 0064: Mission label not found
      • 0065: External script label not found
      • 0067: Forbidden character in external script name
      • 0068: Forbidden character in identifier
      • 0069: Forbidden character in object name
      • 0071: Incorrect number of conditions
      • 0072: Missing logical operator
      • 0073: Redundant logical operator
      • 0074: Disabled option
      • 0075: Incorrect hexadecimal value
      • 0076: Condition expected
      • 0079: Invalid parameter in Alloc command
      • 0080: Non-negative integer number expected
      • 0081: Too many actual parameters
      • 0082: Invalid syntax
      • 0083: Unknown model ID
      • 0084: Jump to offset 0
      • 0086: Invalid array index
      • 0087: Invalid variable
      • 0088: Global variable is out of range
      • 0089: Opcode not found
      • 0090: Duplicate constant
      • 0091: Not enough memory to allocate a local variable
      • 0092: Incorrect export symbol
      • 0093: Only headless scripts can export code
      • 0094: Duplicate export name
      • 0095: Incorrect import name
      • 0096: Incorrect import path
      • 0097: Too many actual parameters
      • 0098: Unknown operator
      • 0099: Left-hand side of the assignment must be a variable
      • 0100: Invalid operator
      • 0101: Variable is not a class instance
      • 0102: Switch statement needs a variable
      • 0103: Expected a switch case
      • 0104: Expected a value for the switch case
      • 0105: Expected a function argument name
      • 0106: Expected a function argument type
      • 0107: Expected function return type
      • 0108: Unsupported argument type
      • 0109: Expected variables to store function result
      • 0110: Function must return N values
      • 0111: Function not found in current scope
      • 0113: Duplicate function declaration
      • 0115: Invalid variable name. Name is reserved by another class or function
      • 0116: Invalid variable name
      • 0117: Invalid function name
      • 0118: Unexpected value to return
      • 0119: Unsupported type of argument
      • 0120: Expected calling convention type
      • 0121: Expected function's static address
      • 0122: A non-static function can't be called by name
      • 0123: A 'thiscall' function requires a pointer
      • 0124: Foreign functions can't return more than one value
      • 0125: Unexpected return type in function
      • 0126: Can't export a foreign function definition
      • 0127: Unexpected mission label in function
Powered by GitBook
On this page
  • File Format
  • Mode Attributes
  • Mode Parameters
  • Built-in Variables
  • Available Modes
  • Experimental Modes
  • Selecting a mode

Edit Modes

PreviousCommentsNextCustomLabels.ini

Last updated 1 month ago

Sanny Builder supports many games and platforms and so there is a predefined configuration for each supported game called an edit mode.

Edit modes supply Sanny Builder with the following information:

  • a target game

  • paths to files with the game data

  • paths to files with supporting information (, , , etc)

Sanny Builder stores the edit modes within the data folder. When a subfolder inside data contains a file named mode.xml, this file is automatically loaded as the configuration file for the respective edit mode.

In versions prior to 3.9, the modes configuration was stored in a single file named modes.xml, which was located in the data folder. Starting from version 3.9 and onwards, this configuration has been divided into separate XML files, each dedicated to a specific mode.

The modes configuration is automatically loaded upon startup of Sanny Builder. If needed, it can also be manually reloaded by running Sanny Builder with the -x CLI .

The configuration of the modes is open to modification and extensions, and users can create their own modes for specific needs.

File Format

The mode.xml file is formatted in XML and is editable using any text editor.

Each configuration file should begin with the following XML declaration:

<?xml version="1.0" encoding="UTF-8"?>

Following the declaration, there should be a single root node, <mode>. The file must only contain one root node.

Within the <mode> tag, there are both mandatory and optional attributes, as described below. The content of the <mode> tag consists of specific tags (properties) that define paths to directories or files.

Mode Attributes

id

A valid value for this attribute is a unique series of characters not used for any other mode's id.

Legacy non-SBL modes (e.g. GTA III, GTA VC, GTA v1.0) use only INI files as the source.

extends

A mode can extend another mode (a parent mode) to reduce a number of duplicated properties. It is helpful for different versions of the game where most of the configuration is the same except for a few properties. By extending another mode the mode inherits all its unique properties and can override them with the new values.

The parent can also extend another mode.

A valid value for this attribute is an id of another mode.

title

title defines the mode's displayed name. Due to the interface constraints avoid long names and keep it within the limit of 24 characters.

game

The game attribute defines a target game for the mode. There are 6 valid values:

  • gta3

  • vc

  • sa

  • lcs

  • vcs

  • vc_mobile

  • sa_mobile

Before disassembling or compiling a script, make sure that the correct edit mode is active. Each game has an unique script format and the scripts compiled for one game are not compatible with scripts for another game. Even if the script is compiled without errors, the game would crash trying to read a script in different format.

Sanny Builder displays a game icon in front of the edit mode name so you know the target game.

type

The valid value for this attribute is default. Omit this attribute for non-default modes.

Mode Parameters

arrays

copy-directory

path to a directory where to put a compiled script on Compile + Copy run.

classes

Has an optional attribute autoupdate: autoupdate="yes" - let autoupdate tool replace this file with the latest version from the SBL website

A mode may have multiple <classes> elements.

constants

data

path to the mode directory

enums

Has an optional attribute autoupdate: autoupdate="yes" - let autoupdate tool replace this file with the latest version from the SBL website

A mode may have multiple <enums> elements.

ide

ide element may have an optional base attribute to specify a folder that is used to resolve relative paths in the .dat file.

<ide base="@game:\">default.dat</ide>

Without base all relative paths are resolved starting from the location of the .dat file.

A mode may have multiple <ide> elements.

keywords

labels

missions

library

Has an optional attribute autoupdate: autoupdate="yes" - let autoupdate tool replace this file with the latest version from the SBL website

A mode may have multiple <library> elements.

opcodes

templates

text

path to a .gxt file

<text> has one required attribute: format. The supported values are:

gta3: .gxt has one table, plain keys, ANSI encoding vc: .gxt has multiple tables, plain keys, ANSI encoding sa: .gxt has multiple tables, hashed keys, ANSI encoding sa_mobile: .gxt has multiple tables, hashed keys, UTF-16 encoding

variables

examples

Has an optional attribute autoupdate: autoupdate="no" - exclude this file from automatic SBL update

cleo-default-extensions

path to a file with the list of default extensions enabled when the compiler finds {$CLEO} or {$USE CLEO} directives. Each extension should be listed on its own line.

Built-in Variables

Sanny provides a few variables that can be used in parameters and attributes (if applicable).

Both paths do not include the trailing slash.

Available Modes

Sanny Builder offers many different modes, and their number may vary from version to version:

Title

Id

Naming schema

Parameters order

Game

GTA III

gta3

community

custom

all versions of GTA III

GTA VC (SBL)

vc_sbl

Rockstar

original

all versions of Vice City

GTA VC

vc

community

custom

all versions of Vice City; deprecated in v4.0, use VC SBL instead

GTA SA (v1.0 - SBL)

sa_sbl

Rockstar

original

SA v1.0

GTA SA v1.0

sa

community

custom

SA v1.0; deprecated in v4.0, use SA SBL instead

GTA SA v2.0

sa_v2

community

custom

SA v2.0

GTA SA (v1.0 - SCR)

sa_scr

Rockstar

original

SA v1.0; removed in v4.0, use SA SBL instead

GTA LCS

lcs

Rockstar

original

all versions of Liberty City Stories

GTA VCS (PSP)

vcs_psp

Rockstar

original

VCS for PSP

GTA VCS (PS2)

vcs_ps2

Rockstar

original

VCS for PS2

VC Mobile

vc_mobile

community

custom

VC Android and iOS versions

SA Mobile

sa_mobile

community

custom

SA Android and iOS versions

The naming schema defines the way of describing the opcodes. The community schema has the names randomly guessed over the years, such as actor or thread. The Rockstar schema has the original taxonomy used by the game developers (e.g., char or script) that is consistent with the game's inner structures.

The parameters order defines the way of arranging the opcode parameters. In the custom order the parameter with the higher index may go earlier in the script. This is applicable to community opcode descriptions. The original order has all parameters arranged from the smallest index to the largest index. This goes along with the Rockstar schema to make scripts look like they are meant to be by the developers.

Experimental Modes

Experimental modes provide early access to new features, but not ready for production use and are subject to change without notice.

Experimental modes can be updated and backward compatibility with existing scripts is not guaranteed.

Version 4.1 includes two experimental modes:

  • GTA SA v1.0 - SAMPFUNCS. This mode provides easy way to write scripts using SAMPFUNCS extensions. Currently this extension is undergoing documenting in Sanny Builder Library and some naming conventions are not finalized yet.

Selecting a mode

To change the mode, click at the right bottom corner of the Sanny Builder's main window. A list of the available modes will appear. As you click the mode name Sanny Builder makes all necessary adjustments and you may continue working immediately.

Path: sanny.exe Parameters: -x --no-splash Shortcut: <any combo of your choice>

id is a required and unique identifier of the mode. Sanny Builder uses the id to save some user settings for this mode, e.g. a .

A mode with sbl in the id is called an SBL mode (e.g. GTA SA (v1.0 - SBL) mode has an id sa_sbl). SBL modes use JSON files defined with <library> element(s) as the default source of command definitions. They may also use defined with <opcode> element(s), which are loaded after JSON and take precedence in case of id collisions.

A compiled script file may about which game it is made for. When you open such a script, Sanny Builder prompts you to change the mode to the correct one. Ignoring this prompt may cause a crash of the disassembler, because the script format is unexpected for it.

One mode for each target game must be a default one. It means Sanny Builder uses this mode when run with the --game CLI .

path to

Has a required attribute type: type="scm" - used for regular .scm scripts type="cleo" - used for scripts with {$CLEO}

path to

path to

path to

path to either an .ide or .dat file: .ide files contain game and characteristics .dat files contain paths to other .ide files

path to a list of

path to

path to

path to a JSON file with scripting command definitions used in the target . Available for download in .

path to a file with . Can be used multiple times with different files. This file is optional if you have specified a library path (see above).

path to a file with the mode's

Has a required attribute type: type="default" - path to the predefined templates shipped with Sanny Builder type="custom" - path to a file with user templates added via the form. This file is never overwritten during a Sanny Builder update.

path to

optional path to . Will be autogenerated from library definitions when not set.

@game: - path to the configured in the options @sb: - path to the Sanny Builder directory (where sanny.exe is located)

GTA SA v1.0 - Somersault. This mode provides access to new script compiler toolchain called 'Somersault'. You can learn more about it at . This compiler is in early stage of development.

List of displayed modes can be .

To select the mode using CLI run Sanny Builder with the --mode . To select a default mode for the game, use the --game .

Running Sanny Builder with the -x reloads the modes configuration and updates the list of modes.

You can register a new shortcut to instantly refresh edit modes configuration without having to close Sanny Builder. Add the following configuration in the :

INI files
CustomArrays.ini
classes.db
constants.txt
enums.txt
keywords
CustomLabels.ini
opcodes
exclusive templates
CustomVariables.ini
opcodes.txt
https://next.sannybuilder.com
customized via Options
labels
variables
constants
game
option
option
option
option
option
directive
Add Template
game directory
store information
game directory
model names
missions.txt
Sanny Builder Library
User tools