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

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

OrionSR

Introduction to SA Chain Game Style Save Editing - Mobile/PC

Recommended Posts

OrionSR

I'm moving this conversation from PM to the open forums.

I still need to clean up the posts and add clarification.

 

Introduction to SA Chain Game Style Save Editing

 

Requirements: Ability to apply basic algebra to story problems.

Recommended: Some experience using spreadsheets.

 

Notice: "Save Editing" implies permanent changes to your saves. Most of the changes applied by the cleo scripts and other strategies in this topic will persist if you save the changes "even if the scripts are disabled." Most codes are intended to be executed only once per save, but no attempt is made to track these changes with thread saving, global variables, cleo variables, or anything else. It's up to the user to make sure that pickups, car generators, radar blips, objects. threads, and other modifications are not added to the save over and over again.

 

The current discussion is on applying successful save editing strategies on PC to SA Mobile saves, but anyone interested in using the same strategies for PC save editing is welcome to join the conversation. The Chain Game "style" describes a certain feature set applied to the custom saves used in the San Andreas Chain Game. For the most part the examples I post in this topic are lifted directly from the CG starter saves, but users are encouraged to modify these strategies for their own amusement.

 

Contents: Strategies for Save Editing

 

Hex Editing - working as expected on PC, Android, iOS

Save Editors - mobile saves are incompatible with editors for PC saves.

Custom Text IPL files - working with some modification on Android. (updates needed)

Cleo for Android - working as expected. All Cleo3 scripts need adjustment for mobile.

Cleo4 - seems to run my cleo3 scripts correctly in limited testing.

Sanny Builder Updated - Currently I can't recompile original scripts. Newly compiled custom missions crash the game.

Game Memory - unknown status of memory operations in current version of Cleo for Android and SA Mobile memory structure.

 

And... I'll try to expand on this later once I get the current content posted.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Hex Jargon

0x - designates this number as a hexadecimal value. Decimal numbers are written in common notation without designation. Leading zeros can be dropped, but for clarity I usually include all digits in the byte, word, or dword (0x0A instead of 0xA, or 0x0123 instead of 0x123). FYI, "h" at the end of a number also designates a hex value, but around here that format is seldom used (0xC0DE = C0DEh).

Hexadecimal - digits include 0 through F (A is after 9 and equivalent to ten). 0x0F + 0x01 = 0x10

Bit - the smallest unit in binary computing. The value can only be 0 (false) or 1 (true).
Nibble - half of a byte (a single digit), 4 bits. This is included for completeness. The term is seldom used.
Byte - 8 bits. Written as two hex digits. Values range between 0 and 255.
Word - Two bytes.
Dword - Four bytes.
Float - Four bytes. IEEE 754 encode values that may include decimals, or very large and very small numbers.

String - text usually limited to alphanumeric characters, 7 bytes and a null terminator ("_" is used for a space).
Null terminator - an empty byte (00) marking the end of a string.

IEEE Floating Point Calculator - used for converting between hex and decimal floating point values.
Windows Calculator - Scientific or Programmers option (depending on Windows version). Convert hex and decimal integers.

