In this tutorial I will be showing you the process of extracting and packing Saint's Row 2's .vpp_xbox2 files, mainly the modding process of sr2_city.lua which is located in misc_tables_city.vpp_xbox2. NOTE: This does not work on Saint's Row 3 or 1. Prerequisites: A brain and a computer not running DOS with the .Net Framework Gibbed SR2 Tools Legally Backed-up version of Saints Row 2 LUA programming experiance is needed if you plan on making your own mods WX360 or X360 Backup Creator Extraction of VPP_Xbox2 Files Open your ISO into your Xbox ISO explorer of choice Browse to the folder packfiles\xbox2, this is where all your vpp files are located For this tutorial I am going to be modifying the misc_tables_city pack file Extract to the folder of your choosing, but for this tutorial I am going to be extracting to C:\SR2\ Now extract Gibbed's tools to the same folder you extracted the VPP to, so for me it will be C:\SR2\ Now open the command prompt Type the command cd [LOCATION OF TOOLS AND VPP ie C:\SR2] Now type unpack misc_tables_city.vpp_xbox2 If everything went correctly you should have extracted the VPP archive and all it's contents Packing the VPP_Xbox2 files Go back to you command prompt and type pack -bc misc_tables_city This should yield misc_tables_city_PACKED.vpp_pc, just rename the extension to .vpp_xbox Editing sr2_city.lua] NOTE: If you do not know LUA or any scripting/programming language STOP HERE! Sr2_city.lua is the file that is first run in the game, it initializes the city and everything in it. To create our own function we must first create a new thread handle like so Spoiler Your_Thread = INVALID_THREAD_HANDLE Then we must create a new thread in the sr2_city_main() function. Spoiler Your_Thread = thread_new("OurFunctionThread") Now we can make our function that we will code Spoiler function OurFunctionThread() while(1)thread_yield() -- VERY IMPOTANT! If this is not here you will cause a crash andor a black ---- --screen, thead yielding for all loops are needed!--Place all mods in hereendend Now we must create the button enumeration list Spoiler BTN_A = 0 BTN_B = 1 --Cannot be use for some reason BTN_X = 2 BTN_Y = 3 BTN_LB = 4 BTN_RB = 5 BTN_LT = 6 BTN_RT = 7 BTN_RIGHT = 8 BTN_UP = 9 BTN_LEFT = 10 BTN_DOWN = 11 BTN_START = 12 BTN_BACK = 13 BTN_LS = 14 BTN_RS = 15 BTN_UNKNOWN = -1 For the purpose of this tutorial I will be showing a quick demonstration of giving money and a weapon on button press. Spoiler function OurFunctionThread() while(1) if player_button_just_pressed(BTN_LB) thencash_add(1000000,LOCAL_PLAYER)inv_weapon_add_temporary(LOCAL_PLAYER, "chainsaw", 1, true, true)endthread_yield()endend This code adds 1000000$ and gives a chainsaw to the local player Other LUA Related Items Item and other useful related things Spoiler ------------------------------------------------------------ XBOX Button Numbers: A = 0 B = 1 X = 2 Y = 3 LB = 4 RB = 5 LT = 6 RT = 7 Right = 8 UP = 9 Left = 10 Down = 11 Start = 12 Back = 13 LS = 14 RS = 15 ------------------------------------------------------------ Player Types: LOCAL_PLAYER REMOTE_PLAYER CLOSEST_PLAYER CLOSEST_TEAM1 CLOSEST_TEAM2 PLAYER_TAG_LIST = { "#PLAYER1#", "#PLAYER2#", "#PLAYER3#", "#PLAYER4#", "#PLAYER5#", "#PLAYER6#", "#PLAYER7#", "#PLAYER8#" } ------------------------------------------------------------ Sync Types: SYNC_REMOTE SYNC_LOCAL SYNC_ALL ------------------------------------------------------------ GameMode Names: (Called with get_game_play_mode()) Braveheart Gangsta Brawl Team Gangsta Brawl Diversion Pushback Multiplayer Creation Multiplayer Customization Multiplayer Tutorial Multiplayer Game Results Pre-game lobby ------------------------------------------------------------ Useful Functions: player_button_just_pressed(button#/Use the above enum) cash_add(amount,player) get_char_vehicle_name(player) inv_weapon_add_temporary(target,itemName,numToGive,infinteAmmo,forceSwitch) ------------------------------------------------------------ Functions made by others: --Sends a message to all client screens NOTE: If not localized on client it will show a message saying unrecognized hash function MessageLobby(text) objective_text_clear(0)mission_help_table(text, "", "", SYNC_ALL)end --Sends a message to your screen function MessageSelf(text) objective_text_clear(0)mission_help_table(text, "", "", SYNC_LOCAL)end ------------------------------------------------------------ Weapon Names: Thrown: grenade molotov pipe_bomb flashbang satchel satchel_barrel Pistols: glock beretta magnum desert eagle Holt_55 SMGs: tec9 SKR-9 Gal43 Shotguns: twelve_gauge pump_action_shotgun bean_bag_gun AS14 XS-2 pimpcane Rifles: ak47 m16 AR50 AR200 Ranged: minigun rpg_launcher flamethrower mcmanus2010 rpg_annihilator AR50_launcher fireext AR200_ss03 Melee: samurai_sword shock_paddles pepper_spray machete butterfly_knife pimp_slap sledgehammer stun_gun tire_iron nightstick knife baseball_bat chainsaw dual_swords Misc: video_camera pcp large_softdrink 40oz Detonator giegerCounter pyroBox ------------------------------------------------------------ Costume Names: Police Outfit Suit 1 Sexy 1 Street 1 Crazy 1 Repair Streaker Suit Purple Man Suit Purple Woman Fire Fighter 1 Pimp 1 Fire Suit Fire Fighter Prision Pirate Cat Evil Doctor Slasher 1 Hippie Barbershop Construction Hazmat Clown Mime Japanese Streaker Male Japanese Streaker Female My sr2_city.lua file
I would try this out, but I don't have SR2. I know you do good work though CRACKbomber. Will probably pick it up later.
Woah, i was just about to look into saints row modding today and then this comes out. You sir are a hero.
Very nice work there CRACKbomber just have to say I really dig the sharing of full modding methods/tutorials like this, mods and files can be shared but passing on knowledge is what makes the world go 'round , so big +rep and thanks for that!!
you packed a .vpp_pc not an xbox file, im guessing that doesnt matter right? Just replace it in wx360 after
This looks nice thanks for this, it looks abit like the way GTA IV scripts are coded so I might try this out. Is the lua file you provided modded?
My findings works perfectly on single player. Crack could you please make a config list for mods in the pre-modded file. Also mods don't work on Multiplayer. Could you please see if you can add the cash mod to MP Thank you very much.
Hey can you please explain how to use and the controls for each menu in the game included in that example sr2_city.lua you included in this thread. I am trying it out on my x360key but I am confussed on how to use the mods.
Please could you write out a button list for the pre-modded files provided and could you possible look at MP to see if the money bind would be able to be added. Thanks for you time