Skip to content

Instantly share code, notes, and snippets.

@Decicus
Last active October 5, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Decicus/6a493db998ded515c7ebc6ba3b90385f to your computer and use it in GitHub Desktop.
Save Decicus/6a493db998ded515c7ebc6ba3b90385f to your computer and use it in GitHub Desktop.
Grand Theft Auto: San Andreas - skip that saves OVER 3 HOURS in Any%

Four years ago, a glitch that came to be known as Script Stack Underflow was found in GTA Vice City, and with this strat the time quickly went from the 50 minute range to an 8 minute run. At the time, some people wondered if a similar skip could be found in San Andreas.

It has happened. It isn't SSU, but the distinction is not relevant for now.

  https://www.youtube.com/watch?v=f9uHxDyosBo

  The short story is that starting Vigilante during a certain part of the mission Ryder makes the game jump to an arbitrary line of script (.scm) code, depending on a variable that is linked to the time since the game started. With the ability to execute any line of script code, we can warp to any mission we want. This glitch only works on the Windows Store version

  The route I came up with is as follows:

-Start the game

-Immediately get a cop bike (reset if no cop bike before 7:46)

-Activate Vigilante and cancel it within the range of 82070ms - 82093ms - which happens around 7:46)

--While waiting for the clock, kill a drug dealer if you see any for 2000$

--While waiting for the clock, park the bike perpendicular to a wall inside the garage, so that when speeding forward it'll flip and CJ falls out

-Do Big Smoke

--Avoid Vending Machines. The standard route is shown in the following picture in red, route I take is blue. red squares are approximated locations of vending machines which must be avoided, as they reset the timer that has been set by cancelling vigilante

---http://puu.sh/Ep9Q4/ca8a77ce4f.png

--Get the Burgbox (blue square)

--Enter the Burgbox before going inside the house so it doesn't despawn

-Save the game once

-Do Burglary. Due to vending machines, a longer route has to be taken, but otherwise the strats can be seen in the video below

--https://www.youtube.com/watch?v=bkWHmVBoRho

--http://puu.sh/Ep9Ur/fee51db159.png

--If a drug dealer was not killed, do 22 items (9680$)

--If a drug dealer was killed, do 20 items (8000$)

-Get om0 Burglary with Jefferson safehouse

--http://puu.sh/EpaHF/684eca6dbb.png

--Nearest safehouse can't be used due to being too close to a vending machine

--om0 setup is frame perfect and can be seen here https://youtu.be/XtybvgDK0Hs?t=7m9s

---time the phonecall in a way that you buy the safehouse and you get the phonecall right after and hold it

---as soon as you get in the van, start submission. Spam start/end submission until you hear a blip sound. Reload the autosave.

----If done correctly, the game will have Burglary om0, otherwise it'll be om1. You don't get control over what you get, just get lucky loool

----During this, the safehouse cutscene may play. That means you failed.

-Return to Grove Street using the same route as the standard start of the run

-Hold the phonecall and start Ryder

--Let go of the phonecall when cutscene starts, get in vehicle ASAP to skip the phonecall

---This is necessary because the next part at the barbers won't work if it's the first time CJ picked up a phonecall

-Drive to the barbers, but get the grenades.

--Phonecall will come in here, so press enter vehicle and cancel the path finding before getting the grenades

-Hold the phonecall before entering barbers

--If a drug dealer was not killed, buy Afro

--If a drug dealer was killed, buy Jheri Curl (one input faster)

-Let go of the phonecall when the fade out starts when CJ leaves the barber

-The goal now is to start Vigilante during a specific time of the cutscene you're in. This interval is 1000ms after the camera changes when Ryder's line ends, but before a further 1000ms have elapsed to make Ryder talk again.

--Pausing the game will restart Ryder's line, which can be used to extend the cutscene indefinitely

--You have control of Carl, but you have no ability to enter vehicles or switch weapons. We need to regain these abilities.

--First, reenter the barbers to regain camera control

--Run to Ryder to restart it

--Go to the garage. Destroy Ryder's car with the grenade.

--On the bike, accelerate forward when the scene changes. On the minimap, when the player cursor does a 180º, start Vigilante

--If done correctly and with the right value at the start of the run, EOTL3 will begin. You need CJ to fall off the bike to cancel Vigilante before 500ms have elapsed hence the setup with the bike in the garage

-Finish the run by completing EOTL3!

  I don't claim this is the optimal way to do it and I expect improvements to be made at some point.

  I've been searching for this kind of glitch for over 3 years on and off now. This particular version of the warp was found months ago, but I was stumped on regaining the ability to get in vehicles. Once I figured out I could regain it by restarting the mission, it was smooth sailing, though I'm not sure why it took me so long to think of it.

As for what this glitch is, this is the code it uses:

{2974507} 008B: 80@ = $CURRENT_TIME_IN_MS2

The code will begin running at offset 2974510 (5775 local offset in the COPCAR script), skipping the first 3 bytes of code (the opcode and the parameter type).

Thus, it uses 80@ as an opcode, which is the 0050 opcode (gosub). Then it uses the value of $CURRENT_TIME_IN_MS2 as a jump destination. I'm not sure what this is called, so for now I'm calling it arbitrary gosub (or more generally, arbitrary jump)

  Now let's see how many years it takes for someone to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment