Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  

[Sanny] Custom Edit Modes

Recommended Posts


I'm working towards building custom edit modes that can support SA PS2 and mobile versions for III and VC, but first I wanted to bring my SA Mobile mode up to speed with PC, and that means finally straightening out the global variable names.


SA Mobile - Standard Files v3.2.2

SASCM.ini - opcode processing

opcodes.txt - Opcode Search text

custom.dat - loads IDE files for model ID numbers

default.ide - loaded by custom.dat

peds.ide - loaded by custom.dat
vehicles.ide - loaded by custom.dat
veh_mods.ide - loaded by custom.dat

CustomVariables.ini - Format option: Custom Variable names
keywords.txt - shortcuts for common opcodes
missions.txt - original mission names option
american.gxt - standard file, adds comment strings for GXT keys






SA Mobile - Test Files

SASCM.ini - CleoA update

opcodes.txt - CleoA update

custom.dat - with IDE lines from default.dat and gta.dat (see below)


maps\*\ *.IDE

CustomVariables.ini - matching all common Variable names with PC

CustomLabels.ini - matching Labels with PC

CustomArrays.ini - matching Arrays with PC

american.gxt - looks like this file gets updated with patches






802  12 Girl_Weapons
1219 8 Airport_Gates



This is just the IDE lines taken from default.dat and gta.dat. These could be read automatically if SA Mobile's game directory is set to Sanny's data\SA Mobile folder, but that seems like an awkward place to sync my compiled and copied scripts. And these files seem more appropriate under the custom edit mode folder anyway.


Update: Since SA Mobile doesn't Compile + Copy it would probably be easier to simply set the game folder to Sanny's edit mode's data folder and manage file copying manually than trying to manage a custom.dat file..





# Object types

### GTA.DAT ####
# Object types
IDE DATA\MAPS\generic\vegepart.IDE
IDE DATA\MAPS\generic\barriers.IDE
IDE DATA\MAPS\generic\dynamic.IDE
IDE DATA\MAPS\generic\dynamic2.IDE
IDE DATA\MAPS\generic\multiobj.IDE
IDE DATA\MAPS\generic\procobj.IDE
IDE DATA\MAPS\vegas\vegasN.IDE
IDE DATA\MAPS\vegas\vegasS.IDE
IDE DATA\MAPS\vegas\vegasE.IDE
IDE DATA\MAPS\vegas\vegasW.IDE
IDE DATA\MAPS\vegas\vegaxref.IDE
IDE DATA\MAPS\country\countryN.IDE
IDE DATA\MAPS\country\countN2.IDE
IDE DATA\MAPS\country\countryS.IDE
IDE DATA\MAPS\country\countryE.IDE
IDE DATA\MAPS\country\countryW.IDE
IDE DATA\MAPS\country\counxref.IDE
IDE DATA\MAPS\interior\int_LA.IDE
IDE DATA\MAPS\interior\int_SF.IDE
IDE DATA\MAPS\interior\int_veg.IDE
IDE DATA\MAPS\interior\int_cont.IDE
IDE DATA\MAPS\leveldes\levelmap.IDE
IDE DATA\MAPS\leveldes\levelxre.IDE
IDE DATA\MAPS\interior\gen_int1.IDE
IDE DATA\MAPS\interior\gen_int2.IDE
IDE DATA\MAPS\interior\gen_intb.IDE
IDE DATA\MAPS\interior\gen_int3.IDE
IDE DATA\MAPS\interior\gen_int4.IDE
IDE DATA\MAPS\interior\gen_int5.IDE
IDE DATA\MAPS\interior\savehous.IDE
IDE DATA\MAPS\interior\stadint.IDE
IDE DATA\MAPS\leveldes\seabed.IDE

# interiors
IDE DATA\MAPS\interior\props.IDE
IDE DATA\MAPS\interior\props2.IDE
IDE DATA\MAPS\interior\propext.IDE

# vehicle upgrade models
IDE DATA\MAPS\veh_mods\veh_mods.IDE

# txd parents




The data\maps\ files are contained within main.8.com.rockstargames.gtasa.obb. Rename a copy of the file to a zip extension to extract. patch.8.com.rockstargames.gtasa.obb holds the files from the \data directory.


Update: I ran WinMerge on my IDE files for PC and SA Mobile and the files are nearly identical. The only differences are to a handful of draw distance figures. The object IDs are all the same, which suits this purpose nicely. PCv1 and PCv2 are identical. I know from previous experience that many of the PS2 object IDs don't always match with PC.


american.gxt seems to be locked away in an APK file somewhere. I'm still not sure how to get at it.