Bytes, words, and dwords are integer values and can be signed or unsigned (it's often hard to tell in SA). Signed bytes use the uppermost bit to designate that the number is negative, so the values will range from -128 to 127. Setting an unsigned byte to -1 will max out it's value (0xFF, 255), one of the tricks of the trade.

San Andreas (it's probably more hardware/OS dependent) uses reverse byte ordering when encoding numbers. The advantage of this method is that the number always begins in the same location no matter it's length. The problem is that you will need to switch the order of bytes in words, dwords, and floats in order to perform calculations. Reverse ordered numbers are denoted with a space between the bytes, like they are in the editor.

Word: 0xc0de = DE C0 (caps are common but it doesn't matter)
Dword: 0x011a97D9 = D9 97 1A 01
Float: 0x42F6CCCD = CD CC F6 42
^After a while you will learn to recognize the most of the SA floats start with 4 (positive) or C (negative).

You will likely be tempted to work with decimal numbers as much as possible, but I encourage you to work with the native formats whenever possible. The challenge here is to develop "number concepts" for hexadecimal numbers. It's the same sort of challenge presented to very young students (age 4+) for decimal numbers. For example, your mind's eye can see "ten" as 10, or two hands with 5 fingers. Ten people is a lot to have over for dinner - that sort of thing. But now you are trying to do that again with a less flexible brain. It takes some time, but eventually you should be able to do simple calculations in hex without a calculator, and make a reasonable estimate about how large a hex value is.

Okay, we need an actual project to put this information to use. Unless you suggest another idea I'm going to start on something from the Chain Game features. Perhaps moving the hidden Doherty bribe back over the broken bridge near Palomino Creek where it belongs, or moving the airstrip hunter so it and the leviathan can spawn at the same time.

Chain Game - Detailed List of Added Features.


Addresses and Offsets

I am not terribly confident that the language I choose and concepts described are completely accurate in a greater context than San Andreas, but it should be consistent with existing documentation and application. You may want to continue your research on the web and get a broader perspective. There is much better documentation online for some of this stuff than I can offer.

An address is a specific location in memory. If you had a save dump of game memory (the 1st bit in this file needs to be at address 0 so everything aligns exactly, some memory dumps have a little extra data that needs to be trimmed out) and viewed it in memory then you could view a particular memory address using the Goto tool.

Hypothetical:

Let's say we find the (game memory) address of the car generator pool in documentation somewhere. We jump to that address and find a little information that doesn't appear to be an actual cargen, but a few bytes to the right we recognize what is clearly the beginning of our first parked car. The number of bytes between our starting address and the start of the first cargen record is the offset to the cargen structure.

Start of GarGen Data 0xABCD00000x00 byte [6] unknown0x06 cargen structure[unknown number of records]----

And that's all we've got for now. You could probably jump to the save file documentation and start filling in the missing pieces but... I'm making this up to make a point. No where in the save documentation will you find an absolute address - an offset from the beginning of the file.

To start with, the first 5 bytes is the first BLOCK marker. These are ignored. The first thing listed in block 0 offset 0 is the version ID.

0x0000     dword     version ID (checksum of a string describing the time of compilation)

At first that might seem dumb. Absolute addresses should be much easier to work with. The problem is that several blocks might change size, including block 1, so only the first two BLOCKs will ever be in the same location on all saves. Everything else will always be relative to the address after K of that block. We cheated a bit when calculating the location of global variables which are located near the beginning of block 1, so they are always found at the same address.

http://gtasnp.com/download/42763

Above is an unmodified In the Beginning PCv1 save created using the ShowSaveScreen mod in the Jefferson Alley. This leads to a few stray burglary enexes cluttering the end of the enex block but otherwise stats and everything are super-clean. Use this as an example that should match documentation and compare that with what you see in an Android save. Most of the time you'll find that the documentation would be just fine if you added 2 after all of the offsets every time you see a DE C0, and there are an awful lot of c0des so it's a pain in the ass, sorry.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

This was probably the wrong place to start. Consider returning to this project after making a few tweaks to some simple flags in global variables.

 

Goal: Move the airstrip Leviathan so it doesn't block the Hunter from spawning. This edit was selected because car generators are more difficult to modify with cleo than other structures. To make testing easier, you might want to save at the airstrip first.

014B: $3722 = init_car_generator #LEVIATHN color -1 -1 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 383.178 2538.891 16.53 angle 180.0

This is the iOS code that creates the airstrip Levi. $3722 is a global variable (designated by the $ at the beginning) that will record the index (slot number) of this vehicle so it can be hidden or displayed by the scripts. We need the value of this global variable in order to calculate it's position in the car generator block. Each global variable is 4 bytes in size, so if we start at the beginning of the global variable space ($0) and Goto (Alt-G) 3722 * 4, then we can find the value we need.

 

Since block 0 is always the same size, $0 will always be in the same location. So instead we can add the offset to $0 to our calculated value to get the offset to the global start from the beginning of the file. The operation order might seem to be a bit odd, but it simplifies things if we can work without parenthesis.

 

Absolute global variable offset = global variable number * 4 bytes + offset to $0

Offset = 3722 * 4 + 0x01BE

Offset = 14888 + 446

Offset =dec2hex(15334) = 0x3BE6

^the blue part is a spreadsheet function

 

Using HxD, Goto 3be6 (without the 0x designation, check hex, relative to begin). I found 2C 00 00 00. Reverse the bytes to 0x0000002C, drop the leading zeros (0x2C) and convert to decmal (44 =hex2dec(2C)). Don't worry if your value doesn't match the save I'm using as an example.

 

The next step is to find the starting offset of the car generator record we want to edit. The size of block 1 tends to change as the story progresses when new "threads" are launched (schools, imports, etc) and block 2 changes size as objects are added or destroyed, so for everything except for globals and block 0 we'll be working with relative offsets.

Block 12: Car Generators0x00 dword count0x04 byte unknown counter (0..3)0x05 byte unknown counter (0..20); when it's non-zero, the game doesn't check the timer (0x16)0x06 CarGen[count] see details below

First let's find block 12. Each block starts with a "BLOCK" text string so they are easy to find. Repeat the search (F3) until you find the 13th block (12 counting from 0). After the K is a c0de word (two bytes written as DE C0) not included in PC files, the dword count of cargens, and two more sets of c0de words followed by unknown counter bytes for a total of 12 (0x0C) bytes. Next is the start of the cargen record. Each record is 38 (0x26) bytes in length.

 

You might think 44 * 38 but notice the index of the first cargen. It probably isn't at index 0 since there are often other parked cars spawned in the area when the intro mission dumps all the vehicles in. In my example I get 0x23, or 35. So 44 - 35 should give us the proper multiplier to find the correct location.

 

(44-35) * 38 = 342 = 0x156

 

Put the cursor after the K in BLOCK, click and drag to highlight 0x0C bytes (since HxD shows the length in hex). Click at the end to mark the start of the first record. Goto offset 0x0156 from the current offset to find the beginning of the Leviathan record. The first two bytes again are a c0de word, then the index word. The index should match what was found in global $3722. As a secondary check, after the index is another c0de word and then the model word, A1 01. Look up the car digits for the Leviathan in this PS2 reference since it's already encoded in hex and we find 1A1 (0x01A1), which matches the data I found.

 

The start of the model number marks the end of the extra c0de words in the mobile version data. The next two bytes specify the colors, then the coordinates are recorded in three words. The coordinates used to create the cargen are 383.178 2538.891 16.53, with decimals, so a 4 byte float is normally used, but the coordinates are encoded as signed words, probably to save space. Let's take a closer look at my data.

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F0001F500 C0 2B 00 DE C0 0A 02 FF FF B3 24 C2 2A 51 00 C9 À+.ÞÀ..ÿÿ³$Â*Q.É0001F510 00 00 12 00 00 10 27 00 00 59 02 00 00 FF FF 00 ......'..Y...ÿÿ.0001F520 00 00 01 00 00 DE C0 2C 00 DE C0 A1 01 FF FF F9 .....ÞÀ,.ÞÀ¡.ÿÿù0001F530 0B 57 4F 84 00 80 00 00 12 00 00 10 27 00 00 59 .WO„.€......'..Y0001F540 02 00 00 FF FF 00 00 00 01 00 00 DE C0 2D 00 DE ...ÿÿ......ÞÀ-.Þ0001F550 C0 2C 02 FF FF 20 54 B0 CB 4B 00 7F 00 00 1A 00 À,.ÿÿ T°ËK......0001F560 00 10 27 00 00 59 02 00 00 FF FF 00 00 00 01 00 ..'..Y...ÿÿ.....

The only complete record here is for the Levi, but I included most of the before and after records for reference.

 

The X coordinate for the Levi is F9 0B ~> 0x0BF9 ~> 3065 / 8 = 383.0. The decimal portion was rounded off. Android may round numbers a little differently than PC, PS2 sometimes does. The Chain Game saves have been using 386.178 without problems. 386.178 * 8 rounds to 3089 ~> 0x0C11 ~> 11 0C. Change F9 0B to 11 0C and save.

 

Let's skip a step and screw it up so you know what it looks like. Try to load your save. More than likely it will display a Save Is Corrupt message since the data was changed without recalculating the checksum at the end of the file. After fixing the save you'll probably need to restart or load a different save before the game will notice the change.

 

The checksum is a dword at the end of the file. Replace all 4 bytes with 00 00 00 00 so there are no bits to sum. Then fire up HxD's Analysis > Checksums... tool. Choose checksum-32 on the entire file. Record this value in reverse byte order, save, and try again. Hopefully everything works this time and you can run off and check up on the Levi and Hunter.

 

Now that all the calculations are done we can make this change much more quickly. Just use search "A1 01 FF FF F9 0B 57 4F 84 00 80 00" and replace "A1 01 FF FF 11 0C 57 4F 84 00 80 00" and fix the checksum. Rounding differences might mess up the search string but otherwise this should work for all versions.

 

Your mission, should you choose to accept it, is to apply the techniques above using new data. I'll supply the relevant values for now.

//PDE/CG20: Original Bike School Rewards, tweaked for concurrent existence// 1175.76 1364.832 10.1203 angle 280.0355 // Bike School Bronze (nudged)// 1175.999 1368.4 10.1203 angle 282.2258 // Bike School Silver (nudged)// 1175.967 1372.0 10.1203 angle 283.0546 // Bike School Gold (nudged)014B: $3579 = init_car_generator #FREEWAY color -1 -1 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 1174.76 1364.832 10.1203 angle 280.0355 014B: $3580 = init_car_generator #FCR900 color -1 -1 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 1174.999 1366.479 10.1203 angle 282.2258 014B: $3581 = init_car_generator #NRG500 color -1 -1 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 1174.467 1368.359 10.1203 angle 283.0546 

Hm... I'm not sure why pdescobar changed the X coordinates. You might try changing just the Y coord and see how it looks. If it's okay then you may not need to change the position of the Freeway at all. Or, do the calculation once and use the same value for all three. The fine detail is going to get rounded anyway. Also, these vehicles will be sequential, so once you find one you'll be right next to the others.

Share this post


Link to post
Share on other sites
OrionSR

Enex Redirection - ENtrance/ EXit, ENEX, enexes

 

San Andreas Enex Documentaion (google "enex docu" if you want to find it quickly)

 

 

Post 3 of the Enex Documentation shows new save enex info, with other information added. Use this reference for now.

 

15 0F 00 04 00 60 01 SVLASM LAs2 Willowfield_Safe_House
15 is the decimal index and not part of the save data. 0F 00 is the index of the Willowfield safehouse door, 04 00 are the flags (this door is locked), and 60 01 is the index of it's destination. Scroll down to index 60 01 to find which interior it connects to normally.

 

352 60 01 00 40 12 00 SVLASM savehous.ipl Jefferson_Int
This interior currently is set to send CJ to the Jefferson exterior, but when it gets used from Willowfield the game will change it's destination to that index, the most recent used. This is how the game is able to share one interior in multiple locations. Let's change Willowfield into an Armory. We will reuse the LA Big House for all armories. It has a wardrobe and lots of space to put things. We can move a save disk to this location later.

 

350 5E 01 00 40 FF FF SVLABIG savehous.ipl Removed_Mulholland?
The FF FF (often signifies -1, disabled) at the end here indicates that this connection is not currently connected to another enex. This isn't a problem since CJ isn't current inside and this destination will get updated to the new source when access from outside. What we need is the index (5E 01). This will be the new destination for the Willowfield enex.

 

Search for "BLOCK" 25: Enex. This is one of those situations where the stuffed full of c0de words that need to be ignored. Here's the Willowfield record from your 100% save. (Note: to hex search for a particular enex index when you can't be sure of the flags, include the destination of the previous source in the search string. DE C0 0F 00 DE C0 is unlikely to be unique, but DE C0 FC 00 DE C0 0F 00 DE C0 should find the right spot.)

 

DE C0 0F 00 DE C0 04 40 DE C0 60 01
So, ignore the DE C0s. 0F 00, this is the right source index. This property is unlocked now (40). 60 01, confirmation, this is the destination we were expecting. Change 60 to 5E. Checksum fix and test.

 

Below is the entire Enex subroutine from our Chain Game creation custom mission. The basic flow of this script is from top to bottom; read some information required for the calculations, then set the variables for a particular enex. The script goes to a subroutine (gosub) that makes the changes based on those variables and returns to run whatever follows the gosub, in this case another set of variable gets sent for tweaking. The Return at the end of the Tweaked Flags section returns the enex subroutine to the main part of our custom script where it was called - this main part is not shown.

 

The important information here are the source and destination indexes for all of our tweaked enexes. I was going to post just the indexes but figured I may as well post everything in one place, and give you a peek at what a cleo script looks like. Anything that follows a // is a comment. Lines that start with : are labels, a destination for a jump or gosub. The hex words followed by a : are the opcodes. Numbers followed by @ are local variables (accessible only from this script). Most text in a code line is decoration, words that make the command easier to understand.

 

//RBR/CG37: ------------------ Enex ------------------------:CG_Enex0A8D: [email protected] = read_memory 0x0096a7d8 size 4 virtual_protect 0 // pointer to pointer to enex data 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0       // start of enex data0001: wait 0 ms// ------------ Warps ------------0006: [email protected] = 17       // source index           // LS Sub-Urban in Jefferson0006: [email protected] = 127      // destination index      // ^ warp to LVn Sub-Urban 0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 127      // source index           // Sub Urban in Creek0006: [email protected] = 17       // destination index      // ^ warp to LS Sub-Urban in Jefferson 0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 41       // source index           // LS Victim in Rodeo0006: [email protected] = 81       // destination index      // ^ warp to SF Victim Financial 0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 81       // source index           // SF Victim in Financial0006: [email protected] = 41       // destination index      // ^ warp to LS Victim in Rodeo0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 101      // source index           // SF Binco on Juniper Hill0006: [email protected] = 166      // destination index      // ^warp to North Strip Binco0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 166      // source index           // North Strip Binco0006: [email protected] = 101      // destination index      // ^ warp to SF Binco in Juniper Hollow0006: [email protected] = 0x4066   // flags                  // (allow cars and bikes)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 211      // source index           // Montgomery Pizza (unmarked)0006: [email protected] = 201      // destination index      // ^ warp to Angel Pine 24-70006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 201      // source index           // Angel Pine 24-70006: [email protected] = 211      // destination index      // ^ warp to Montgomery Pizza0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 9        // source index           // Unity 24-70006: [email protected] = 180      // destination index      // ^ warp to Unmarked El Que Barber0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 180      // source index           // Unmarked El Que Barber0006: [email protected] = 9        // destination index      // ^ warp to Unity 24-70006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect// ------------ Armories ------------0006: [email protected] = 58       // source index           //  Queens Hotel Save0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory//RBR/CG37: Queens property has to be purchased before armory can be used, as in previous rounds//0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0006: [email protected] = 0x0004   // flags                  //  (locked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 39       // source index           //  Mulholland West 24-70006: [email protected] = 350      // destination index      //  ^connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 83       // source index           //  SF Tower Top0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 53       // source index           //  Unrestricted Bayside Burglary0006: [email protected] = 350      // destination index      //  ^connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 144      // source index           //  Caligula's Roof North0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 244      // source index           //  Caligula's Penhouse to Rooftop0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 218      // source index           //  Whetstone Farmhouse0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 188      // source index           //  Generator Room (in)0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect//OSR/CG101: Willowfield Armory0006: [email protected] = 15      // source index            //  Willowfield Safehouse0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory//0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0006: [email protected] = 0x0004   // flags                  //  (locked, exterior)0050: gosub @sub_CG_Enex_Redirect//RBR/CG37: Add entrance marker for Sherman Dam Armory// Note: Millie's exit marker probably won't be displayed in the game (when getting the keycard).// Update: only one airport marker seems to be displayed at one time, so we might not lose Millie's marker after all// Update: we don't lose Millie's exit marker.0A40: [email protected] = create_entrance_marker_at -594.97 2018.07 61.25 color 14  // Generator Room (in) // ------------ Unused Interiors ------------0006: [email protected] = 207      // source index           //  Dillimore Police Department0006: [email protected] = 312      // destination index      //  ^ use SFPD Interior0006: [email protected] = 0x4104   // flags                  //  (unlocked, NPC Group, exterior)0050: gosub @sub_CG_Enex_Redirect   // ------------ Tweaked Flags ------------// Will adjust all links with a matching name098E: unknown_set_interior 'GYM1' bitmask 256 flag 1    // LS Gym, accept NPC group 098E: unknown_set_interior 'GYM2' bitmask 256 flag 1    // SF Gym, accept NPC group 098E: unknown_set_interior 'GYM3' bitmask 256 flag 1    // LV Gym, accept NPC group 098E: unknown_set_interior 'CARTER' bitmask 256 flag 1  // Smoke's Palace, accept NPC group 098E: unknown_set_interior 'POLICE2' bitmask 256 flag 1 // SFPD at Dillimore, accept NPC group 098E: unknown_set_interior 'P69_ENT' bitmask 32 flag 1  // Enable for cars and aircraft098E: unknown_set_interior 'P69_ENT' bitmask 64 flag 1  // Enable for bikes and motorcycles0051: return//RBR/CG37: ------ Subroutines used by :CG_Enex ------:sub_CG_Enex_Redirect// change the destination of an enex. Uses:       // enex, block 25// [email protected] = pointer to pointer to enex data         // read once early in mission// [email protected] = start of enex data                      // read once early in mission// [email protected] = source index                            // set before gosub// [email protected] = destination index                       // set before gosub // [email protected] = source flags                            // set before gosub     // [email protected] = start of source// [email protected] = address of destination pointer// [email protected] = start of destination// [email protected] = address of source flags0085: [email protected] = [email protected]   // source address = source index0012: [email protected] *= 60    // source index *= record size // 0x3C005A: [email protected] += [email protected]  // += start of enex data0085: [email protected] = [email protected]   // pointer address = source address000A: [email protected] += 56    // += offset to destination pointer 0085: [email protected] = [email protected]   // destination address = destination index0012: [email protected] *= 60    // *= record size // 0x3C005A: [email protected] += [email protected]  // += start of enex data0085: [email protected] = [email protected]   // source flag address = source address000A: [email protected] += 48    // += offset to source flags // 0x30 0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0   // write new destination address in pointer0A8C: write_memory [email protected] size 2 value [email protected] virtual_protect 0   // set flags for source0051: return//RBR/CG37: ------ Subroutines used by :CG_Enex end here ------------//RBR/CG37: ------ Enex ends here -----------------------------------

Added for clarification:

 

A quick explanation for enexes using the example you already have and the new code format.

 

//OSR/CG101: Willowfield Armory0006: [email protected] = 15 // source index // Willowfield Safehouse0006: [email protected] = 350 // destination index // ^ connect to BigHouse Armory//0006: [email protected] = 0x4004 // flags // (unlocked, exterior)0006: [email protected] = 0x0004 // flags // (locked, exterior)0050: gosub @sub_CG_Enex_Redirect
The only information you really need are the source and destination index. So lets cut the rest.

 

0006: [email protected] = 15 // source index // Willowfield Safehouse0006: [email protected] = 350 // destination index // ^ connect to BigHouse Armory
0006: is the opcode used to assign an integer to a local variable. We don't need the opcode or the variable for hex editing.

 

15, source index of the Willowfield Safehouse

350, destination index of the BigHouse Armory

But the numbers I gave you before looked like 0F 00 for the source of Willowfield, and E5 01 for the destination of the BigHouse armory. 0F 00 and 5E 01 are the reverse hex equivalent of 0x000F and 0x01E5 If you convert those values to decimal you get 15 and 350.

 

So basically, you need to reverse that process to get your new source. The destination will be the same for all armories, 5E 01. So all you really need to do is find the right source. Let's change the West Mulholland 24-7 into the LS 24-7 armory.

 

[email protected] = 39 // source index // Mulholland West 24-7

 

39 is larger than 15, so this enex is a little ways after the Willowfield edit. You could so the math and calculate exactly where it is as an offset to BLOCK, but usually for enexes I just look for the source indexes as they scroll in order. Since 39 is 0x0027 you'll be looking for 27 00 in the enex block. There will be code words on either side, so DE C0 27 00 DE C0. The next bit will be flags and I'm not exactly sure what you'll find. Then there's another set of code words on either side of original destination 01 01. You can find the original destination and stuff in that linked Enex Documentation topic.

 

 

Remapping Block 25: Enex offsets for SA Mobile

 

 

 Block 25: ENEX Connections (PC, PS2)  0    dword           count  4    word[count]     source index of enex path----  Structure:  0    word            source index (break loop if value = -1)  2    word            flags  4    word            destination index----
Block 25: ENEX Connections (Mobile - iOS, Android)0x0    word            c0de word0x2    dword           count0x6    word            c0de word0x8    word[count]     source index of enex path----  Structure:0x0    word            c0de word0x2    word            source index (break loop if value = -1)0x4    word            c0de word0x6    word            flags0x8    word            c0de word0xA    word            destination index----
This first part probably isn't right but I don't have any iOS saves with CJ saving inside of an interior inside of an interior, so the count is always 1 (inside) or 0 (outside). Nested saving doesn't usually occur in standards games but is possible with the interior CG armory at Caligula's Casino.

 

Maybe something like:

 

Block 25: ENEX Connections (Mobile - iOS, Android)0x0    word            c0de word0x2    dword           count0x6    nested interiors structure----nested interiors[count]0x0    word            c0de word0x2    word            source index of enex path----
It would probably help if we remapped everything from the PC/PS2 wiki for mobile but that's a pretty big project.

 

 

The enex block gives me a good excuse to talk about flags.

 

Flags - True or False, On or Off, 1 or 0

 

Technically, odd or even since only the least significant bit, the 1st bit, bit 0, should be evaluated, but don't count on it. The flags in SA can be stored in bits, bytes, words, or dwords. "Should we call this opcode Enable Gangwars or Disable Gangwars?" The language used to describe the code or flag should always reflect the logic of true or false. If this flag is 1 then I can start a war in game, so Enable Gangwars describes this code more accurately. This hasn't always been true for all codes, but it's pretty accurate in the recent versions. Beware of old documentation.

 

Bit Flags: An efficient way to store a lot of true/false information is to use each an every bit of the available byte, word, or dword. Flag values are almost always written in hex since it's easy to pick out specific flags just by looking at the number and doing some really easy hex math. Sometimes it's easier to set a lot of flags using binary and then converting to hex. Windows calculator and spreadsheets can perform the calculations as needed. The enex flags have a complete reference table for it's bit flags, so let's copy it here for reference.

 

ENEX FlagsBIT HEX   DEC NAME                  DESCRIPTION00 0001     1 unknown interior      Only used for interior markers01 0002     2 unknown pairing       Used mostly for interior markers; also Big Ear & LS Skyscraper02 0004     4 create linked pair    Pair with unflagged mate during new game start03 0008     8 reward interior       Sets flag 0010 on pair mate when used04 0010    16 used reward entrance  Set by accessing reward interior05 0020    32 cars and aircraft     Enable for cars and aircraft06 0040    64 bikes and motorcycles Enable for bikes and motorcycles07 0080   128 disable on foot       No foot traffic (use for cars and/or bikes only)08 0100   256 accept NPC group      Group members accepted at destination of pair (strips passengers)09 0200   512 food date flag        Set and cleared by food date (cut-scene related)10 0400  1024 unknown burglary      Set on Bayside and Temporary Burglary doors11 0800  2048 disable exit          Player can enter but cannot exit a two-way pair12 1000  4096 burglary access       Enabled and disabled during Burglary13 2000  8192 entered without exit  Set by Entrance, Cleared by Exit; Applies to one side of a two-way pair14 4000 16384 enable access         Enabled by default; often cleared by scripts15 8000 32768 delete enex           Enex is deleted when used
0x4004 (04 40 in hex window) - the 4 in 40 unlocks the door, bit 14. The 4 in 04 (bit 2) was used in pairing with another enex when the save was created but it's useless now. We can allow CJ to drive a bike through the door by enabling bit 6. 04 becomes 44. You want to drive cars through too? Add in bit 5. 44 becomes 64. If we want CJ to bring girlfriends or homies into his armory we can set bit 8. 40 becomes 41. In total the value is 0x4164 (64 41). With a little practice you can tease out the flags and tweak them manually. But summed in a decimal number I get 16740. I can't eyeball that.

 

Bit flags are commonly used for enexes, vehicle immunities, and girlfriend properties. There are lots of other in-game uses for bit flags but most of the time we don't need to manipulate them manually; a command is issued that sets the specific flag as required.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Hex Editing Global Variables

 

We covered this in chat so I need to re-write this part, but it should be covered before moving on to IPL modifications and cleo.

Share this post


Link to post
Share on other sites
OrionSR

IPL File Modifications

 

Long term, this type of modification will be very useful for testing new unique stunt jumps. Right now it should be a quick test of the method and provide something interesting to look at in your empty armory from the enex edits. Objects placed in this manner will not be added to the save.

 

Some IPL modifications will effect the save, but usually this requires a starting a new game. This was the original strategy for redirecting enexes and altering garages. If we can't figure out how to do memory writes with Cleo for Android we might have to revert to this strategy. Uniquie stunt jumps, car generators, and pickups can also be added to the save with IPL, but generally they are easier to implement with cleo.

I'm not sure how the data folders are organized on Android. My instructions are for PC, and it would work the same way on PS2 if I could edit the DVD (works in an emulator). You will probably need to adapt this information for your system.

Reference info on Android IPL

@Markuza97, Thanks! You have cleared my confusion. So thanks again!

I created data folder in sdcard/Android/data/com.rockstargames.gtasa/files. In data folder I created ipl folder. I copied and pasted armorobj.ipl in sdcard/Android/data/com.rockstargames.gtasa/files/data/ipl. I defined this ipl in gta.dat and copied and pasted this modified gta.dat in sdcard/Android/data/com.rockstargames.gtasa/files/data. When I load the game, All the machines and gym exercise equipments(all things in armorobj.ipl) were present in my armory.

Screenshots are here: https://www.dropbox.com/sh/begov7zsj8wjkhx/AAAoJw-X_XTfttu_JsjmU0ipa


Below is a plain text file, usually edited with Windows Notepad since it doesn't include any special formatting. It will probably need to be in unicode format for Android, I'm not sure how that is handled. Simply pasting everything into an Andoid editor and saving as plain text should work.

This file needs to be located somewhere in the San Andreas program folder. To avoid messing with any of the standard files I make and new folder named "ipl" within the San Andreas Data folder. Usually written for Windows as

C:\Program Files\Rockstar Games\GTA San Andreas\data\ipl\armorobj.ipl

# Optional Chain Game IPL by OrionSR# Chain Game Armory Objects, \data\ipl\armorobj.iplinst2681, CJ_COIN_OP, 12, 2314.75, -1135.1, 1053.305, 0, 0, 0.7071067691, -0.7071067691, -12778, CJ_COIN_OP_1, 12, 2314.75, -1136.2, 1053.305, 0, 0, 0.7071067691, -0.7071067691, -12779, CJ_COIN_OP_2, 12, 2314.75, -1137.3, 1053.305, 0, 0, 1, -0.7071067691, -11775, CJ_SPRUNK1, 12, 2332.87, -1135.2, 1050.9, 1.32679665706e-06, 1.32679665706e-06, -1.32679313629e-06, -0.999999999997, -11776, CJ_CANDYVENDOR, 12, 2334.32, -1135.2, 1050.9, 1.32679665706e-06, 1.32679665706e-06, -1.32679313629e-06, -0.999999999997, -11209, vendmach, 12, 2335.77, -1135.3, 1049.8, 1.32679665706e-06, 1.32679665706e-06, -1.32679313629e-06, -0.999999999997, -12630, gym_bike, 12, 2311.24, -1141.86, 1053.3, 1.32679489668e-06, 1.32679489668e-06, -0.999999999998, 1.76038469785e-12, -12028, SWANK_CONSOLE, 12, 2308.45, -1138.78, 1054.17, 1.32679665706e-06, 1.32679665706e-06, -1.32679313629e-06, -0.999999999997, -11718, snesish, 12, 2308.55, -1138.18, 1054.15, 3.73433987239e-12, 3.73433987239e-12, 0.707105373907, -0.707108188464, -11719, LOW_CONSOLE, 12, 2308.47, -1137.58, 1054.13, 1.32679489668e-06, 1.32679489668e-06, -0.999999999998, 1.76038469785e-12, -11741, LOW_CABINET_1, 12, 2309.6, -1138.7, 1052.94, 1.87637009259e-06, -1.87637258215e-06, 0.707106312091, -0.707107250277, -12325, kb_bandit_U, 12, 2337.45, -1141.12, 1051.51, 0, 0, 0.707106312094, 0.707107250279, -12640, NEIL_SLOT, 12, 2320.6, -1137.4, 1050.35, 0, 0, 0, 1, -11895, wheel_o_fortune, 12, 2334.45, -1140.9, 1055.25, 0, 0, 0.707106312094, 0.707107250279, -11752, SWANK_TV_3, 12, 2313.24, -1142.16, 1054.5, 1.73354208905e-06, 1.73354208905e-06, -0.923878991536, -0.382684738385, -12631, gym_mat1, 12, 2311.1, -1136.6, 1053.3, 1.32679489668e-06, 1.32679489668e-06, -0.999999999998, 1.76038469784e-12, -12754, OTB_machine, 12, 2328.2, -1137.2, 1050.45, 1.87637009259e-06, -1.87637258215e-06, 0.707106312091, -0.707107250277, -12188, blck_jack, 12, 2333.8, -1136.2, 1054.25, 0, 0, 0.707106312094, 0.707107250279, -12872, CJ_COIN_OP_3, 12, 2314.75, -1140.2, 1053.31, 1.87637009259e-06, -1.87637258215e-06, 0.707106312091, -0.707107250277, -1# Disabled#1978, roulette_tbl, 12, 2316.15, -1143, 1054.35, 0, 0, 0.707106312094, 0.707107250279, -1#^saving with active valet spectator appears to make him disappear forever#2964, k_pooltablesm, 12, 2316.25, -1142.4, 1053.3, -1.87637009259e-06, -1.87637258215e-06, -0.707106312091, -0.707107250277, -1#^saving with an active pool player will glitch him like a basketball $9462end

In order for this file to be read when San Andreas starts we need to add a reference link in GTA.DAT. This is also a plain text file. Make a back up copy of this original file before editing. GTA.DAT is usually located in the data folder. Scroll to near the end of this file and find the line matching "IPL DATA\MAPS\audiozon.ipl". We will insert our extra reference line after this line; "IPL DATA\ipl\armorobj.ipl"

The end of my GTA.DAT looks like this;

IPL DATA\MAPS\audiozon.iplIPL DATA\ipl\armorobj.ipl#IPL DATA\ipl\carcolor.ipl##  Interiors#SPLASH loadsc4

carcolor.ipl is another ipl I was using to test hidden car colors. It is currently disabled by placing a # at the beginning of the line. Using a comment symbol to disable a line is often referred to as "commenting out" the line.

The relative path used in the reference line may need to change if Android handles the folders and names differently. Save GTA.DAT, start the game. If there is a problem with the changes to GTA.DAT the game will usually hang at the end of the load bar with all the comic book pictures. If there is a problem, first try commenting out the new IPL line in gta.dat. If the game still hangs on loading it might indicate a problem with text formatting. Try replacing GTA.DAT with the backup copy. This should put things back to normal.

(The glitch that might happen with the roulette wheel is very minor, and the table adds the best gambling option to the room. Feel free to un-comment the line and put up with a missing lame ped. Also, without a save disk it can't hurt anything)

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

First Cleo Script

 

Our goal here is to create a custom script that we can use for testing. 34Testing is based on the SaveAnywhere script; I changed the touch points to 3 and 4 (please suggest something better, we will reuse this a lot). And instead of showing the save sceen we will set a global variable to 0 that will trigger another script to wait 5 seconds and then flash the radar, display a text message, and set the global back to 1 so we can run the test again.

Other modifications include displaying the "Loading data, please wait..." message when the script starts, and "Load Successful." when it's done. Comments have been added for clarification, and the standard label was renamed to mark the top of the loop. Command opcodes were specified for each line.

This script should continue to wait in a loop for the touch points to be pressed and will return to the top of the loop rather than exiting after the touch points are triggered.

If this works as expected we will disable the flash radar line and add some pickups for your armory.

If you haven't already, download the latest version of Sanny Builder 3 and Cleo for Android and install. Set the Edit Mode to SA Mobile - there's a little icon in the bottom right of the screen. Be alert for anything else that might be required for mobile. Paste the code below into a new Sanny text window and save as 34testing.txt. I'm not sure if it matters where. You'll need to find the text and compiled files and make sure they get moved to the correct android folders. Do what was working for the other scripts that were working as expected. Save the text and I'll continue with compiling below.

 

Updated: The radar might actually flash this time, but displaying the Loading messages every time the touchpoints are pressed is enough to confirm that this looping touchpoint script template is working correctly.

{$CLEO .csa}//34testing.txt//-------------MAIN---------------03A4: name_thread 'TESTING' :Top0001: wait 0 ms00D6: if and 00E1:   key_pressed 3 touch_point 300E1:   key_pressed 3 touch_point 4 004D: jump_if_false @Top 00BB: show_text_lowpriority GXT 'FELD_WR' time 2000 flag 1  // Loading data, please wait...//------------- Start of test codes -------//0004: $83 = 0 // $HELP_FOLLOW_ICON_SHOWN   // Flash Radar in 5 seconds, displays follow CJ icon message 0001: wait 10000 ms//------------- End of test codes ---------//00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.0001: wait 1000 ms 0002: jump @Top   

This text file needs to be compiled into a .csa file and put where cleo will find it before it will run. Hopefully you can figure out the file management stuff. Sanny should apply the correct file extension based on the {$CLEO .csa} directive at the top of the file.

Added: Start with Save As to a documents folder with easy access to avoid problems with files getting lost in the hidden Virtual Store folders if you try to save in Sanny's Program folder.

 

First make sure that Sanny is in SA Mobile mode. Then hit Run > Compile (F6). Usually this will save the csa file to the same folder as the txt file. You can try Compile and Copy. On PC this copies the script to the cleo folder where SA can run it. I'm not sure what will happen for Android. It might be something that you can configure. Either way. make sure the csa is in the right folder and give it a try.

Note: I am unable to accurately decompile the sample scripts you provided. It's possible that Sanny doesn't decompile these types of scripts, or maybe I'm doing it wrong. Failure to decompile correctly is often an indication that compiling isn't working right either, but we should try it anyway and see what happens. (fixed using debug options: try ignore_unknown and/or skip_scm_header.)

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Arming the Armory

The flash radar test script is finally working so now were ready to try something useful - putting weapon pickups in the armory. This is the type of modification that will add new things to the save so you want to make sure it only does this once - extra pickups are hard to destroy without a record of their index. Keep loading a previous save until everything is correct.

We will disable the flash radar codes but keep them in the test script. My test script includes lots of old codes I've used during my tests. Frequently I can just copy a complicated fix I did in the past and make a quick repair to a current problem. These codes also provide examples I can adapt to a new purpose. Your testing file can begin here.

Eventually I'm going to post just the test codes without the surrounding template - the stuff that goes between Start and End, but while the code is still fairly short I'll show examples of disabling sections of codes with comment markers. Individually lines can be disable with //. Sections of code can be disabled between { and }. And there's some new stuff I haven't tried yet. Highlighted lines will be toggled with // when Ctrl-Q is pressed.


{$CLEO .csa}//34testing.txt//-------------MAIN---------------03A4: name_thread 'TESTING' :Top0001: wait 0 ms00D6: if and 00E1:   key_pressed 3 touch_point 300E1:   key_pressed 3 touch_point 4 004D: jump_if_false @Top 00BB: show_text_lowpriority GXT 'FELD_WR' time 2000 flag 1  // Loading data, please wait...//-------- Our test codes will go here ----////RBR/CG37: ------------ Added Pickups ------------:CG_Pickups_Added// ------ All Wardrobes ------//0213: [email protected] = create_pickup #BODYARMOUR type 2 at 257.2117 -42.85986 1002.023  // Wardrobe Armor0213: [email protected] = create_pickup 1242 type 2 at 257.2117 -42.85986 1002.023  // Wardrobe Armor// ------ Armory Hideouts ------// Main Room//PDE/CG21: Types for shared-ammo weapons changed from 2 to 15032B: [email protected] = create_weapon_pickup #AK47 type 15 ammo 500 at 2327.5 -1148.5 1050.49          // AK-47 (moved for new disk)032B: [email protected] = create_weapon_pickup #M4 type 15 ammo 1000 at 2330.0 -1148.5 1050.49           // M4 (moved for new disk)032B: [email protected] = create_weapon_pickup #MP5LNG type 15 ammo 1000 at 2319.35 -1140.08 1050.49     // MP5032B: [email protected] = create_weapon_pickup #TEC9 type 15 ammo 500 at 2319.35 -1142.03 1050.49        // Tec-9032B: [email protected] = create_weapon_pickup #MICRO_UZI type 15 ammo 500 at 2319.35 -1143.71 1050.49   // Micro-SMG032B: [email protected] = create_weapon_pickup #DESERT_EAGLE type 2 ammo 500 at 2329.46 -1139.89 1050.49 // Desert Eagle032B: [email protected] = create_weapon_pickup #SILENCED type 2 ammo 500 at 2329.46 -1141.88 1050.49     // Silenced032B: [email protected] = create_weapon_pickup #COLT45 type 2 ammo 500 at 2329.46 -1143.63 1050.49       // Pistol032B: [email protected] = create_weapon_pickup #CHROMEGUN type 15 ammo 500 at 2321.46 -1148.56 1050.70   // Shotgun032B: [email protected] = create_weapon_pickup #SHOTGSPA type 15 ammo 500 at 2317.23 -1148.56 1050.70    // Spaz-12032B: [email protected] = create_weapon_pickup #SAWNOFF type 15 ammo 500 at 2319.31 -1148.56 1050.7      // Sawnoff 0213: [email protected] = create_pickup #GUN_PARA type 2 at 2333.32 -1148.56 1050.70                     // Parachute032B: [email protected] = create_weapon_pickup #IRGOGGLES type 2 ammo 1 at 2335.49 -1147.22 1050.71      // IR Goggles // Bedroom 1//RBR/CG37: put Satchels back in, added grenades, nudged the others032B: [email protected] = create_weapon_pickup #MOLOTOV type 2 ammo 100 at 2308.84 -1135.62 1054.4    // Molotov032B: [email protected] = create_weapon_pickup #GRENADE type 2 ammo 100 at 2313.36 -1135.51 1054.3    // Grenades//RBR/CG40: nudged Teargas, Satchels, Sniper to remove conflicts with armorobj.ipl032B: [email protected] = create_weapon_pickup #TEARGAS type 2 ammo 100 at 2308.84 -1136.9 1054.22   // Teargas032B: [email protected] = create_weapon_pickup #SATCHEL type 2 ammo 100 at 2308.84 -1139.7 1054.59   // Satchels032B: [email protected] = create_weapon_pickup #SNIPER type 2 ammo 250 at 2309.3 -1142.0 1054.3      // Sniper// Bedroom 2032B: [email protected] = create_weapon_pickup #ROCKETLA type 2 ammo 250 at 2336.19 -1136.49 1054.3  // Rocket Launcher 032B: [email protected] = create_weapon_pickup #HEATSEEK type 2 ammo 250 at 2339.21 -1136.52 1054.3  // Heat Seeker 032B: [email protected] = create_weapon_pickup #FLAME type 2 ammo 2000 at 2337.064 -1141.64 1054.3   // Flamethrower 032B: [email protected] = create_weapon_pickup #MINIGUN type 2 ammo 1500 at 2339.53 -1141.56 1054.3  // Mini-gun // Kitchen//RBR/CG37: added Katana and Chainsaw, nudged Knife//0213: [email protected] = create_pickup #HEALTH type 2 at 2334.40 -1139.80 1051.0      // Health0213: [email protected] = create_pickup 1240 type 2 at 2334.40 -1139.80 1051.0         // Health0213: [email protected] = create_pickup #KATANA type 2 at 2337.48 -1137.3 1051.1      // Katana0213: [email protected] = create_pickup #KNIFECUR type 2 at 2337.48 -1139.9 1051.1    // Knife0213: [email protected] = create_pickup #CHNSAW type 2 at 2332.48 -1137.3 1051.1      // Chainsaw// Dining Room Bribes//RBR/CG37: OrionSR's dining room bribes re-enabled0213: [email protected] = create_pickup 1247 type 2 at 2316.30 -1143.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2314.73 -1141.96 1050.70213: [email protected] = create_pickup 1247 type 2 at 2312.69 -1142.51 1050.70213: [email protected] = create_pickup 1247 type 2 at 2311.52 -1144.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2311.91 -1146.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2313.93 -1147.60 1050.7//0004: $83 = 0 // $HELP_FOLLOW_ICON_SHOWN   // Flash Radar in 5 seconds, displays follow CJ icon message //0001: wait 10000 ms//------------- End of test codes ---------//00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.0001: wait 1000 ms 0002: jump @Top   
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

The Ever Expanding Script

 

Here are a few more codes to test out. If these work we can consider more extensive additions, but for now I wanted to provide some examples for testing. In this ever expanding script I have disabled the previous pickup codes between the { and } sybols and added a new set of codes. After this I'll just post the new codes and you'll need to disable the old ones and add the new stuff based on previous examples.

The "hidden" color used on that Remington might not work right on Android, it's kind of glitchy on PC, but in a good way so we use it anyway - it might spawn with any of 3 hidden colors. It's my impression that hidden colors are more vibrant so I've been trying to work them in on special vehicles.

{$CLEO .csa}//34testing.txt//-------------MAIN---------------03A4: name_thread 'TESTING' :Top0001: wait 0 ms00D6: if and 00E1:   key_pressed 3 touch_point 300E1:   key_pressed 3 touch_point 4 004D: jump_if_false @Top 00BB: show_text_lowpriority GXT 'FELD_WR' time 2000 flag 1  // Loading data, please wait...//-------- Our test codes will go here ----////OSR/CG4Android/ Reopen Mission Interiors07FB: set_interior 'PDOMES' access 1   // The Pleasure Domes07FB: set_interior 'PDOMES2' access 1  // The Pleasure Domes07FB: set_interior 'GANG' access 1     // Vagos Gang House07FB: set_interior 'PAPER' access 1    // Planning Department07FB: set_interior 'ABATOIR' access 1  // Sindacco Abattoir07FB: set_interior 'LACRAK' access 1   // Crack Den09E2: [email protected] = parked_car_generator_w_numberplate #REMINGTN color 131 0 force_spawn 1 alarm_pct 0 lock_pct 0 ipl_11 0 value 2000 plate "_KHSH97_" at 2498.0 -2024.0 13.5 angle 0.0  // Willowfield Armory014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A17: set_parked_car_generator [email protected] to_player_owned 1 014B: [email protected] = init_parked_car_generator #NRG500 color 3 1 force_spawn 1 alarm_pct 0 lock_pct 0 ipl_11 0 value 20000 at 1002.622 -908.162 42.21496 angle 96.0     // LS 24-7 (armory) NRG-500014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A17: set_parked_car_generator [email protected] to_player_owned 1 055F: set_player $PLAYER_CHAR max_armour += 100 // extra max armor, 200 or 250 w/vigilante boost02FA: set_garage 'MUL_LAN' type 5           // Life's a Beach garage in Commerce093A: set_paynspray 'MUL_LAN' type_to_girlfriend 1 0299: activate_garage 'MUL_LAN'04CE: [email protected] = create_icon_marker_without_sphere 63 at 1643.42 -1516.25 13.61  // Life's a Beach PnS in Commerce//OSR/CG24: Move Queens Disk to Armory Interior//OSR/CG4Android/mobile vars0005: $885[11] = 2324.5 0005: $903[11] = -1141.85 0005: $921[11] = 1050.39 0005: $939[11] = 2324.25 0005: $957[11] = -1144.5 0005: $975[11] = 1049.89 0005: $993[11] = 180.0 //make save script move disk pickup$ONMISSION = 1wait 1000$ONMISSION = 0{//RBR/CG37: ------------ Added Pickups ------------:CG_Pickups_Added// ------ All Wardrobes ------//0213: [email protected] = create_pickup #BODYARMOUR type 2 at 257.2117 -42.85986 1002.023  // Wardrobe Armor0213: [email protected] = create_pickup 1242 type 2 at 257.2117 -42.85986 1002.023  // Wardrobe Armor// ------ Armory Hideouts ------// Main Room//PDE/CG21: Types for shared-ammo weapons changed from 2 to 15032B: [email protected] = create_weapon_pickup #AK47 type 15 ammo 500 at 2327.5 -1148.5 1050.49          // AK-47 (moved for new disk)032B: [email protected] = create_weapon_pickup #M4 type 15 ammo 1000 at 2330.0 -1148.5 1050.49           // M4 (moved for new disk)032B: [email protected] = create_weapon_pickup #MP5LNG type 15 ammo 1000 at 2319.35 -1140.08 1050.49     // MP5032B: [email protected] = create_weapon_pickup #TEC9 type 15 ammo 500 at 2319.35 -1142.03 1050.49        // Tec-9032B: [email protected] = create_weapon_pickup #MICRO_UZI type 15 ammo 500 at 2319.35 -1143.71 1050.49   // Micro-SMG032B: [email protected] = create_weapon_pickup #DESERT_EAGLE type 2 ammo 500 at 2329.46 -1139.89 1050.49 // Desert Eagle032B: [email protected] = create_weapon_pickup #SILENCED type 2 ammo 500 at 2329.46 -1141.88 1050.49     // Silenced032B: [email protected] = create_weapon_pickup #COLT45 type 2 ammo 500 at 2329.46 -1143.63 1050.49       // Pistol032B: [email protected] = create_weapon_pickup #CHROMEGUN type 15 ammo 500 at 2321.46 -1148.56 1050.70   // Shotgun032B: [email protected] = create_weapon_pickup #SHOTGSPA type 15 ammo 500 at 2317.23 -1148.56 1050.70    // Spaz-12032B: [email protected] = create_weapon_pickup #SAWNOFF type 15 ammo 500 at 2319.31 -1148.56 1050.7      // Sawnoff 0213: [email protected] = create_pickup #GUN_PARA type 2 at 2333.32 -1148.56 1050.70                     // Parachute032B: [email protected] = create_weapon_pickup #IRGOGGLES type 2 ammo 1 at 2335.49 -1147.22 1050.71      // IR Goggles // Bedroom 1//RBR/CG37: put Satchels back in, added grenades, nudged the others032B: [email protected] = create_weapon_pickup #MOLOTOV type 2 ammo 100 at 2308.84 -1135.62 1054.4    // Molotov032B: [email protected] = create_weapon_pickup #GRENADE type 2 ammo 100 at 2313.36 -1135.51 1054.3    // Grenades//RBR/CG40: nudged Teargas, Satchels, Sniper to remove conflicts with armorobj.ipl032B: [email protected] = create_weapon_pickup #TEARGAS type 2 ammo 100 at 2308.84 -1136.9 1054.22   // Teargas032B: [email protected] = create_weapon_pickup #SATCHEL type 2 ammo 100 at 2308.84 -1139.7 1054.59   // Satchels032B: [email protected] = create_weapon_pickup #SNIPER type 2 ammo 250 at 2309.3 -1142.0 1054.3      // Sniper// Bedroom 2032B: [email protected] = create_weapon_pickup #ROCKETLA type 2 ammo 250 at 2336.19 -1136.49 1054.3  // Rocket Launcher 032B: [email protected] = create_weapon_pickup #HEATSEEK type 2 ammo 250 at 2339.21 -1136.52 1054.3  // Heat Seeker 032B: [email protected] = create_weapon_pickup #FLAME type 2 ammo 2000 at 2337.064 -1141.64 1054.3   // Flamethrower 032B: [email protected] = create_weapon_pickup #MINIGUN type 2 ammo 1500 at 2339.53 -1141.56 1054.3  // Mini-gun // Kitchen//RBR/CG37: added Katana and Chainsaw, nudged Knife//0213: [email protected] = create_pickup #HEALTH type 2 at 2334.40 -1139.80 1051.0      // Health0213: [email protected] = create_pickup 1240 type 2 at 2334.40 -1139.80 1051.0         // Health0213: [email protected] = create_pickup #KATANA type 2 at 2337.48 -1137.3 1051.1      // Katana0213: [email protected] = create_pickup #KNIFECUR type 2 at 2337.48 -1139.9 1051.1    // Knife0213: [email protected] = create_pickup #CHNSAW type 2 at 2332.48 -1137.3 1051.1      // Chainsaw// Dining Room Bribes//RBR/CG37: OrionSR's dining room bribes re-enabled0213: [email protected] = create_pickup 1247 type 2 at 2316.30 -1143.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2314.73 -1141.96 1050.70213: [email protected] = create_pickup 1247 type 2 at 2312.69 -1142.51 1050.70213: [email protected] = create_pickup 1247 type 2 at 2311.52 -1144.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2311.91 -1146.28 1050.70213: [email protected] = create_pickup 1247 type 2 at 2313.93 -1147.60 1050.7}//0004: $83 = 0 // $HELP_FOLLOW_ICON_SHOWN   // Flash Radar in 5 seconds, displays follow CJ icon message //0001: wait 10000 ms//------------- End of test codes ---------//00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.0001: wait 1000 ms 0002: jump @Top   
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Still more test codes

... to use as examples, but this time just the codes. You'll need to work this into the existing script properly. You may not want to test them all at once. I'm getting more into tests of specific features. Feedback on each item would be appreciated, but I'm particularly interested in:

Hidden color observations for the Andromada and Remington.
New bomb shops work correctly.
Vent cover for side entrance removed from area 51
Denise likes diner date (which diner?)



//PDE/CG20: This bribe spawns inside a building object so it gets where it should be//0213: $3373 = create_pickup #BRIBE type 15 at -2120.0 96.39 39.0 // orig. bribe location0215: destroy_pickup $33730213: $3373 = create_pickup 1247 type 15 at 2120.0 96.39 39.0            // Broken Bridge 0213: [email protected] = create_pickup #JETPACK type 15 at 2504.57 -1710.38 13.54      // Jetpack LS Johnson Tree// --- Pay 'n' Sprays ---02FA: set_garage 'FDORSFE' type 5           // Woozie's garage in Chinatown 093A: set_paynspray 'FDORSFE' type_to_girlfriend 1 0299: activate_garage 'FDORSFE'02FA: set_garage 'TBON' type 5              // T-Bone's garage in Ocean Flats093A: set_paynspray 'TBON' type_to_girlfriend 1 0299: activate_garage 'TBON'02FA: set_garage 'AMUMIS' type 5            // Puncture Wounds garage at Angel Pine Ammu-nation093A: set_paynspray 'AMUMIS' type_to_girlfriend 1 0299: activate_garage 'AMUMIS' 02FA: set_garage 'GHOSTDR' type 5           // Interdiction garage in El Castillo del Diablo093A: set_paynspray 'GHOSTDR' type_to_girlfriend 1 0299: activate_garage 'GHOSTDR'04CE: [email protected] = create_icon_marker_without_sphere 63 at -2164.27 654.76 52.4      // Woozie's PnS in Chinatown04CE: [email protected] = create_icon_marker_without_sphere 63 at -2730.71 69.64 4.4        // T-Bone's PnS in Ocean Flats04CE: [email protected] = create_icon_marker_without_sphere 63 at -2111.26 -2462.05 30.7    // Puncture Wounds PnS at Angel Pine Ammu-nation04CE: [email protected] = create_icon_marker_without_sphere 63 at -393.35 2227.18 42.5      // Interdiction PnS in El Castillo del Diablo// --- Bomb Shops ---02FA: set_garage 'DUF_LAS' type 4           // Los Desperados garage (renamed)0299: activate_garage 'DUF_LAS'             //   -> Bomb Shop (remote-control detonator)02FA: set_garage 'MODGLAS' type 3           // Cesar's garage0299: activate_garage 'MODGLAS'             //   -> Bomb Shop (engine ignition detonation)// unmarked but with red sphere02A7: [email protected] = create_icon_marker_and_sphere 37 at 1877.48 -2092.47 13.6     // Los Desperados Bomb Shop018B: set_marker [email protected] radar_mode 102A7: [email protected] = create_icon_marker_and_sphere 37 at 1802.47 -2146.72 13.6     // Cesar's Bomb Shop018B: set_marker [email protected] radar_mode 1// --- New Jumps ---0814: define_unique_jump_start 2170.5 -1519.31 26.0 radius 3.0 1.0 4.5 land 2166.23 -1588.08 23.5 radius 19.0 5.0 11.0 camera 2168.4 -1543.4 30.2 reward 1000    // Sprunk Sign0814: define_unique_jump_start 1880.0 -2543.0 18.5 radius 3.0 3.0 3.0 land 1950.0 -2543.5 23.5 radius 4.0 11.5 10.0 camera 1940.5 -2523.0 16.5 reward 1000       // Andromada Jump (reworked)// --- Ramps for sprunk jump (also opens vent at area 51) //RBR/CG37: destroy A51 Vent Cover at Area69, add same object twice (wider ramp) with locals, so it'll stay there//          Note: A51 Vent Cover at Area69 will get re-created during Black Project0108: destroy_object $6561 // $OBJECT_M_A51_VENTCOVERB029B: [email protected] = init_object 3117 at 2171.3806 -1513.6423 23.1  // A51 Vent Cover Object - LS Sprunk Sign Ramp0453: set_object [email protected] XY_rotation 180.0 165.0 angle 90.001C7: remove_object_from_mission_cleanup_list [email protected]: keep_object [email protected] in_memory 1029B: [email protected] = init_object 3117 at 2169.3806 -1513.6423 23.1  // A51 Vent Cover Object - LS Sprunk Sign Ramp0453: set_object [email protected] XY_rotation 180.0 165.0 angle 90.001C7: remove_object_from_mission_cleanup_list [email protected]: keep_object [email protected] in_memory 1// --- A plane to jump (hidden color on wings untested on mobile)014B: [email protected] = init_parked_car_generator #ANDROM color 1 238 force_spawn 1 alarm_pct 0 lock_pct 0 ipl_11 0 value 10000 at 1940.00 -2545.04 13.58 angle 0.0  // LS Airport Andromada //OSR/CG101: new colors014C: set_parked_car_generator [email protected] cars_to_generate_to 101// --- One of my favorite parking jobs014B: [email protected] = init_parked_car_generator #HUNTER color -1 -1 force_spawn 1 alarm_pct 0 lock_pct 0 ipl_11 0 value 20000 at 317.5 -1760.0 12.77 angle 0.0    // Santa Maria Hunter  // Vertical Bird reward014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A17: set_parked_car_generator [email protected] to_player_owned 1 // Katie says she likes fast driving, so switch the flags08BA: set $380 bit 12   // fast car speed > 22.0 is fun08C0: clear $380 bit 13 // slow car speed between 8.0 and 20.0 is fun  08BA: set $376[0] bit 2 // Denise likes Diners0004: $1260 = 0         // enable two-timing dates

I've got the day off work so I have a little time to think about this stuff today.

The codes below implement unused clothing for CJ. Reports are that the mobile versions is using PCv1 data files so this will probably work. Lines for specific body parts can be disabled or enabled with comments if you'd like to recompile and experiment with some of the other options.

//OSR/CG62: apply some unused clothing087B: set_player $PLAYER_CHAR clothes_texture "hoodyb" model "hoodyb" body_part 0         // torso    // Gray Rockstar Hoody //087B: set_player $PLAYER_CHAR clothes_texture "tshirtmercwht" model "tshirt" body_part 0  // torso    // Mercury White and Red//087B: set_player $PLAYER_CHAR clothes_texture "tshirtmercred" model "tshirt" body_part 0  // torso    // Mercury Red//087B: set_player $PLAYER_CHAR clothes_texture "tshirtmercgry" model "tshirt" body_part 0  // torso    // Mercury Gray//087B: set_player $PLAYER_CHAR clothes_texture "tshirt" model "tshirt" body_part 0         // torso    // White T-shirt//087B: set_player $PLAYER_CHAR clothes_texture "shirtbblue" model "shirtb" body_part 0     // torso    //  Blue shirt over white T//087B: set_player $PLAYER_CHAR clothes_texture "tshirtprowh" model "tshirt" body_part 0    // torso    //  White Pro-laps T-shirt087B: set_player $PLAYER_CHAR clothes_texture "chucksblack" model "conv" body_part 3      // shoes    // Black Hi-Tops with Black Socks087B: set_player $PLAYER_CHAR clothes_texture "glassesx" model "glassesx" body_part 15    // glasses  // x-ray glasses//087B: set_player $PLAYER_CHAR clothes_texture "shadesblk" model "glasses04" body_part 15  // glasses  // black glasses087B: set_player $PLAYER_CHAR clothes_texture "bandanaleaf" model "bandana" body_part 16  // hat      // Orange Bandana with Leaf Pattern//087B: set_player $PLAYER_CHAR clothes_texture "bandanaskull" model "bandana" body_part 16 // hat      // Black Bandana with Skulls 087B: set_player $PLAYER_CHAR clothes_texture "tracktrwhstr" model "tracktr" body_part 2  // legs     // Blue Khakis (standard)070D: rebuild_player $PLAYER_CHAR
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Chain Game Unique Stunt Jumps - an Invokable Cleo Script

The codes below implement all of the current Chain Game jumps. Also included are a couple of disabled rooftop jumps. They won't work without the new cargens on the rooftop anyway. Um... the underwater jump will be pretty tricky without an underwater vehicle spawn. Do you know how to do the undrowning tricks on mobile? I guess I'd better look for jump objects as well.

The test codes previously posted included some of these jumps and objects. Be careful not to add things too many times.

This script is a test of the invokable cleo for android scripts - *.csi. Copy, paste and save it as a new file. It is my understanding that these scripts will be triggered from a menu. This script should then run from start to finish and exit completely. This script should not be run more than once on the same save as it will add the jumps and objects again, but it's up to the user to keep track of the modifications.


{$CLEO .csi}//cg4aUSJa.txt//-------------MAIN---------------03A4: name_thread 'CG4AUSJ'//RBR/CG37: ------------------ Unique Stunt Jumps ------------------------:CG_UniqueJumps// ------------ Add new jumps ------------//OSR/CG37: Chain Game Jumps reworked0814: define_unique_jump_start 2419.4 1213.1 13.66 radius 2.7 5.2 4.2 land 2476.5 1208.4 24.8 radius 3.6 15.2 15.1 camera 2462.17 1183.71 21.17 reward 1000      // LV Pyramid Disco PnS (reworked)0814: define_unique_jump_start 1433.3 -189.5 33.5 radius 2.4 2.6 2.9 land 1403.2 -285.1 25.1 radius 40.1 5.4 26.2 camera 1446.567 -209.14 41.4 reward 1000       // Isolated Mound (reworked)0814: define_unique_jump_start 1880.0 -2543.0 18.5 radius 3.0 3.0 3.0 land 1950.0 -2543.5 23.5 radius 4.0 11.5 10.0 camera 1940.5 -2523.0 16.5 reward 1000       // Andromada Jump (reworked)0814: define_unique_jump_start -1259.0 -732.0 65.0 radius 9.0 7.0 3.0 land -1334.5 -660.0 27.5 radius 22.5 25.0 4.5 camera -1304.8 -722.5 59.5 reward 1000       // Tunnel to SF Airport (reworked)//0814: define_unique_jump_start -1724.0 1124.4 91.1 radius 2.5 14.0 5.5 land -1697.9 1126.1 95.4 radius 3.8 12.7 10.1 camera -1716.7 1106.5 104.8 reward 1000     // SF Towers MtBike (reworked)//0814: define_unique_jump_start -1775.1 790.1 167.1 radius 3.5 24.2 3.2 land -1821.0 794.0 131.0 radius 11.0 36.0 5.0 camera -1787.0 768.0 183.0 reward 1000      // SF Tower NRG (reworked)0814: define_unique_jump_start 1440.0 -274.0 -1.4 radius 10.0 3.0 2.2 land 1400.0 -296.0 11.0 radius 28.0 14.0 12.0 camera 1423.0 -297.3 7.0 reward 1000         // Underwater Mound (reworked)0814: define_unique_jump_start 976.0 -112.0 25.5 radius 16.0 7.0 3.0 land 957.5 -152.0 15.0 radius 34.0 19.0 5.0 camera 995.5 -119.3 25.0 reward 1000            // Fern Narrows (reworked)0814: define_unique_jump_start 392.5 -296.8 11.5 radius 10.0 5.3 2.5 land 352.0 -275.0 4.5 radius 10.0 35.0 5.0 camera 362.0 -301.8 7.8 reward 1000              // Isolated Tree0814: define_unique_jump_start 1078.0 582.5 25.5 radius 3.2 3.2 3.2 land 1148.0 670.5 28.5 radius 44.0 6.0 20.0 camera 1103.5 666.7 12.3 reward 1250             // Early LV Ramp (reworked)0814: define_unique_jump_start 407.5 -1802.0 9.5 radius 2.5 3.5 3.0 land 354.0 -1804.0 19.1 radius 5.0 13.0 15.0 camera 369.8 -1806.8 19.8 reward 1000           // Yacht Harbor Sign (reworked)0814: define_unique_jump_start 1562.2 -2361.1 16.8 radius 3.1 3.8 3.0 land 1595.0 -2350.65 32.5 radius 5.0 17.65 10.0 camera 1580.0 -2350.0 28.0 reward 1500     //_LS_Airport_Roof_reworked_South  //RBR/CG39:0814: define_unique_jump_start 2428.0 2808.0 15.0 radius 2.5 2.5 3.0 land 2505.0 2818.0 25.0 radius 5.0 28.0 15.5 camera 2486.0 2820.0 35.0 reward 1500          // LV Fuel Depot (reworked)0814: define_unique_jump_start -508.0 -298.0 56.0 radius 18.0 2.5 5.0 land -497.0 -364.5 14.0 radius 47.0 21.0 8.0 camera -517.0 -308.0 35.0 reward 1500         // Fallen Tree (reworked)0814: define_unique_jump_start 5.0 -612.0 12.0 radius 4.0 10.0 3.5 land -52.5 -557.5 3.0 radius 27.5 22.5 3.0 camera -5.0 -595.0 15.0 reward 1500                // Speed or Splash (reworked)0814: define_unique_jump_start -1945.0 -704.5 34.0 radius 10.0 4.0 3.0 land -1954.8 -757.8 39.0 radius 9.3 27.8 4.0 camera -1948.0 -724.0 38.3 reward 1250       // Foster Mall (reworked)0814: define_unique_jump_start -1903.5 -1403.5 40.5 radius 9.0 8.0 3.0 land -1916.0 -1485.5 21.0 radius 21.0 18.0 9.0 camera -1906.8 -1395.4 40.5 reward 1250    // Foster River (reworked)0814: define_unique_jump_start -1156.0 -2245.0 39.0 radius 8.0 21.0 3.0 land -1225.5 -2203.5 38.0 radius 12.0 27.0 15.0 camera -1178.5 -2198.0 37.5 reward 1250  // Shady Creek North (reworked)0814: define_unique_jump_start -1142.0 -2539.5 75.0 radius 14.0 23.0 3.0 land -1242.0 -2612.5 25.0 radius 40.0 35.5 16.0 camera -1206.0 -2630.0 10.0 reward 1250 // Shady Creek Delta (reworked)//RBR/CG37: New Sprunk Sign Jump0814: define_unique_jump_start 2170.5 -1519.31 26.0 radius 3.0 1.0 4.5 land 2166.23 -1588.08 23.5 radius 19.0 5.0 11.0 camera 2168.4 -1543.4 30.2 reward 1000    // Sprunk Sign//OSR/CG61: New Panopticon Barriers jump - recovered from round 48 save0814: define_unique_jump_start -914.8 -285.8 61.8 radius 1.0 11.0 3.0 land -960.0 -299.1 38.0 radius 9.0 18.8 1.0 camera -929.2 -287.9 56.2 reward 1250 // Panopticon Barriers  //OSR/CG610814: define_unique_jump_start -2127.0 1103.5 83.25 radius 2.5 2.5 2.5 land -2113.0 1244.0 45.0    radius 10.0 10.0 25.0 camera -2117.5 1191.25 80.0 reward 2000 // Ryan's_Eye //OSR/CG610814: define_unique_jump_start 1621.5 2212.0 17.25 radius 2.5 2.5 2.5 land 1626.0 2292.5 25.0 radius 5.5 8.0 15.0 camera 1597.00 2283.00 15.50 reward 1500 // Small_Casino //OSR/CG61//OSR/CG101: New jumps from 09090900814: define_unique_jump_start 1493.2 1924.7 18.0 radius 6.0 4.5 6.2 land 1414.2 1923.2 21.7 radius 7.4 14.3 8.1 camera 1427.6 1954.8 29.8 reward 909 //Redsands Roof jump                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    0814: define_unique_jump_start 1485.1 1155.3 23.7 radius 10.1 11.5 6.9 land 1495.0 1065.7 27.5 radius 63.8 23.9 10.7 camera 1510.8 1142.2 41.3 reward 909 //Runway 69 jump//OSR/CG4A/Objects for new USJs//PDE/CG24: Early LV ramp029B: [email protected] = init_object 1245 at 1076.3 578.3 20.55  // Better Ramp to LV0177: set_object [email protected] Z_angle_to 236.001C7: remove_object_from_mission_cleanup_list [email protected]: keep_object [email protected] in_memory 1//Sprunk Jump Ramps029B: [email protected] = init_object 3117 at 2171.3806 -1513.6423 23.1  // A51 Vent Cover Object - LS Sprunk Sign Ramp0453: set_object [email protected] XY_rotation 180.0 165.0 angle 90.001C7: remove_object_from_mission_cleanup_list [email protected]: keep_object [email protected] in_memory 1029B: [email protected] = init_object 3117 at 2169.3806 -1513.6423 23.1  // A51 Vent Cover Object - LS Sprunk Sign Ramp0453: set_object [email protected] XY_rotation 180.0 165.0 angle 90.001C7: remove_object_from_mission_cleanup_list [email protected]: keep_object [email protected] in_memory 1:CG_UniqueJumps_End00BB: show_text_lowpriority GXT 'HJ_QIS' time 2000 flag 1  // QUADRUPLE INSANE STUNT BONUS: $~1~004E: end_thread

Note: For each jump added to the Chain Game save another is removed to keep the total jumps to 70. San Andreas can have as many as 256 USJs but the tools we use to check what still needs to be completed can only track and display 70, so we use the same limit. The same tool (San Andreas Mission Analyzer, SAMA) won't work on Android so there is no need to remove the original jumps.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Launching Threads Early

 

Okay, this looks right. pdescobar worked out the original logic of this script. This is intended to be run on an In the Beginning save, but If I understand his notes properly it shouldn't cause thread or icon duplication if executed on a late game save. Races, and Bike and Boat school should all be marked and available. Note that SF to LV can't be won unless the LV barriers are down (great 4-star race, btw), and care must be used to avoid the invisible barriers around the bridges during Military Service.

 

 

{$CLEO .csi}//launch.txt//-------------MAIN---------------03A4: name_thread 'LAUNCH' //RBR/CG37: ------------------ 4star Racing and Early Schools ------------------------:CG_4starRacing//RBR/CG37: Both cell calls (schools and racing) have to be disabled,//          otherwise threads will get duped or races can't be triggered//OSR/CG37: Launch threads with global offset because cleo scripts can't find labels in main.scm// To find the address for creating the thread, decompile with options, formats, Thread+Global Offset// Thanks to Seemann: http://www.gtaforums.com/index.php?showtopic=372900 //PDE/CG20: Interiors and Features// Bike & Boat School and part of Driving School; copied from cellphone thread// Note that Driving School won't actually start until after Wear Flowers in Your Hair.// Thread is explicitly ended first, just in case. The cell call should be disabled.//OSR/CG4Android/Updated varibables and offsets for mobile version00D6: if 0038:   $1421 == 0 004D: jump_if_false @CG_4starRacing_Markers 0004: $1421 = 1 // driving school call received; bike school, boat school & racing threads created; school icons placed0459: end_thread_named 'TRACE'//004F: create_thread @TRACE_77026004F: create_thread 77026 //OSR/CG4Android: use global offset in cleo scripts instead of label name //pde/ Note, using a lowerpriority "asset" style marker for driving school to match others.//02A7: $595 = create_icon_marker_and_sphere 36 at $576 $577 $5780570: $595 = create_asset_radar_marker_with_icon 36 at $576 $577 $578 018B: set_marker $595 radar_mode 2 0459: end_thread_named 'BSCHOO'//004F: create_thread @BSCHOO_83397  004F: create_thread 833970164: disable_marker $629 0570: $629 = create_asset_radar_marker_with_icon 36 at $3754 $3755 $3756 018B: set_marker $629 radar_mode 2 //004F: create_thread @BIKES_83529  0459: end_thread_named 'BIKES'004F: create_thread 83529 0164: disable_marker $631 0570: $631 = create_asset_radar_marker_with_icon 36 at $3757 $3758 $3759 018B: set_marker $631 radar_mode 2   :CG_4starRacing_Markers// Race Tournaments; copied from cellphone call. // Markers set now because TRACE thread already running so races will work.00D6: if 0038:   $1422 == 0 004D: jump_if_false @CG_4starRacing_End 0004: $1422 = 1 // racing markers set, race tournaments available0164: disable_marker $527 0164: disable_marker $528 0164: disable_marker $529 0164: disable_marker $530 0570: $527 = create_asset_radar_marker_with_icon 53 at $561[0] $565[0] $569[0] 0570: $528 = create_asset_radar_marker_with_icon 53 at $561[1] $565[1] $569[1] 0570: $529 = create_asset_radar_marker_with_icon 53 at $561[2] $565[2] $569[2] 0570: $530 = create_asset_radar_marker_with_icon 53 at $561[3] $565[3] $569[3] :CG_4starRacing_End//0051: return 004E: end_thread 

 

Buff CJ - Extra Stats and stuff to help with testing.

 

You may want to keep most of this stuff disabled until you need it. (Some parts of this are being repeated.)

{$CLEO .csi}//buffcj.txt//-------------MAIN---------------03A4: name_thread 'BUFFCJ'//RBR/CG37: ------------------ Debug Section ------------------------//0629: change_integer_stat 181 to 4     // cities unlocked  //WARNING: Will glitch LS phone calls for missions and alerts//01F0: set_max_wanted_level_to 0:sub_CG_Debug_Player0109: player $PLAYER_CHAR money += 200000055F: set_player $PLAYER_CHAR max_armour += 100  // increased max. armour for 4star Gang Wars; vigilante will add another 50062A: change_float_stat 24 to 1000.0       // max health0001: wait 0 ms   // needed between stat change & health change0223: set_actor $PLAYER_ACTOR health_to 1760330: set_player $PLAYER_CHAR infinite_run 1055D: make_player $PLAYER_CHAR fireproof 1062A: change_float_stat 22 to 1000.0   // stamina062A: change_float_stat 21 to 150.0    // fat062A: change_float_stat 23 to 1000.0   // muscle//062A: change_float_stat 23 to 150.0   // muscle062A: change_float_stat 64 to 1000.0   // total respect062A: change_float_stat 65 to 1000.0   // girlfriend respect062A: change_float_stat 66 to 1000.0   // clothes respect062A: change_float_stat 67 to 1000.0   // fitness respect062A: change_float_stat 68 to 2500.0   // running respect0629: change_integer_stat 225 to 1000  // lung capacity0629: change_integer_stat 160 to 1000  // driving skill0629: change_integer_stat 229 to 1000  // bike skill0629: change_integer_stat 230 to 1000  // cycle skill0629: change_integer_stat 223 to 1000   // flying skill:sub_CG_Debug_Extras_End//RBR/CG37: ------------ Debug Weapons ------------:sub_CG_Debug_Weapons{0006: [email protected] = CG_DEBUG_WEAPONS00D6: if0039:   [email protected] == 1004D: jump_if_false @sub_CG_Debug_Weapons_End}// Give a nice selection of weapons:062A: change_float_stat 69 to 1000.0  // pistol skill062A: change_float_stat 70 to 1000.0  // SILENCED skill062A: change_float_stat 71 to 1000.0  // DESERT EAGLE skill062A: change_float_stat 72 to 1000.0  // SHOTGUN skill062A: change_float_stat 73 to 1000.0  // SAWNOFF skill062A: change_float_stat 74 to 1000.0  // SPAS12 skill062A: change_float_stat 75 to 1000.0  // MICRO UZI skill062A: change_float_stat 76 to 1000.0  // MP5 skill062A: change_float_stat 77 to 1000.0  // AK47 skill062A: change_float_stat 78 to 1000.0  // M4 skill0247: load_model #DESERT_EAGLE0247: load_model #MP5LNG0247: load_model #M40247: load_model #SNIPER0247: load_model #MINIGUN0247: load_model #MOLOTOV:sub_CG_Debug_WeaponModelLoad0001: wait 0 ms00D6: if and0248:   model #DESERT_EAGLE available0248:   model #MP5LNG available0248:   model #M4 available0248:   model #SNIPER available0248:   model #MINIGUN available0248:   model #MOLOTOV available004D: jump_if_false @sub_CG_Debug_WeaponModelLoad01B2: give_actor $PLAYER_ACTOR weapon 31 ammo 5050 // M401B2: give_actor $PLAYER_ACTOR weapon 34 ammo 2500 // Sniper01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9500 // Minigun01B2: give_actor $PLAYER_ACTOR weapon 18 ammo 1000 // Molotov01B2: give_actor $PLAYER_ACTOR weapon 24 ammo 2507 // Desert Eagle01B2: give_actor $PLAYER_ACTOR weapon 29 ammo 5030 // MP50249: release_model #DESERT_EAGLE0249: release_model #MP5LNG0249: release_model #M40249: release_model #SNIPER0249: release_model #MINIGUN0249: release_model #MOLOTOV:sub_CG_Debug_Weapons_End:sub_CG_Debug_Barriers0777: delete_objects_in_object_group "BARRIERS1" // SF Barriers0777: delete_objects_in_object_group "BARRIERS2" // LV Barriers:sub_CG_Debug_Garages//0299: activate_garage 'cjsafe'   // Johnson House garage (already active)0299: activate_garage 'carlas1'  // El Corona0299: activate_garage 'CEsafe1'  // Muholland Garage  0299: activate_garage 'beacsv'   // Santa Maria Garage //0299: activate_garage 'LCKSfse'  // Doherty garage (already active)  0299: activate_garage 'sav1sfw'  // Paradiso0299: activate_garage 'svgsfs1'  // Hashbury0299: activate_garage 'sav1sfe'  // Calton Heights0299: activate_garage 'vEsvgrg'  // Rockshore West0299: activate_garage 'blob6'    // Redsands West garage - Dock Garage0299: activate_garage 'blob69'   // Prickle Pine0299: activate_garage 'blob7'    // Whitewood Estates Garage    0299: activate_garage 'cn2gar1'  // Fort Carson0299: activate_garage 'cn2gar2'  // Verdant Meadows garage0299: activate_garage 'dhangar'  // Verdant Meadows Hangar0299: activate_garage 'burbdoo'  // Palomino Creek Garage0299: activate_garage 'burbdo2'  // Dillimore Garage0299: activate_garage 'BODLAWN'  // LS Transfender0299: activate_garage 'MODLAST'  // Loco Low Co0299: activate_garage 'MDSSFSE'  // SF Transfender0299: activate_garage 'MDS1SFS'  // Wheel Arch Angels0299: activate_garage 'VECMOD'   // LV Transfender:sub_CG_Debug_Interiors07FB: set_interior 'AMMUN1' access 1   // Ammu-Nation07FB: set_interior 'AMMUN2' access 1   // Ammu-Nation07FB: set_interior 'AMMUN3' access 1   // Ammu-Nation07FB: set_interior 'AMMUN4' access 1   // Ammu-Nation07FB: set_interior 'AMMUN5' access 1   // Ammu-Nation07FB: set_interior 'BARBERS' access 1  // Barber07FB: set_interior 'BARBER2' access 1  // Barber07FB: set_interior 'BARBER3' access 1  // Barber07FB: set_interior 'FDPIZA' access 1   // Pizza Stack07FB: set_interior 'FDCHICK' access 1  // Cluckin' Bell07FB: set_interior 'FDBURG' access 1   // Burger Shot07FB: set_interior 'TATTOO' access 1   // Tattoo Parlor07FB: set_interior 'CSCHP' access 1    // Binco07FB: set_interior 'CSSPRT' access 1   // Pro-Laps07FB: set_interior 'LACS1' access 1    // Sub Urban07FB: set_interior 'CLOTHGP' access 1  // Zip07FB: set_interior 'CSDESGN' access 1  // Victim07FB: set_interior 'CSEXL' access 1    // Didier Sachs07FB: set_interior 'GYM1' access 1     // Ganton Gym07FB: set_interior 'GYM2' access 1     // Cobra Martial Arts07FB: set_interior 'GYM3' access 1     // Below the Belt Gym07FB: set_interior 'CARLS' access 1    // The Johnson House07FB: set_interior 'PDOMES' access 1   // The Pleasure Domes07FB: set_interior 'PDOMES2' access 1  // The Pleasure Domes07FB: set_interior 'MADDOGS' access 1  // Madd Dogg's Crib07FB: set_interior 'MDDOGS' access 1   // Madd Dogg's Crib07FB: set_interior 'GANG' access 1     // Vagos Gang House07FB: set_interior 'RCPLAY' access 1   // Zero's RC Shop07FB: set_interior 'PAPER' access 1    // Planning Department07FB: set_interior 'ABATOIR' access 1  // Sindacco Abattoir07FB: set_interior 'LACRAK' access 1   // Crack Den//Misc0879: enable_gang_wars 10629: change_integer_stat 337 to 1 // toggles the "territories under control" stat//09E6: set_burglary_houses_accessible 1004E: end_thread
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

This topic is open to everyone. Thanks for waiting.

 

Okay, I think that's the bulk of what we've covered so far. Hopefully flood control will let me keep this post in reserve and not merge it with the others.

 

Please keep in mind that a lot of the conversation is missing and I'll need to fill in some missing pieces and add clarification.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Primitive Coordinate Tool for Android

 

The logic in this script is a little different. It needs to be invoked from the menu, but then will run continuously to update budget stats with CJ's current coordinates. The idea is that you could pause the game at any point and check the stats for the current position. This info can be used to place your own pickups and car generators. Hopefully we'll be able to develop this into an on-screen display or output to a text file.

 

{$CLEO .csi}//cjcoord.txt//-------------MAIN---------------03A4: name_thread 'CJCOORD' :Top0001: wait 0 ms 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] 0172: [email protected] = actor $PLAYER_ACTOR Z_angle 062A: change_float_stat 13 to [email protected] // Weapon Budget  062A: change_float_stat 14 to [email protected] // Fashion Budget  062A: change_float_stat 15 to [email protected] // Property Budget  062A: change_float_stat 16 to [email protected] // Auto Repair and Painting Budget  0001: wait 10 ms 0002: jump @Top 
dfKt4q3.png Edited by OrionSR

Share this post


Link to post
Share on other sites
khsh97

I like the idea of budget coordination. Now, I am off to bed so I will give it a try tomorrow.

Edited by khsh97

Share this post


Link to post
Share on other sites
OrionSR

Transposing PC Global Variables for Android

 

Be aware that we will constantly be breaking the cardinal rule of, "Never use global variables in cleo scripts!" Expect some criticism on this issue, and for good reason. You can get into a lot of trouble messing with global variables. The assumption of the Chain Game saves is that they will be played using standard scripts and data files and no other kind of modification - no cheats, trainers, cleo, editors, modified data files - anything. These modifications have been thoroughly tested under those conditions. That being said, great care was used to maintain compatibility with the scripts - we only modify global variables in the context they are used in game. As long as your other mods are polite about global variables there shouldn't be a problem. Even then, the global variables we will modify are seldom considered unused or useless, so there's a reasonably good chance we won't run into any unexpected problems.

 

So far I've been working out the Android global variables for you, but now that you can decompiled both the PCv1 and Android scripts you can start looking this stuff up yourself. For something like this I find it easier to use scripts that have been decompiled without the Custom Variable Names option. However, the debug codes use the custom names. Look up the global variable number in CustomVariable.ini found in the appropriate data folder under Sanny's program folder.

 

The other complication with the girlfriend variables is the use of arrays. In the codes below the number in brackets is added to the global number. So $383[2] is the same as $385. The other form of an array is something like $358($388,6i). 6i defines the length of the array, and the value of $388 is added to $358. This allows the game to use the same codes for each girlfriend simply by changing the value of $388. I recommend using the bracket format when possible to make it easier to identify which girlfriend is being adjusted ([3] must be Barbara).

//=============================================================// These PC Global Variables need to be adjusted for Android //=============================================================//OSR/CG61: ------------------ Girlfriend tweaks ------------------// They are no longer restricted from certain hours,// but they won't spawn until the next day after a date.$383[0] = 0 // Denise always home$383[1] = 0 // Michelle always home$383[2] = 0 // Helena always home$383[3] = 0 // Barbara always home$383[4] = 0 // Katie always home$383[5] = 0 // Millie always home// Enable Gimp dates for all girlfriends08BA: set $377 bit 23 // enable Gimp Suit Date08BA: set $378 bit 23 // enable Gimp Suit Date08BA: set $379 bit 23 // enable Gimp Suit Date08BA: set $380 bit 23 // enable Gimp Suit Date08BA: set $381 bit 23 // enable Gimp Suit Date08BA: set $382 bit 23 // enable Gimp Suit Date// Enable She Drives dates for most girlfriends08BA: set $377 bit 22 // enable She Drives Date//08BA: set $378 bit 22 // enable She Drives Date // Michelle is already set//08BA: set $379 bit 22 // enable She Drives Date // Helena is too glitchy08BA: set $380 bit 22 // enable She Drives Date08BA: set $381 bit 22 // enable She Drives Date08BA: set $382 bit 22 // enable She Drives Date// Katie says she likes fast driving, so switch the flags08BA: set $381 bit 12 // fast car speed > 22.0 is fun08C0: clear $381 bit 13 // slow car speed between 8.0 and 20.0 is fun   // Food Preferences08BA: set $377[0] bit 2 // Denise likes Diners08BA: set $377[1] bit 5 // Michelle likes Restaurants08BA: set $377[3] bit 5 // Barbara likes Restaurants //08BA: set $377[5] bit 28 // Millie really likes kissing // Not working and not needed$GIRL_PROGRESS[5] = 40 // Millie's progress is 40% //OSR/CG101//=======================================================// These PC Custom Variable Names need to be converted // to PC global variable numbers and then to Android//=======================================================//OSR/CG61: Debug options for testing new girlfriend options08BA: set $Girls_Gifts_Bitmask bit 0 // enable Denise08BA: set $Girls_Gifts_Bitmask bit 1 // enable Michelle08BA: set $Girls_Gifts_Bitmask bit 2 // enable Helena08BA: set $Girls_Gifts_Bitmask bit 3 // enable Barbara08BA: set $Girls_Gifts_Bitmask bit 4 // enable Katie08BA: set $Girls_Gifts_Bitmask bit 5 // enable Millie$GIRL_PROGRESS[0] = 40$GIRL_PROGRESS[1] = 40$GIRL_PROGRESS[2] = 40$GIRL_PROGRESS[3] = 40$GIRL_PROGRESS[4] = 40$GIRL_PROGRESS[5] = 40//==================================================// These testing codes have already been tweaked// for Android.//==================================================// Katie says she likes fast driving, so switch the flags08BA: set $380 bit 12   // fast car speed > 22.0 is fun08C0: clear $380 bit 13 // slow car speed between 8.0 and 20.0 is fun  08BA: set $376[0] bit 2 // Denise likes Diners0004: $1260 = 0         // enable two-timing dates

Share this post


Link to post
Share on other sites
khsh97

I tried cjcoord.csi. When I invoke it from script menu, my game crashes(force close).

Share this post


Link to post
Share on other sites
OrionSR

I do not have an explanation for your crash from the cjcoord script. If I remove the "i" from csi and compile it for cleo4 it works as expected on PC.

 

(And for the record, I borrowed this strategy from an old PS2 cheat device code. I couldn't get it to work on AR-Max because it can't handle the copy byte commands. This might have been an Edison Carter original code, or at least something from that era.)

 

Suggestions:

 

Weird crashes in a loop? Try adding some waits. Increase that first wait 0 to 10, and then copy it after the two codes that read the position and angle. Recompile, try again.

 

Make a Disabled folder under cleo and trim out unnecessary active scripts.

 

Change the cleo directive to .csa and see what happens when it runs automatically.

 

Comment out sections of code and narrow down the crash before worrying about making the script actually work.

 

Put just the store and change stat codes into your 34testing script since the basic structure of that script is already proven. Then you'd get more of a snapshot coord reading that you could run again.

 

I already checked using Sanny's Tools > IDE Tools > Opcode Search... and the relevant opcodes appear to be the same in GTA SA and SA Mobile editor modes.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Enex Modification with Text IPL Files

 

Files in " Internal memory \ Android \ data \ com.rockstargames.gtasa \ files \ " have higher priority.

Modified LAe.ipl goes into " Internal memory \ Android \ data \ com.rockstargames.gtasa \ files \ data \ maps \ LA \ LAe.ipl "
Modified gta3.img goes into " Internal memory \ Android \ data \ com.rockstargames.gtasa \ files \ texdb \ gta3.img "

Do the same thing with the other files. Just make sure that folder structure is same like in the OBB file.

 

Since you are interested in implementing warps between two external enexes, let's test the priorities of IPL replacement files on Android. It's really easy to scramble the enexes if the standard files are edited incorrectly. We need to make sure that the "higher priority" files doesn't complicate the sequencing of links. Extract only the original ipl files specified and place them in appropriate folders as required.

 

I'm going to provide you with the the filename and the original lines from my ipl file, commented out with a # character. Additional comments are added at the end. Search for part of this line and comment out your's too; consider adding the comments. Then add the replacement line after the original. We need to adjust both sides of the link to make a proper connection.

 

These modifications will require a new save. But before making the test save make sure that your old links still work correctly - does CJ warp to the correct interiors. Actually, it would be a good idea to test an interior or two before making any modifications to the replacement IPL files. The new saves are likely to work as expected with the a new link sequence. It's compatibility with existing save (and other users) that can get messed up in this process.

# LAe.ipl# 2112.73, -1211.7, 22.9614, 5.56363e-008, 1.4, 1.4, 8, 2112.87, -1214.79, 22.9614, 180, 0, 4, "LACS1", 0, 2, 0, 24 // LAe Sub-Urban in Jefferson2112.73, -1211.7, 22.9614, 5.56363e-008, 1.4, 1.4, 8, 2112.87, -1214.79, 22.9614, 180, 0, 98, "LS2LV2", 0, 2, 0, 24 // ^warp to LVn Sub-Urban (allow cars and bikes)# vegaN.ipl# 2779.12, 2453.54, 10.061, 8.42937e-008, 2.4, 2.4, 8, 2772.02, 2447.64, 10.061, 125, 0, 4, "LACS1", 0, 2, 0, 24  // Sub Urban in Creek2779.12, 2453.54, 10.061, 8.42937e-008, 2.4, 2.4, 8, 2772.02, 2447.64, 10.061, 125, 0, 70, "LS2LV2", 0, 2, 0, 24  // ^warp to LS Sub-Urban in Jefferson (allow bikes)

Passengers should teleport with the vehicle, but group members will not follow. Otherwise they get stripped from the vehicle, which I find more annoying.

 

See if you can get that working first. I'll add the lines for the other CG warps.

# LAw2.ipl# 461.158, -1499.98, 30.1742, 0, 1, 1, 8, 458.658, -1500.48, 30.1742, 100, 0, 4, "CSDESGN", 0, 2, 0, 24 // LS Victim in Rodeo461.158, -1499.98, 30.1742, 0, 1, 1, 8, 458.658, -1500.48, 30.1742, 100, 0, 98, "LS2SF2", 0, 2, 0, 24   // ^warp to SF Victim Financial (allow cars and bikes)#SFe.ipl#-1694.76, 951.599, 24.2706, -0.785398, 2, 2, 8, -1699.27, 950.599, 24.2706, 92, 0, 4, "CSDESGN", 0, 2, 0, 24   // SF Victim in Financial-1694.76, 951.599, 24.2706, -0.785398, 2, 2, 8, -1699.27, 950.599, 24.2706, 92, 0, 70, "LS2SF2", 0, 2, 0, 24    // ^warp to LS Victim in Rodeo (allow bikes)# SFw.ipl#-2375.32, 910.293, 44.4578, 0, 2, 1.66492, 8, -2377.32, 909.293, 44.4578, 5507.58, 0, 4, "CSCHP", 0, 2, 0, 24       // SF Bincos on Juniper Hill-2375.32, 910.293, 44.4578, 0, 2, 1.66492, 8, -2377.32, 909.293, 44.4578, 5507.58, 0, 98, "SF2LV2", 0, 2, 0, 24      // ^warp to North Strip Bincos (allow cars and bikes)# vegasW.ipl# 2102.69, 2257.49, 10.0579, 0, 0.8, 2.4, 8, 2105.79, 2257.49, 10.0579, 270, 0, 4, "CSCHP", 0, 2, 0, 24  // North Strip Bincos2102.69, 2257.49, 10.0579, 0, 0.8, 2.4, 8, 2105.79, 2257.49, 10.0579, 270, 0, 102, "SF2LV2", 0, 2, 0, 24 // ^warp to SF Binco in Juniper Hollow (allow cars and bikes)# countrye.ipl# 1367.27, 248.388, 18.6229, -0.410739, 1, 4, 8, 1362.64, 249.569, 19.0015, 69.0975, 0, 4, "FDPIZA", 0, 2, 0, 24      // Montgomery Pizza (unmarked)1367.27, 248.388, 18.6229, -0.410739, 1, 4, 8, 1362.64, 249.569, 19.0015, 69.0975, 0, 102, "AP2BL2", 0, 2, 0, 24      // ^warp to Angel Pine 24-7 (allow cars and bikes)# countryS.ipl# -1562.63, -2732.98, 47.7435, -0.595977, 0.84, 2.2, 8, -1560.63, -2734.98, 47.7435, 237, 0, 4, "X7_11S", 0, 0, 0, 24  // Angel Pine 24-7-1562.63, -2732.98, 47.7435, -0.595977, 0.84, 2.2, 8, -1560.63, -2734.98, 47.7435, 237, 0, 66, "AP2BL2", 0, 0, 0, 24   // ^warp to Montgomery Pizza (allow bikes)# LAs.ipl# 1833.54, -1843.38, 12.5595, 0, 1, 1, 8, 1831.54, -1843.38, 12.5595, 90, 0, 4, "X7_11B", 0, 2, 0, 24 // Unity 24-71833.54, -1843.38, 12.5595, 0, 1, 1, 8, 1831.54, -1843.38, 12.5595, 90, 0, 98, "DS2LS2", 0, 2, 0, 24  // ^warp to Unmarked El Que Barber (allow cars and bikes)# countryN.ipl # -1449.87, 2591.85, 54.8378, 0, 1.5, 0.6, 8, -1449.87, 2593.85, 54.8378, 360, 0, 4, "BARBER2", 0, 2, 0, 24     // Unmarked El Que Barber-1449.87, 2591.85, 54.8378, 0, 1.5, 0.6, 8, -1449.87, 2593.85, 54.8378, 360, 0, 70, "DS2LS2", 0, 2, 0, 24       // ^warp to Unity 24-7 (allow bikes)
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

First test: Find the start of the CarGen records. I have edited this save so the Airstrip Rustler gets loaded in slot 0. The model should be the first word of the overall structure (slot 0, offset 0). To make the search value more unique I'm grouping the model word and both color bytes into a single dword integer. Combined hex and decimal values are shown in the table below. I'm assuming you will enter the decimal value by default, but look for a hex search option. The length should be a 4 byte dword integer. Don't bother trying to look at the vehicle, it's still hidden.

Airstrip Rustler moved to slot 0Reverse Hex     Hex        Dec       DescriptionDC 01 01 00  0x 000101DC   66012  // Rustler, White and Black  DD 01 02 00  0x 000201DD   131549 // ZR-350, Blue and Black (not unique in save)DE 01 03 00  0x 000301DE   197086 // Walton, Red and Black

Save 1) http://gtasnp.com/42992
Save 2) http://gtasnp.com/42993
Save 3) http://gtasnp.com/42994

 

