Scripting Language - hyperbx/SonicNextModManager GitHub Wiki
Simple
BeginBlock("archive")
- Unpacks an archive to a temporary location. This should be used before modifying files inside archives.Rename("old"|"new")
- Renames a file.RenameByExtension("location"|"old"|"new")
- Renames all files with the specified extension to the new extension (must specify a directory, rather than a file).Delete("location")
- Deletes a file or folder.¹Copy("location"|"new"|overwrite)
- Copies a file to a new location, with an overwrite function.EndBlock("archive")
- Repacks an archive from the temporary location created by BeginBlock().
Advanced
DecryptExecutable()
- Decrypts the game's XEX/EBOOT (Xbox 360/PlayStation 3 executable respectively).EncryptExecutable()
- Encrypts the game's XEX/EBOOT (Xbox 360/PlayStation 3 executable respectively).WriteByte("file"|offset|byte)
- Writes a byte to the specified offset in the file.WriteBytes("file"|offset|"bytes")
- Writes a byte array to the specified offset in the file.²³WriteVirtualBytes(offset|"bytes")
- Writes a byte array to the relative virtual address in the executable.²WriteNullBytes("file"|offset|count)
- Writes null bytes to the specified offset in the file.WriteBase64("file"|"data")
- Writes Base64 data to a binary file.WriteNopPPC("file"|offset|count)
- Writes a NOP value to the specified offset at the file path.³⁴WriteVirtualNop(offset|count)
- Writes a NOP value to the relative virtual address in the executable.⁴WriteTextBytes("file"|offset|"text")
- Writes ASCII text in bytes to the specified offset in the file.ParameterAdd("file"|"parameter"|"value")
- Adds a Lua parameter.¹ParameterEdit("file"|"parameter"|"value")
- Edits a Lua parameter.¹ParameterRename("file"|"old"|"new")
- Renames a Lua parameter.¹ParameterErase("file"|"parameter")
- Removes all instances of a parameter from a Lua file.¹PackageAdd("file"|"type"|"friendlyName"|"filePath")
- Adds a PKG event.¹PackageEdit("file"|"type"|"friendlyName"|"filePath")
- Edits a PKG event.¹PackageErase("file"|"type"|"friendlyName")
- Removes all instances of a parameter from a PKG file.¹TextAdd("file"|"name"|"placeholder"|"text")
- Adds an MST entry.¹TextEdit("file"|"name"|"placeholder"|"text")
- Edits an MST entry.¹StringReplace("file"|"old"|"new")
- Replaces a string.¹
- works recursively (if no file name is specified and the path exists, it will process the function for every file in the directory).
- array is accepted with or without spaces.
- deprecated for writing to the executable - use the virtual versions of the functions instead.
- count is optional.
Flags
All Systems:
- Specifies that the below code is for All Systems.Xbox 360:
- Specifies that the below code is only for the Xbox 360.PlayStation 3:
- Specifies that the below code is only for the PlayStation 3.Ignore("string0"|"string1"|..)
- Tells the directory iterator to ignore file names containing these strings.Search("string0"|"string1"|..)
- Tells the directory iterator to search for file names containing these strings.
Examples
NOTE: core
is automatically replaced with the detected system (xenon
/ps3
).
Simple
BeginBlock("core\archives\player.arc")
Rename("core\sound\HD_SEGA.wmv"|"core\sound\bruh.wav")
RenameByExtension("core\sound"|"*.xma"|".xma_back")
Delete("core\sound\stg_twn_shop.xma")
Copy("core\sound\shadow_theme.xma"|"core\sound\theme_shadow.xma"|true)
EndBlock("core\archives\player.arc")
Advanced
DecryptExecutable()
DecompressExecutable()
WriteByte(Executable|0xB10DB3|0x29)
WriteBytes(Executable|0x510A4|"00 FF 19 4A")
WriteVirtualBytes(Executable|0x824E0A4|"00 FF 19 4A")
WriteNullBytes(Executable|0x6852A|57)
WriteTextBytes(Executable|0x365AA|"csc/scene_csc_a.lua")
WriteBase64("core\shader\std\BurnoutBlurFilter.fxo"|"soMEBasE64stRINgtHAtIsTOoLoNGtOfiTINThIsexAMPLe==")
WriteNopPPC(Executable|0x217710|5)
WriteVirtualNop(Executable|0x82214710|5)
ParameterAdd("core\player\snow_board.lub"|"c_hair"|"{ "SomeHairBone" }")
ParameterEdit("core\player\amy.lub"|"c_jump_run"|"9 * (meter / sec)")
ParameterRename("core\player\silver.lub"|"c_jump_run"|"c_jump_banana")
ParameterErase("core\player\silver.lub"|"c_jump_banana")
TextAdd("core\text\english\msg_mainmenu.e.mst"|"banana"|"picture(button_a)"|"$ this is pointless")
TextEdit("core\text\english\msg_mainmenu.e.mst"|"kingdomvalley"|""|"TOTALLY A LEGIT STAGE")
PackageAdd("core\player\sonic_new.pkg"|"motion"|"thing"|"player/sonic_new/blah.xnm")
PackageEdit("core\player\snow_board.pkg"|"motion"|"against"|"player/sonic_new/so_brd_collision_Root.xnm")
StringReplace("core\player\sonic_new.lub"|"other_module_sonic_homing"|"other_module_blaze_homing")
Flags
All Systems:
DecryptExecutable()
Xbox 360:
WriteByte(Executable|0xB10DB3|0x29)
PlayStation 3:
WriteByte(Executable|0xC1837A|0x32)