技巧

levels.io 分享在 macOS 上自制《GTA San Andreas》任务的完整提示词

精选理由

levels.io 公开了一整段提示词,照着贴就能在 Mac 上给 GTA 圣安地列斯做自定义任务,降级打补丁到运行坑都写全了。

levels.io 公开了一段可粘贴使用的提示词,用来自制 GTA San Andreas 的自定义剧情任务。流程要求先把游戏降级到 v1.0 US 版,安装 CLEO 5 和 SilentPatch,因为 Steam 和 Rockstar Launcher 版本较新不兼容 CLEO。文中给出了用 Jetpack Downgrader 补丁 15 个数据文件的具体命令,并附验证方法:gta3.img 需为 940,064,768 字节、CRC32 为 c8ccf06f,main.scm 需为 3,079,599 字节。示例任务名为「Vibe Coded」,内容是 CJ 在 San Fierro 坐到桌前 minigame 编程创业公司 Vibes AI,最后获得投资人 1,000 万美元投资,全程带配音和字幕。提示词还包含多个 CrossOver 运行注意事项,例如每次启动前删除 gta_sa.set 否则崩溃、窗口必须保持焦点否则加载中断等。

图片来源 · Pieter Levels
原文 · Pieter Levels

Here is the prompt to make your own GTA San Andreas mission on MacOS, just paste it in your clanker, you can change the mission of course to your own story:

You are helping me build a custom story mission for GTA San Andreas (classic PC version) running on macOS through CrossOver. Work step by step, check each step works before moving on, and back up everything before changing files.

GOAL A playable mission called "Vibe Coded". CJ walks into a marker in San Fierro, drives to a diner, sits at a desk with his co-founder and "vibe codes" a startup called Vibes AI in a minigame. Then he drives to an investor office and pitches. The investors invest $10,000,000 and the mission passes. All dialogue is voiced and subtitled.

PART 1: PREPARE THE GAME