Oops: Updated - I moved the cargen to slot zero so it's unhooked from it's global.

//014C: set_parked_car_generator $3343 cars_to_generate_to 101 // display Airstrip Rustler ($mobile)014C: set_parked_car_generator 0 cars_to_generate_to 101 

A suggested test is to write a new model word to the base address offset identified. It would help to see at least a small area of hex code (~40 bytes) following the identified address.

 

Sorry, I didn't quite get everything copied. The idea here is to load different saves to change the value for the search tools since most of these structures tend to have very static information.

 

Added so I don't lose track of it again. My old memory dump topic has some details on the records and field offsets for some of these structures.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Current results are based on the dump 2 folder file 5EF0D000-5F3BB000.bin provided by Markuza97. The file was padded with enough bytes (5D1000) to align the first money dword with the 0x96B2CC offset identified in the CleoA topic. 350 as two dwords (money, money on screen) in sequence is a pretty unique search string.

 

Android mem_write address offsets for SA Mobile v1.05

Static offset from base, ad_lib 1

0x96B2CC // player money

0x5FD8D0 // map marker index

0x6BFC74 // start of garagecar records

0x6C10C8 // start of garagezone records
0x6CD8DC // start of pickup records
0x79822A // restarts busted word (structure seems off)
0x7FE36C // start of shopping data
0x96D370 // open map sectors
0x96D374 // map fog array