Cleo for Android Opcodes and Text


SASCM.ini supplement - append to the end of file.




0DD0=2,%1d% = get_label_addr %2p% ; android
0DD1=2,%1d% = get_func_addr_by_cstr_name %2d% ; android
0DD2=1,context_call_func %1d% ; android
0DD3=2,context_set_reg %1d% value %2d% ; android
0DD4=2,%1d% = context_get_reg %2d% ; android
0DD6=1,%1d% = get_game_version ; android
0DD7=1,%1d% = get_image_base ; android
0DD8=4,%1d% = read_mem_addr %2d% size %3d% add_ib %4d% ; android
0DD9=5,write_mem_addr %1d% value %2d% size %3d% add_ib %4d% protect %5d% ; android
0DDC=2,set_mutex_var %1d% to %2d% ; android
0DDD=2,%1d% = get_mutex_var %2d% ; android
0DE0=3,%1d% = get_touch_point_state %2d% mintime %3d% ; android
0DE1=5,%1d% = get_touch_slide_state from %2d% to %3d% mintime %4d% maxtime %5d% ; android
0DE2=1,%1d% = get_menu_button_state ; read opcode info before using ; android
0DE3=2,%1d% = get_menu_button_pressed mintime %2d% ; read opcode info before using ; android



opcode.txt supplement - append, no need to sort




0DD0: [email protected] = get_label_addr @label ; android
0DD1: [email protected] = get_func_addr_by_cstr_name "test" ; android
0DD2: context_call_func 0x0000DEAD ; android
0DD3: context_set_reg [email protected] value 5 ; android
0DD4: [email protected] = context_get_reg [email protected] ; android
0DD6: [email protected] = get_game_version ; android
0DD7: [email protected] = get_image_base ; android
0DD8: [email protected] = read_mem_addr 0xFADE size 4 add_ib 0 ; android
0DD9: write_mem_addr 0xFADE value 1 size 1 add_ib 0 protect 1 ; android
0DDC: set_mutex_var 1 to 5 ; android
0DDD: [email protected] = get_mutex_var 3 ; android
0DE0: [email protected] = get_touch_point_state [email protected] mintime [email protected] ; android
0DE1: [email protected] = get_touch_slide_state from [email protected] to [email protected] mintime [email protected] maxtime [email protected] ; android
0DE2: [email protected] = get_menu_button_state ; read opcode info before using ; android
0DE3: [email protected] = get_menu_button_pressed mintime [email protected] ; read opcode info before using ; android





Edited by OrionSR
Code Tags
  • Like 3

Share this post

Link to post
Share on other sites

New Edit Mode - SA PCv2


I've been experimenting with new edit modes with some unexpected results, but I figured I'd cover an easy one before wrestling with some new ideas. San Andreas Version 2 for PC is almost the same as v1. The major difference for Sanny is that the custom label offsets are different. CustomLabels_v2.ini is already provided standard, so this is basically a copy and paste operation.


Copy Sanny's data\sa folder to data\sapcv2

Rename CustomLabels.ini to CustomLabel_v1.ini

Rename CustomLabels_v2.ini to CustomLabel.ini

* You can also change the <variables> file used in games.xml, but I kept editing the wrong file.


Open games.xml located in Sanny's data folder.

Append this edit mode just before </games> at the end of the file.

   <game shortcut="PCv2" title="SAPCv2" mode="sa" type="">

Save the changes and (re)start Sanny. The new edit mode should be available on the list in the lower right corner.

Edited by OrionSR
Code Tags

Share this post

Link to post
Share on other sites

Unexpected - Quirks of Sanny's Edit Modes

Maybe I'm just not thinking about this correctly, but what I hoped to accomplish isn't as easy as I had hoped. This is a collection of notes and frustrations.

Mandatory Game Folder: Sanny insists or setting a game folder for each edit mode. With the SA Mobile edit mode all self-contained nothing should need to be read from this folder, and nothing would get written to this folder in SA Mobile mode anyway.

No Custom.dat for SA Mode: I wanted to make a self-contained PC edit mode, for a laptop without the full game for example, but can't use custom.dat to specify where to look for data fies using the standard "sa" mode.

No Compile + Copy in SA Mobile Mode: When I switched my self-contained PC edit mote to SA_Mobile to take advantage of custom.dat I lost the ability to use compile and copy to a sync or cloud folder.

File comparison of the IDE files of PCv1. PCv2, and SA Mobile show these files are nearly identical. Only a few draw distance values have been increased in Mobile, the ID values are the same. So rather than maintain a separate IDE archive for each version I'm looking for ways to share the data files. Setting the game folder to a single archive is the easy strategy for now, and avoids all the hassle of editing the paths in a custom.dat file.