1. Back up the full game folder and the save folder ("Documents/GTA San Andreas User Files") before touching anything. 2. Downgrade the game to v1.0 US. The modding tool CLEO only works on v1.0, and the Steam and Rockstar Launcher versions are newer. Use Jetpack Downgrader (open source, on GitHub), which supports the Rockstar Launcher version. You don't need its Windows GUI. Its package contains the full v1.0 exe (game.jpp is a zip holding it) plus JojoDiff binary patches for 15 data files. Apply each patch with its bundled patcher.exe, run through CrossOver's wine command line. Syntax: patcher.exe original patch output. The files are anim.img, gta_int.img, gta3.img, TrakLkup.dat, nine audio streams, script.img and main.scm. Verify: gta3.img should be 940,064,768 bytes with CRC32 c8ccf06f, and main.scm should be 3,079,599 bytes. 3. Install CLEO 5 (the version bundled with Silent's ASI Loader) and SilentPatch. SilentPatch is required, because without it v1.0 refuses to start on a Mac with "Cannot find 800x600x32 video mode". 4. Make the save compatible. v1.0 uses v1 scripts, so a save from the newer versions won't load. Use https://t.co/R4yTH4wx5g to download a save from the right point in the story (we used one right after "Are You Going To San Fierro?"), converted to v1. Put it in a free slot without overwriting existing saves. 5. Launch gta_sa.exe directly, not through the Rockstar Launcher, which may undo the downgrade. Create a CrossOver shortcut for it inside the bottle. Don't put shortcut files on the Mac desktop.

PART 2: MAC/CROSSOVER GOTCHAS (IMPORTANT)

- The game crashes on launch if a settings file (gta_sa.set) saved by a previous session exists. Delete it before every launch. We made the shortcut run a small .bat that deletes it and then starts the game. The downside is that in-game settings reset each launch. - The game stops loading whenever its window isn't the active window. After launching, keep the window focused (Cmd+Tab to it) even if it looks black or invisible. - Force-quitting leaves orphaned Windows processes in the bottle, which silently block future launches. If the game won't start, kill every process in the bottle (or use CrossOver's Force Quit / Restart Bottle), then launch again. - If the camera spins with mouse and keyboard, set the Wine registry value HKCU\Software\Wine\DirectInput MouseWarpOverride = force. Don't enable Retina mode, because it broke launching. - Windowed mode through dxwrapper produced an invisible window on the Mac, so we removed it. Film the full-screen game with Cmd+Shift+5 instead.

PART 3: WRITE THE MISSION

1. Write the mission in Sanny Builder 4 syntax, in GTA SA v1.0 SBL mode, as a CLEO script (.cs). Compile it with Sanny Builder's command-line option (sanny.exe --no-splash --mode sa_sbl --compile input.txt output.cs), run through wine. Compile in a different CrossOver bottle from the game's, so compiling never disturbs a running game. Put the .cs file in the game's cleo folder. It loads whenever a save is loaded. 2. Use real data from the game files, never guesses: - Get interior coordinates and interior IDs from the "enex" sections of the game's .ipl map files. We used the SF diner (DINER2, interior 5) and the Planning Department office (PAPER, interior 3). - Get object model IDs from the .ide files: office chair kb_swivelchair1 (1714), office desk officedesk1 (2008, has a computer on it, top at 0.8 m), computer PC_1 (2190). There is no laptop model in the game. - Measure object sizes by reading vertex bounds from the .dff models inside gta3.img and gta_int.img. - Verify animation names by parsing the .ifp files. We used OFF_Sit_Type_Loop from INT_OFFICE, the prtial_gngtlk talking animations and the business handshake from GANGS, and shout_01 from ON_LOOKERS.

3. Placement rules that took several tries to get right: - The enex coordinates are not floor height. Find the real floor with get_ground_z_for_3d_coord once collision has loaded (after load_scene and about a 1 second wait). - set_char_coordinates already adds the ped's standing height (about 1 m). Pass the floor height itself, not floor + 1, or characters float in mid-air. - A frozen character in mid-air plays a falling pose instead of its animation. Freeze characters only once they're on the floor. - The sitting animation lowers the body by 0.403 m (read from the .ifp file), which lands the hips on a 0.49 m chair seat.

4. Mission flow: - Trigger: a $ blip and marker outside the Doherty garage. Start only when not already on a mission, then set $ONMISSION = 1. - Diner: fade out, teleport inside, place the desk, chairs, computer and co-founder, play the typing animation, set a fixed camera, fade in. - Minigame: draw a fake laptop screen with draw_rect and display_text_formatted. Tap SPACE to prompt the AI and raise a progress bar. A scrolling agent log appears with jokes (spawning subagents, context compaction, auto-approved rm -rf, deleting the tests). Random red bugs appear, and you have 4 seconds to press Y to accept the AI fix. Each bug has its own funny fix reply. Failing costs 12% progress. - At 100%: "SHIPPED!", teleport outside, and a blip marks the investor office downtown. - Office pitch: teleport in, spawn three investors, then three questions with Y or N answers. After each choice, show what CJ said ("CJ: ...") before the investor reacts. Then the $10M offer. Answering N triggers a counter-offer gag where the investors panic and cave. - End: handshake, fade out, teleport outside, add $10,000,000, play the mission-passed tune, show MISSION PASSED. - Fail: if the player dies or gets busted, clean up all spawned objects and characters and show MISSION FAILED.

5. Sanny Builder pitfalls: some variable names clash with built-in names (for example "blip" and "fx"), so rename them. There is a limit on local variables, so reuse them. Check the compiler log after every build.

PART 4: VOICE ACTING

1. Write a list of every spoken line, one file per line, with clear filenames (for example vc_02_q1, cj_01_q1_yes, cofounder_01). Spell out numbers for text-to-speech. 2. Generate the voices with text-to-speech, using original or designed voices 3. Process the clips with ffmpeg: trim leading and trailing silence, cut any extra takes, normalize loudness so all characters play at the same volume, and convert to mono mp3. 4. Transcribe the final clips (we used Whisper locally) and adjust the subtitles to match exactly what was said. 5. Play the clips with CLEO 5's audio plugin (https://t.co/5S72Zv8zaS.cleo): load_audio_stream with "cleo:\vibes\filename.mp3", play it, show the subtitle for exactly the clip's length, then remove the stream. If a clip fails to load, show the subtitle without sound instead of crashing. 6. Optional: real character lines can be pulled from the game's own audio. The file audio/SFX/SCRIPT holds 218 banks of raw 16-bit PCM speech (find them via PakFiles.dat and BankLkup.dat), about 6,800 clips. Extract them to WAV and transcribe them to search for specific lines.

PART 5: TESTING After every change, reload the save and play through the changed part. Ask for screenshots when something looks wrong, especially positions and sitting. Change one thing at a time.