0x97362C // start of marker structure

0x9E2A6C // start of numplate records
0x9E2B5C // numplates used
0x9E2B68 // start of cargen records

enex data in dynamic game memory

0x6BF80C // points to enex pointer (add_ib 1)

enex pointer holds add_ib 0 address of start of enex records

enex pointer is at an add_ib 0 address

enex destinations use add_ib 0 addresses

unique stunt jump data in dynamic game memory (reference)

0x801404 // points to usj pointer (see enex pointer info)

0x8013F0 // address of nUniqueJumps (0x801404 - 0x14)

0x8013F4 // address of nUJs_done (0x801404 - 0x10)

Notes:

Shopping Clothes offset = 0xAC

Shopping Clothes length = 0xF7

I'm still missing a starting point for the garagecar records although I pretty sure I found the general area, completely blank.. A memory dump that included at least tne car in the Jefferson garage should provide the required information. A memory dump that has triggered at last one gang war and an associated save might provide useful information down the road - not a top priority. Right now I'm mostly stuck on the garaged cars.

 

Also, these dumps seem remarkably similar - the dynamic stuff appears static. Was the game restarted at all between dumps? Maybe I need to dig deeper. I ran out of gas tracking down my first guess at the pointers for the enex data. Sorry, I don't have enough time to draft any tests and I expect to be pretty busy with work for the next few days.

 