I was hoping this line in games.xml would let me specify a data folder for IDE and DAT files but so far opcode.txt is the only file I can find that reads from that folder. It looks like the other Sanny files have specific lines of their own anyway.

It's starting to look like the easiest way to manage the IDE files is to simply set the game folder as required and skip managing custom.dat altogether. It doesn't really matter if I use "sa" mode or "sa_mobile" as I'll need to manage my scripts manually.

I think what would help the most is a way to separate the compile and copy folders from the data folder to be read. A system that worked well for PC only doesn't quite fit the strategies needed for managing multiple systems and edit modes.

So with than in mind I think I'll skip trying to post new edit modes for now. I'm not sure how I want to use the tools I have available. My PS2 disks just finished copying so I'll run a compare tool on the IDE files and see how different they really are. Then I'll see if I can crank out a few CustomVariable.ini ports.

IDE File Comparison

PCv1, PCv2 and Android: Identical ID numbers, slight differences in many mobile draw distance values.
PS2v1 and PS2v2: Identical except for significant changes to VEGASE.IDE

PCv2 and PS2v2:

data\ all identical including default.ide, peds.ide and vehicles.ide
data\maps\veh_mods\veh_mods.ide identical
data\maps\generic\ identical except for a flag in dynamic.ide
data\maps\interior\ prop*.ide have flag changes, stadint.ide is identical

Otherwise, some match, others don't, and the changes are often significant.

Edited by OrionSR
  • Like 1

Share this post

Link to post
Share on other sites

Edit Mode - San Andreas PS2v1


I suspect that not many people are likely to use PS2 edit modes but here they are anyway.

Both edit modes are sa so set the game directory to the edit mode folder,

Or change the mode to sa_mobile and move american.gxt to the edit mode root.




CustomArrays.ini - no change needed from PC

sascm.ini and opcodes.txt - strip all cleo opcodes



Edit Mode - San Andreas PS2v2





807  12 Girl_Weapons
1199 8 Airport_Gates

sascm.ini and opcodes.txt - strip all cleo opcodes

sascm.ini - add opcode 0A4F: (unknown, seen in PS2v2 and Xbox)




CustomVariables.ini for GTA3 Mobile


I won't be able to put together a considered Edit Mode for GTA3 anytime soon, but I made significant progress of porting the full "original" variable name list from PC to Android. When Sanny is set with local offsets and matching GXT files I get a very high degree of correspondence when comparing decompiling results using WinMerge.


The rather incomplete variable lists for San Andreas make direct comparison rather difficult. I'm not sure how to increase my confidence in the conversion without rounding out the SA variable list considerably. When I pick up this project again I'm hoping to start naming things based on the conventions used in GTA3.

Edited by OrionSR
Code Tags

Share this post

Link to post
Share on other sites

Edit modes got many enhancements recently so this topic needs an update.

Share this post

Link to post
Share on other sites
On 8/26/2020 at 8:51 PM, Seemann said:

Edit modes got many enhancements recently so this topic needs an update.

Yeah it does. I've been working on updating my custom edit modes with the new enhancements and will attempt to blog my progress.


A good place to start is with a GTA Script Archive which includes all the main.scm files for each version that I've been able to identify.


Game versions included in this archive:



  • Steam - all PC
  • PS2
  • iOS
  • ARM - Android

Vice City

  • Steam - all PC
  • PS2
  • ARM - Android

San Andreas PC

  • PCv1
  • PCv2
  • Steam - same as PCv2

San Andreas PS2

  • PS2v1
  • PS2v2 - same as PS4
  • PS2_JP1 - Japan v1

San Andreas Mobile (mobile versions are save compatible between iOS, Android and WinStore)

  •  iOS - early unknown version
  • APK103 - Android
  • APK105 - Android
  • APK106 - Android
  • APK107 - Android
  • APK108 - Android (previous long-lived release)
  • APK200 - Android 
  • WinStore

San Andreas Remastered 

  • WinStore - unused
  • PS3
  • Xbox360 - same as Xbox One?

Liberty City Stories

  • PS2
  • PSP

Vice City Stories

  • PS2
  • PSP


If anyone would like to offer original scripts for versions not included in this archive, I also need some additional files to support an edit mode. I'm looking for everything in the DATA and TEXT folders. What I need are the DAT and IDE files in DATA and MAPS, and american.gxt from TEXT, but the other files are nice to include in a larger reference archive.

Edited by OrionSR

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.