Enex Structure in Memory - search for 58 14 F2 44 F6 58 F6 C4 in 2\63AAB000-63C6A000.bin, or follow the path through the pointers. The dynamic pointers have been found in 636E1000-637C8000.bin.

 

The enex stuff is tricky though. Most of the time I can use search strings from the save file to identify structures in memory. But the enex stuff is populated almost entirely from text data files. Fortunately the text strings used to link the enexes are still in plain text. The general procedure for manipulating a record is to read the index from the global identified with item, multiply that by the record length, and add the appropriate offset to record 0 field 0. Field offsets are added as appropriate. Note that the globals associated with pickups have extra information in the upper bytes.

 

Markuza97, thanks a lot. Even if my addresses are off I can still verify record and field offsets. I'm feeling pretty good about this though. If it's not quite right the first time we should be able to zero in on things fairly quickly.

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Full Test - Add All Clothes to Wardrobe

 

Sorry, Again, this is probably to big for a first test, but I'll post it anyway. It's hard to tell if everything is in inventory. If it seems like it works then send me a save for closer examination of what actually got tweaked.

{$CLEO .csi}//allclothes.txt//-------------MAIN---------------03A4: name_thread 'ALLCLO' //RBR/CG37: ------------------ All Clothes in Wardrobe ------------------------//OSR/CG4Android: variables updated for SA Mobile:CG_AllClothes// Flags for owned clothes are at mem addresses 0x7FE418 to 0x7FE50E - set 1 to own// These 247 flags are presumably: 249  total clothes items (without the specials)//                                -  3  default skins (default torso, legs, shoes)//                                +  1  ski mask (listed as special; not available through wardrobe)//RBR/CG37: slightly reworked for better readability0006: [email protected] = 0x7FE36C  // start of shopping data000A: [email protected] += 0xAC     // offset to shopping clothes:CG_AllClothes_SetFlags00D6: if002B:   0x7FE50E >= [email protected] // end of shopping clothes data004D: jump_if_false @CG_AllClothes_Specials0DD9: write_mem_addr [email protected] value 1 size 1 add_ib 1 protect 0000A: [email protected] += 10002: jump @CG_AllClothes_SetFlags:CG_AllClothes_Specials// Make all specials available// Setting these globals seems to be enough. Ski Mask is not accessible through wardrobe.0004: $3942 = 1  //  $Gimp_Suit_Available0004: $3943 = 1  //  $Valet_Uniform_Available0004: $3944 = 1  //  $Rural_Clothes_Available0004: $3945 = 1  //  $Croupier_Uniform_Available0004: $3946 = 1  //  $Cop_Uniform_Available0004: $3947 = 1  //  $Pimp_Suit_Available0004: $3948 = 1  //  $Racing_Suit_Available0004: $3949 = 1  //  $Medic_Uniform_Available// Make all stores selectable in wardrobe0004: $3936 = 1   // Binco0004: $3937 = 1   // Pro-Laps0004: $3938 = 1   // Sub Urban0004: $3939 = 1   // Zip0004: $3940 = 1   // Victim0004: $3941 = 1   // Didier Sachs//RBR/CG37: PDE's budget - keep for reference//062A: change_float_stat 14 to 108039.0  // fashion budget (approx)//062A: change_float_stat 62 to 108039.0  // total shopping budget:CG_AllClothes_End//0051: return00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1 // Load Successful.004E: end_thread 

ANOtaZI.png

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Memory Write Test - Car Generators

 

Most of this code is disabled between { and } comment markers. The script should only modify the model, colors, and flags. The other lines were included to provide examples of field offsets in the cargen records. Several fields were omitted.

{$CLEO .csi}//cargen.txt//-------------MAIN---------------03A4: name_thread 'CARGEN'//014B: $4150 = init_car_generator #CLOVER color -1 -1 force_spawn 0 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2445.5 -1340.8 23.5 angle 180.0                                                                          0085: [email protected] = $4150       // index of the East LS Clover0012: [email protected] *= 0x20       // cargen record size000A: [email protected] += 0x9e2b68   // start of cargen structure0085: [email protected] = [email protected]: [email protected] += 0x00        // model ID0DD9: write_mem_addr [email protected] value #PHOENIX size 2 add_ib 1 protect 0  // Phoenix0085: [email protected] = [email protected]: [email protected] += 0x02        // color 10DD9: write_mem_addr [email protected] value 0 size 1 add_ib 1 protect 0         // Black0085: [email protected] = [email protected]: [email protected] += 0x03        // color 20DD9: write_mem_addr [email protected] value 1 size 1 add_ib 1 protect 0         // White{0085: [email protected] = [email protected]: [email protected] += 0x04        // x coord0007: [email protected] = 2445.50013: [email protected] *= 8.00092: [email protected] = float [email protected] to_integer0DD9: write_mem_addr [email protected] value [email protected] size 2 add_ib 1 protect 0    0085: [email protected] = [email protected]: [email protected] += 0x06        // y coord0007: [email protected] = -1340.80013: [email protected] *= 8.00092: [email protected] = float [email protected] to_integer0DD9: write_mem_addr [email protected] value [email protected] size 2 add_ib 1 protect 0    0085: [email protected] = [email protected]: [email protected] += 0x08        // z coord0007: [email protected] = 23.50013: [email protected] *= 8.00092: [email protected] = float [email protected] to_integer0DD9: write_mem_addr [email protected] value [email protected] size 2 add_ib 1 protect 0   0085: [email protected] = [email protected]: [email protected] += 0x0A        // heading0007: [email protected] = 180.00017: [email protected] /= 360.00013: [email protected] *= 256.00092: [email protected] = float [email protected] to_integer0DD9: write_mem_addr [email protected] value [email protected] size 1 add_ib 1 protect 0  0085: [email protected] = [email protected]: [email protected] += 0x0B        // alarm0DD9: write_mem_addr [email protected] value 0 size 1 add_ib 1 protect 0   0085: [email protected] = [email protected]: [email protected] += 0x0C        // lock0DD9: write_mem_addr [email protected] value 0 size 1 add_ib 1 protect 0   }0085: [email protected] = [email protected]: [email protected] += 0x0D        // flags0DD9: write_mem_addr [email protected] value 0x1A size 1 add_ib 1 protect 0    // Force Spawn, Player Owned{0085: [email protected] = [email protected]: [email protected] += 0x1A        // cars to generate0DD9: write_mem_addr [email protected] value -1 size 2 add_ib 1 protect 0      // Hidden: 0, Display: -10085: [email protected] = [email protected]: [email protected] += 0x1D        // allocated vehicle0DD9: write_mem_addr [email protected] value 1 size 1 add_ib 1 protect 0        // Allocated: 1, Free slot: 0}  wait 25000BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1      // Load Successful.004E: end_thread

UToQNyN.png

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Test: Seed money into an asset

 

Something I could adapt quickly.

{$CLEO .csi}//assettest.txt03A4: name_thread 'asset'04A6: [email protected] = create_asset_money_pickup_at 2244.6328 -1245.8905 28.7431 money 250000 65535 // Jefferson Booty0085: [email protected] = [email protected]: [email protected] -= 0x020000    // extract just the index from the local0012: [email protected] *= 0x20        // pickup record size000A: [email protected] += 0x6cd8dc    // start of pickup block//000A: [email protected] += 0         // offset to asset value field0DD9: write_mem_addr [email protected] value 100000.0 size 4 add_ib 1 protect 0  wait 25000BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.004E: end_thread

y75LMNq.png

Edited by OrionSR

Share this post


Link to post
Share on other sites
khsh97

I got success in changing willowfield safe house to that LA big house(armory). I changed 61 to 5E and fixed the checksum and saved it. I load it on my Android and went to willowfield safe house and its interior was changed to armory.

 

This is the process which I used:

 

I searched for (DE C0 FC 00 DE C0 0F 00 DE C0) an then I changed 60 to 5E

7mpNZQg.png

 

And the for fixing checksum, I zero out the last four bytes and the I clicked on:

Analysis>checksums>checksum-32 and then on Ok.

I got the checksum in small separate window and I wrote in reverse byte order in place of last four bytes zeros. The checksum got fixed and I loaded the save and voila... my willowfield safe house got changed into LAbig house(armory).

Here is a screenshot:

JLA9T9L.png

 

This is the how the interior of the LA big House(armory) looks like:

R0JbnG9.jpg

Edited by khsh97

Share this post


Link to post
Share on other sites
OrionSR

Enex Redirect for CleoA

 

This script creates several "warp" shortcuts between remote destinations. It also redirects several exterior doors to the LA Big House which will be used for an armory. The screenshot example below shows the unused SFPD HQ which is gets linked to the Dillimore PD. Read the comments within the script for details on other tweaks. Check the Enex Documentation topic for source and destination indexes and information on enex flags.

{$CLEO .csi}//cgenex.txt//-------------MAIN---------------//03A4: name_thread 'CGENEX' //OSR/CG4Android: variables updated for SA Mobile// ------------ Start of Enex Changes ------------:CG_Enex0DD8: [email protected] = read_mem_addr 0x6bf80c size 4 add_ib 1 // pointer to pointer to enex data0DD8: [email protected] = read_mem_addr [email protected] size 4 add_ib 0       // start of enex data0001: wait 0 ms// ------------ Warps ------------0006: [email protected] = 17       // source index           // LS Sub-Urban in Jefferson0006: [email protected] = 127      // destination index      // ^ warp to LVn Sub-Urban 0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 127      // source index           // Sub Urban in Creek0006: [email protected] = 17       // destination index      // ^ warp to LS Sub-Urban in Jefferson 0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 41       // source index           // LS Victim in Rodeo0006: [email protected] = 81       // destination index      // ^ warp to SF Victim Financial 0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 81       // source index           // SF Victim in Financial0006: [email protected] = 41       // destination index      // ^ warp to LS Victim in Rodeo0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 101      // source index           // SF Binco on Juniper Hill0006: [email protected] = 166      // destination index      // ^warp to North Strip Binco0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 166      // source index           // North Strip Binco0006: [email protected] = 101      // destination index      // ^ warp to SF Binco in Juniper Hollow0006: [email protected] = 0x4066   // flags                  // (allow cars and bikes)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 211      // source index           // Montgomery Pizza (unmarked)0006: [email protected] = 201      // destination index      // ^ warp to Angel Pine 24-70006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 201      // source index           // Angel Pine 24-70006: [email protected] = 211      // destination index      // ^ warp to Montgomery Pizza0006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 9        // source index           // Unity 24-70006: [email protected] = 180      // destination index      // ^ warp to Unmarked El Que Barber0006: [email protected] = 0x4062   // flags                  // (allow cars and bikes) 0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 180      // source index           // Unmarked El Que Barber0006: [email protected] = 9        // destination index      // ^ warp to Unity 24-70006: [email protected] = 0x4046   // flags                  // (allow bikes)         0050: gosub @sub_CG_Enex_Redirect// ------------ Armories ------------0006: [email protected] = 58       // source index           //  Queens Hotel Save0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory//RBR/CG37: Queens property has to be purchased before armory can be used, as in previous rounds//0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0006: [email protected] = 0x0004   // flags                  //  (locked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 39       // source index           //  Mulholland West 24-70006: [email protected] = 350      // destination index      //  ^connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 83       // source index           //  SF Tower Top0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 53       // source index           //  Unrestricted Bayside Burglary0006: [email protected] = 350      // destination index      //  ^connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 144      // source index           //  Caligula's Roof North0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 244      // source index           //  Caligula's Penhouse to Rooftop0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 218      // source index           //  Whetstone Farmhouse0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect0006: [email protected] = 188      // source index           //  Generator Room (in)0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0050: gosub @sub_CG_Enex_Redirect//OSR/CG101: Willowfield Armory0006: [email protected] = 15      // source index            //  Willowfield Safehouse0006: [email protected] = 350      // destination index      //  ^ connect to BigHouse Armory//0006: [email protected] = 0x4004   // flags                  //  (unlocked, exterior)0006: [email protected] = 0x0004   // flags                  //  (locked, exterior)0050: gosub @sub_CG_Enex_Redirect//RBR/CG37: Add entrance marker for Sherman Dam Armory// Note: Millie's exit marker probably won't be displayed in the game (when getting the keycard).// Update: only one airport marker seems to be displayed at one time, so we might not lose Millie's marker after all// Update: we don't lose Millie's exit marker.//0A40: [email protected] = create_entrance_marker_at -594.97 2018.07 61.25 color 14  // Generator Room (in) // ------------ Unused Interiors ------------0006: [email protected] = 207      // source index           //  Dillimore Police Department0006: [email protected] = 312      // destination index      //  ^ use SFPD Interior0006: [email protected] = 0x4104   // flags                  //  (unlocked, NPC Group, exterior)0050: gosub @sub_CG_Enex_Redirect   // ------------ Tweaked Flags ------------// Will adjust all links with a matching name098E: unknown_set_interior 'GYM1' bitmask 256 flag 1    // LS Gym, accept NPC group 098E: unknown_set_interior 'GYM2' bitmask 256 flag 1    // SF Gym, accept NPC group 098E: unknown_set_interior 'GYM3' bitmask 256 flag 1    // LV Gym, accept NPC group 098E: unknown_set_interior 'CARTER' bitmask 256 flag 1  // Smoke's Palace, accept NPC group 098E: unknown_set_interior 'POLICE2' bitmask 256 flag 1 // SFPD at Dillimore, accept NPC group 098E: unknown_set_interior 'P69_ENT' bitmask 32 flag 1  // Enable for cars and aircraft098E: unknown_set_interior 'P69_ENT' bitmask 64 flag 1  // Enable for bikes and motorcycles// ------------ End of Enex Changes ------------00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1 // Load Successful.004E: end_thread //RBR/CG37: ------ Subroutines used by :CG_Enex ------:sub_CG_Enex_Redirect// change the destination of an enex. Uses:     // enex, block 25// [email protected] = pointer to pointer to enex data         // read once early in script// [email protected] = start of enex data                      // read once early in script// [email protected] = source index                            // set before gosub// [email protected] = destination index                       // set before gosub // [email protected] = source flags                            // set before gosub     // [email protected] = start of source// [email protected] = address of destination pointer// [email protected] = start of destination// [email protected] = address of source flags0085: [email protected] = [email protected]   // source address = source index0012: [email protected] *= 60    // source index *= record size // 0x3C005A: [email protected] += [email protected]  // += start of enex data0085: [email protected] = [email protected]   // pointer address = source address000A: [email protected] += 56    // += offset to destination pointer 0085: [email protected] = [email protected]   // destination address = destination index0012: [email protected] *= 60    // *= record size // 0x3C005A: [email protected] += [email protected]  // += start of enex data0085: [email protected] = [email protected]   // source flag address = source address000A: [email protected] += 48    // += offset to source flags // 0x30 0DD9: write_mem_addr [email protected] value [email protected] size 4 add_ib 0 protect 0   // write new destination address in pointer0DD9: write_mem_addr [email protected] value [email protected] size 2 add_ib 0 protect 0   // set flags for source0051: return//RBR/CG37: ------ Subroutines used by :CG_Enex end here ------------//RBR/CG37: ------ Enex ends here -----------------------------------

3dXBsU0.png

Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Show Save Screen

 

This save mod won't save during a mission since this will cause the save to crash when loaded. It should also prevent or repair the two major glitches associated with saving next to something, the basketball and pool player glitches, but I haven't tested these functions.

{$CLEO .csa}//46CGsave.txt//-------------MAIN---------------03A4: name_thread 'CGSAVE' :Top0001: wait 0 ms//Save only when not on a mission00D6: if and 00E1:   key_pressed 3 touch_point 400E1:   key_pressed 3 touch_point 6 0038:   $ONMISSION == 0 004D: jump_if_false @Top//Fix SA Mobile Glitch Related Global Variables0004: $3315 = 0  // Fix Basketball Glitch0004: $10819 = 0 // Fix Pool Player Glitch03D8: show_save_screen 0001: wait 1000 ms 0002: jump @Top 
Edited by OrionSR

Share this post


Link to post
Share on other sites
OrionSR

Garage Zone Tweak Test

 

This test code only tweaks the height of the El Corona garage roof enough for aircraft to fit on top and unlocks the garage, then it adjusts the Dillimore PnS so it can spray helis on the roof and changes the camera setting so you don't lose control of the view when CJ is within the zone. There are a lot more changes to be made but I wanted to test all three subroutines before considering the other adjustments..

{$CLEO .csi}//grgtest.txt//-------------MAIN---------------//03A4: name_thread 'GRGTEST' //OSR/CG4Android: variables updated for SA Mobile//Test Vehicle014B: [email protected] = init_car_generator #SPARROW color 68 42 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 1671.5 -2045.75 22.0 angle 180.0 //Roof NW of El Corona 014C: set_parked_car_generator [email protected] cars_to_generate_to 101 //RBR/CG37: ------------------ Garage Tweaks ------------------------:CG_Garage0006: [email protected] = 5  // Garage to Modify   // El Corona Garage0006: [email protected] = 7  // Field to Modify    // Z Coordinate for Ceiling0007: [email protected] = 20.2236                  //   ^ taller for Aircraft on roof0050: gosub @sub_CG_Garage_FieldTweak0006: [email protected] = 0x68  // Door Type       // unlocked, camera follows player0050: gosub @sub_CG_Garage_DoorTweak0006: [email protected] = 47 // Garage to Modify   // Pay 'n' Spray in Dillimore0006: [email protected] = 7  // Field to Modify    // Z Coordinate for Ceiling 0007: [email protected] = 26.5                     //   ^ taller for Aircraft on roof0050: gosub @sub_CG_Garage_FieldTweak0006: [email protected] = 1                        // Camera follows player bit0050: gosub @sub_CG_Garage_CamTweak:CG_Garage_End00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1 // Load Successful.004E: end_thread //RBR/CG37: ------ Subroutines used by :CG_Garage ------:sub_CG_Garage_FieldTweak// tweak garage fields 0-19//    fields 0-18 are size 4 each so we can handle fields 0-19 in one routine//    fields 19-22 are size 1 each so we make an extra subroutine for door flags (field 21)// writes value [email protected] to field [email protected] of garage [email protected]: if and0029:   [email protected] >= 0   // index of garage to tweak (0-49)002B:   49 >= [email protected]:   [email protected] >= 0   // index of field to modify (0-19)002B:   19 >= [email protected]: jump_if_false @sub_CG_Garage_FieldTweak_End0085: [email protected] = [email protected]         // write address = garage index0012: [email protected] *= 216       // *= record size000A: [email protected] += 0x6c10c8  // += start of garagezone data0085: [email protected] = [email protected]         // offset = field index0012: [email protected] *= 4         // *= dword size005A: [email protected] += [email protected]        // write address += field offset   0DD9: write_mem_addr [email protected] value [email protected] size 4 add_ib 1 protect 0  :sub_CG_Garage_FieldTweak_End0051: return:sub_CG_Garage_DoorTweak// tweak garage door flags (field 21 - offset 78)// writes value [email protected] to field 21 of garage [email protected]: if and0029:   [email protected] >= 0       // index of garage to tweak (0-49)002B:   49 >= [email protected]:   [email protected] >= 0x00    // [email protected] isn't out of range (1 byte)002B:   0xFF >= [email protected]: jump_if_false @sub_CG_Garage_DoorTweak_End0085: [email protected] = [email protected]         // write address = garage index0012: [email protected] *= 216       // *= record size000A: [email protected] += 0x6c10c8  // += start of garagezone data000A: [email protected] += 78        // write address += door flags offset   0DD9: write_mem_addr [email protected] value [email protected] size 1 add_ib 1 protect 0  :sub_CG_Garage_DoorTweak_End0051: return//RBR/CG37: Let's try tweaking only the camera follows player bit:sub_CG_Garage_CamTweak// tweak garage door flags (field 21 - offset 78 - bit 5 (0x20) )// writes value [email protected] to bit 5 of field 21 of garage [email protected]: if and0029:   [email protected] >= 0      // index of garage to tweak (0-49)002B:   49 >= [email protected]:   [email protected] >= 0      // [email protected] isn't out of range (1 bit)002B:   1 >= [email protected]: jump_if_false @sub_CG_Garage_CamTweak_End0085: [email protected] = [email protected]        // write address = garage index0012: [email protected] *= 216       // *= record size000A: [email protected] += 0x6c10c8  // += start of garagezone data000A: [email protected] += 78        // write address += door flags offset   0DD8: [email protected] = read_mem_addr [email protected] size 1 add_ib 1       :sub_CG_Garage_CamTweak_Set00D6: if0039:   [email protected] == 1004D: jump_if_false @sub_CG_Garage_CamTweak_Clear08BD: set [email protected] bit 50002: jump @sub_CG_Garage_CamTweak_Write:sub_CG_Garage_CamTweak_Clear08C3: clear [email protected] bit 5:sub_CG_Garage_CamTweak_Write0DD9: write_mem_addr [email protected] value [email protected] size 1 add_ib 1 protect 0   :sub_CG_Garage_CamTweak_End0051: return//RBR/CG37: ------ Subroutines used by :CG_Garage end here ------------//RBR/CG37: ------ Garage Tweaks end here -----------------------------

c4SpRnb.png

 

KToIV1m.png

Edited by OrionSR

Share this post


Link to post
Share on other sites
khsh97

IPL File Modifications Test:

 

I copied the text files which you provided above. Then I opened ES File explorer in my Android phone. In ES file explorer I created a new blank file and named it as "armorobj.ipl". Then I opened armorobj.ipl file with ES note editor and pasted the text files which I copied earlier and then I saved it. After doing it, then I opened patch.6.com.rockstargames.gtasa.obb with ES zip explorer and extracted gta.dat from it. Then I opened gta.dat with ES note editor and added the reference of armorobj.ipl in it.

 

After doing the above steps then I did the following steps:

 

I created data folder in sdcard/Android/data/com.rockstargames.gtasa/files. In data folder I created ipl folder. I copied and pasted armorobj.ipl in sdcard/Android/data/com.rockstargames.gtasa/files/data/ipl. Then I copied and pasted modified gta.dat in sdcard/Android/data/com.rockstargames.gtasa/files/data. When I load the game, All the machines and gym exercise equipments(all things in armorobj.ipl) were present in my armory.

 

Here are the screenshots:

 

JK5ucHm.jpg

5z5lF5b.jpg

2C6ma6w.jpg

g4fZ1Jw.jpg

Ji1TmMc.jpg

Edited by khsh97

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.

Guest
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.


  • 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.