SR2 LUA Chaos

The latest version of "Seabound's Essentials" is required to run this mod!

SR2_LUA_Chaos_Logo.png

Welcome to SR2 LUA Chaos! Buckle up for a bumpy ride!

Every 30 seconds, a new, randomly chosen effect will attempt to disrupt your gameplay.
You may teleport. You may fall over. You may explode. It's all random!


CURRENT EFFECT TOTAL: 52 EFFECTS (v1.0.2)


YOUR OWN BRAND OF CHAOS!:
  • Open "sr2_chaos.lua" (Notepad++ will work), and you'll find a whole bunch of Config Settings to tweak your LUA Chaos experience!
  • Enable/Disable Effects, tweak Effect Durations, and various other factors about each Chaos Effect.
  • There are also things to pay attention to before running for the first time, such as controller input and mod compatibility settings.


NOTES:
  • If you find you need to restart the mod for whatever reason, press SHIFT + C at the exact same time, and a new effect will be triggered.
  • There is currently no on-screen timer due to limitations with HUD options, but generally, effect names will remain on screen for as long as the effect is active (if it has a duration).
  • It is not recommended to use this mod on a save you care too much about. Instead, you can make a duplicate of an existing save, or start a new game.


INSTALLATION:
The latest version of "Seabound's Essentials" is required to run this mod!

via Juiced Patch Mod Manager:
1. Run "SR2JP.Mod.Manager.exe".
2. Click the "import mod" icon in the top left of the window.
3. Select "SR2 LUA Chaos.zip".
4. Adjust your load order if you need to.
5. Launch Saints Row 2 for unbridled chaos!

via Gentlemen Of The Row (Patch Builder):
1. COPY the "sr2_chaos" files provided by this mod.
2. PASTE into "Gentlemen_of_the_Row_Saints_Row_2_Super_Mod_v1.9.2\optional_mod_stuff\1-MODDERS_-_PUT_YOUR_OWN_PERSONAL_MODS_HERE".
3. Rebuild your Gentlemen Of The Row custom patch by double-clicking "Create_Custom_GotR_v1.9.2.bat" and following the instructions.
4. Move the newly created contents of "MY_CUSTOM_PATCH" into your Saints Row 2 root folder (Where SR2_pc.exe is located.).
5. Launch Saints Row 2 for unbridled chaos!

via SR2ModManager:
1. Create a new folder in "SR2ModManager_v2.07\mods". Call it "SR2 LUA Chaos".
2. COPY the "sr2_chaos" files provided by this mod.
3. PASTE into the "SR2 LUA Chaos" folder you created.
4. Run "SR2ModManager.exe" and tick the "SR2 LUA Chaos" folder you created.
5. Compile your "patch.vpp_pc" and move it from "SR2ModManager_v2.07\patch_vpp_pc_new" into your Saints Row 2 root directory (Where SR2_pc.exe is located).
6. Launch Saints Row 2 for unbridled chaos!


CREDITS:
- "Chaos Mod V" by pongo1231 & ChaosMod Team - The GTAV Chaos mod that inspired this one.
- "Sandbox++" by nclok1405 - Which has been a handy reference for some of the effects.
- DarkViperAU for his long running GTAV Chaos series.

- "Juiced Patch" by Kobraworks
- "Juiced Patch Mod Manager" by @Uzis
- "Gentlemen Of The Row" by IdolNinja
- "SR2ModManager" by Masamaru

The latest version of "Seabound's Essentials" is required to run this mod!
 

Attachments

Last edited:
I turned off the Outfit effects since I love my play_as too much (I assume it would crash with the Outfit chaos effects, but didn't try). Due to that I also didn't test with missions since I recall cutscenes not playing well with it.

Since chaos mod is chaos mod, I feel it's appropriate comments are in a spoiler tag.

Note: I tweak the game to be pretty easy for myself - more stamina, tweaking difficulty_levels.xtbl to have low damage received but very slow regen, etc - so my experience may differ than most.
Juiced Patch latest, non-GOTR, FixGFL1_for_female_playas=0;
Explosive Ped Effect not getting deactivated over time - I got Explosive Peds, entered a Racing activity, canceled it because skill issue (not due to the mod, lol) and rammed into a pedestrian a whole 3 minutes later. you can guess how well this went (it exploded, of course)
Thankfully respawning turned the effect off.
Unless, of course, this is intentional to be a OHKO moment for the player, though the message didn't really convey that feeling.

Chaos Effects not activating: Pimp My (Scripted) Ride happened outside a car, had a "Something is blocking your path", got another Pimp My (Scripted) Ride (assuming the previous one faded away, didn't notice. Then I got a Random Activity Teleport alll the way to the Prison Fight Club. As I got out of the prison, I noticed there are no boats at the docks in vanilla... and that no other effect had occured after more than a minute at the island. | Sadly I did not have WriteFile turned on during this session, so I can't send the debug.txt (BOOOOOOOOO)
After a ??? and Advertisement about Semi Broken and getting threatened about them coming to me if I don't come for them, the Chaos effects seem to stop. (not visible in debug.txt, so sent the log window.)
There are other instances of this happening as well, the only trend I could pinpoint was that they occured after a while. It's possible the problem is with me setting CHAOS_PIMPIN_AINT_EASY and CHAOS_RANDOM_OUTFIT to false.

Crash - Started a little fight with the Brotherhood, later got Random Notoriety, as I was shooting more Brotherhood members and got a drive-by diversion prompt. "Oh cool, let's do it" - press E, crash! Inserted a screenie:
epic_screenshot.jpg

So epic of a crash, Paint.NET stopped responding!

I'll send you the full relevant debug.txt in a DM, but here's the last few lines that are probably most relevant;
Code:
[LUA] sr2_city.lua: sr2_sandbox_plus_plus.lua could not be found.
[LUA] LUA CHAOS: Police Dispatch (Function)
[LUA] LUA CHAOS: Bullets Cost Money (Thread)
[LUA] LUA CHAOS: Breaking News (Function)
[LUA] LUA CHAOS: Random Notoriety (Function)
[LUA] Hud_gsi.elements.icon_h: should be invisible
[DLL] -- Ran into an error at 0x00CFFF9E --
Of course, could also be loose.txt etc etc.

Random Movement Animations didn't seem to work
Using play_as, Random Movement Anims didn't change movement. It did cause Luz to stand in a different pose though. Log doesn't say much (just says the event initiated).
luz_diffpose1.jpg

luz_diffpose2.jpg


When the mash E to get up mechanic plays, the cops had a hard time to actually land their shots - they seem to be shooting the air. Not sure if changing player scale changes hitbox - if it does you could probably make it really small directly before putting them in the downed state then setting to normal again (although this might cause issues with CHeight).
Maybe some effects could be forced to work in activities? For example, Random Notoriety didn't do anything in Racing.
Inversely, some events could check if the player is even on a mission for things such as Print My Scripted Ride (or if you wanted to be evil, the Cancel Activity/Mission).
Map Flashing's current implementation (v1) reduces the framerate of the game even in Ugly mode, although I have a "potato" CPU and GPU. Of course, I could disable it from happening, but just letting you know.

Play Random Song doesn't seem to respect the player's volume settings, cue the loudest "HEY GWAN HEY GWAN" song I've ever heard starts blaring in the middle of a firefight.
Then the song ended... and Chaos Effect RNG started playing another song. Did you script this? LOL

Probably not possible, but can the Playa be given the ability to shoot while being chained?

Bullets Give Money is INSANE lol. I shot an SMG (clicking rapidly instead of hold down) and went from 2.5k to 145k pretty dang quick!!! This felt broken, so I didn't save.
Play Pause Music is brilliant. It feels like getting a rickroll. Or, to pinpoint a more specific example it reminds me of;
The fact it stops immediately when I die and respawn is funny as hell.
---
I initially was scared of the fact New Things (tm) could happen to my experience, but ended up liking the experience for the Bad Rats quality it currently has. If you make new major versions I honestly suggest keeping old versions archived, since I'm sure it'll be a different experience each iteration.
Other than the chaos effects randomly stopping occuring (I assume they always happen once every ~30 seconds by default), it really makes the game feel fresh. And I never even went in a mission!
 
Last edited:
I turned off the Outfit effects since I love my play_as too much (I assume it would crash with the Outfit chaos effects, but didn't try). Due to that I also didn't test with missions since I recall cutscenes not playing well with it.
I didn't test everything with cutscenes, tbh. Some effects crashed cutscenes, so have been disabled while they're playing. Ragdoll and Outfit effects affect cutscenes though.
Explosive Ped Effect not getting deactivated over time - I got Explosive Peds, entered a Racing activity, canceled it because skill issue (not due to the mod, lol) and rammed into a pedestrian a whole 3 minutes later. you can guess how well this went (it exploded, of course)
Thankfully respawning turned the effect off.
Unless, of course, this is intentional to be a OHKO moment for the player, though the message didn't really convey that feeling.
Explosive peds is set up so you forget about it over time, then when you explode you go "Oh, yeah...". But I can make a note to tweak it to be kinder for the next update.
Chaos Effects not activating: Pimp My (Scripted) Ride happened outside a car, had a "Something is blocking your path", got another Pimp My (Scripted) Ride (assuming the previous one faded away, didn't notice.
Pimp My Scripted Ride will only work for vehicles loaded by a mission script, if you are driving it. Previously, I had it so all scripted vehicles randomised variants at once, but this caused various issues with vehicle pathing, fade-outs, and helicopter spotlights. I'm hoping to find a way to make it work for vehicles outside of missions.
Then I got a Random Activity Teleport alll the way to the Prison Fight Club. As I got out of the prison, I noticed there are no boats at the docks in vanilla...
I plan to merge all teleport locations into one effect for the next update, so the odds of it happening are reduced.
no other effect had occured after more than a minute at the island. | Sadly I did not have WriteFile turned on during this session, so I can't send the debug.txt (BOOOOOOOOO)
After a ??? and Advertisement about Semi Broken and getting threatened about them coming to me if I don't come for them, the Chaos effects seem to stop. (not visible in debug.txt, so sent the log window.)
There are other instances of this happening as well, the only trend I could pinpoint was that they occured after a while. It's possible the problem is with me setting CHAOS_PIMPIN_AINT_EASYand CHAOS_RANDOM_OUTFITto false.
I'm aware of this issue, but not sure why it happens yet. This is why I built in a restart feature. Press "SHIFT + C" at the exact same time to restart the mod.

It's possible it's to do with how disabled effects are handled. If the RNG choses a number for an effect which is disabled, it instantly chooses another number for a different effect. This could theoretically happen multiple times in a frame though. So maybe it's to do with that.
Crash - Started a little fight with the Brotherhood, later got Random Notoriety, as I was shooting more Brotherhood members and got a drive-by diversion prompt. "Oh cool, let's do it" - press E, crash! Inserted a screenie:
epic_screenshot.jpg

So epic of a crash, Paint.NET stopped responding!
I've made a note to look into this.
Random Movement Animations didn't seem to work
Using play_as, Random Movement Anims didn't change movement. It did cause Luz to stand in a different pose though. Log doesn't say much (just says the event initiated).
luz_diffpose1.jpg
I initially had bigger plans for that effect, but using some of the anim states caused issues with weapons (like the red crate in this post), due to those anim groups falling back on states which weren't meant for weapons. There are more states in the relevent tables, (such as "cowering" states), but they are commented out. Running anims don't randomise for the same reason. There's only one which works with weapons. So only Stand and Walk get randomised.
When the mash E to get up mechanic plays, the cops had a hard time to actually land their shots - they seem to be shooting the air. Not sure if changing player scale changes hitbox - if it does you could probably make it really small directly before putting them in the downed state then setting to normal again (although this might cause issues with CHeight).
I'm not sure there's any fix for that through lua.
Maybe some effects could be forced to work in activities? For example, Random Notoriety didn't do anything in Racing.
Inversely, some events could check if the player is even on a mission for things such as Print My Scripted Ride (or if you wanted to be evil, the Cancel Activity/Mission).
That's exactly the kind of thing I need to do more testing for.
Map Flashing's current implementation (v1) reduces the framerate of the game even in Ugly mode, although I have a "potato" CPU and GPU. Of course, I could disable it from happening, but just letting you know.
Ah, I didn't realise that. I've made a note to look into it.
Play Random Song doesn't seem to respect the player's volume settings, cue the loudest "HEY GWAN HEY GWAN" song I've ever heard starts blaring in the middle of a firefight.
Then the song ended... and Chaos Effect RNG started playing another song. Did you script this? LOL
I'm not sure why they're louder. That function doesn't control volume. The function I'm using for that plays the audio in 2d. I could try making it 3d and tie it to the player. The audio menu slider should still affect it though.

It's not scripted that way, you just got unlucky! It is possible for songs to double up though.
Probably not possible, but can the Playa be given the ability to shoot while being chained?
I'd doubt it. There is a force shoot function though. Not sure if that would work while ragdolled. (I know that's not what you're asking though.)
Bullets Give Money is INSANE lol. I shot an SMG (clicking rapidly instead of hold down) and went from 2.5k to 145k pretty dang quick!!! This felt broken, so I didn't save.
Ah, but there is also Bullets COST Money. The idea is that it can balance out somewhat. There may be more cash effects in the future.

But yeah, I wouldn't recommend using this mod on a save you care too much about. I'll make a note of that in the OP.
Play Pause Music is brilliant. It feels like getting a rickroll. Or, to pinpoint a more specific example it reminds me of;
The fact it stops immediately when I die and respawn is funny as hell.
I was planning to have this effect play for a duration. I wasn't sure if the track was looping or not, but I think it is. But if it's better that way, I guess I'll leave it as is. (I'm not deleting this song!!!)
I initially was scared of the fact New Things (tm) could happen to my experience, but ended up liking the experience for the Bad Rats quality it currently has. If you make new major versions I honestly suggest keeping old versions archived, since I'm sure it'll be a different experience each iteration.
Other than the chaos effects randomly stopping occuring (I assume they always happen once every ~30 seconds by default), it really makes the game feel fresh. And I never even went in a mission!
Glad you're enjoying it, and thanks for the feedback!

One more note on the lack of an on-screen effect interval timer; It's not possible to display the HUD timer/bar elements from missions in freeroam. The plan was to have a pink bar in the top left counting down to the next effect. The workaround is that the name of the effect will remain on-screen for it's duration (unless it's an effect without a duration). I could make a countdown timer appear in the same place as effect names, but it could interfere with the effect names.
 
Explosive peds is set up so you forget about it over time, then when you explode you go "Oh, yeah...". But I can make a note to tweak it to be kinder for the next update.
Yeah, it would be kinder if it has a time limit like other effects since functionally it's an OHKO (which has a time limit) and I understand it would also trigger if a pursuing enemy rammed your vehicle into a ped.
On the other hand, you could also use character_damage() (link) to make it deal massive damage instead like 900. ex: character_damage( LOCAL_PLAYER, 900) (though it doesn't play the pain shout). I notice it taking difficulty_levels.xtbl into account though, so it would vary based on the difficulty.

I was planning to have this effect play for a duration. I wasn't sure if the track was looping or not, but I think it is. But if it's better that way, I guess I'll leave it as is. (I'm not deleting this song!!!)
Haha, yeah, it went for ages.
I think it would be better to just have an obnoxiously long duration, like 3-6 minutes (you can probably implement this through a loop counter). It feels restrictive to be forced to go into an Mission/Activity or get Smoked to stop it, especially since it can stack.

It's also worth noting it's not as loud as Play Random Song because of music.xtbl specifying the volume of each music entry.
 
Yeah, it would be kinder if it has a time limit like other effects since functionally it's an OHKO (which has a time limit) and I understand it would also trigger if a pursuing enemy rammed your vehicle into a ped.
On the other hand, you could also use character_damage() (link) to make it deal massive damage instead like 900. ex: character_damage( LOCAL_PLAYER, 900) (though it doesn't play the pain shout). I notice it taking difficulty_levels.xtbl into account though, so it would vary based on the difficulty.
I'll think about removing the character_kill() function from that effect. The explosion on it's own has a chance to kill the player anyway if ragdolled in the right way.

Btw; A way around max HP multipliers would be to get the player's max HP, then divide it by what ever fraction of damage you'd want to inflict. That way, the damage applied scales no matter the max HP.
Code:
local variable = get_max_hit_points(LOCAL_PLAYER) / 4    -- 1 quarter of whatever max HP is.
characater_damage(LOCAL_PLAYER, variable)    -- Apply 1 quarter of max HP in damage.
Haha, yeah, it went for ages.
I think it would be better to just have an obnoxiously long duration, like 3-6 minutes (you can probably implement this through a loop counter). It feels restrictive to be forced to go into an Mission/Activity or get Smoked to stop it, especially since it can stack.

It's also worth noting it's not as loud as Play Random Song because of music.xtbl specifying the volume of each music entry.
I'll give it a timer. I wish there was a way to override the volume through lua, but I'm not sure there is.
 
Btw; A way around max HP multipliers would be to get the player's max HP, then divide it by what ever fraction of damage you'd want to inflict. That way, the damage applied scales no matter the max HP.
Apologies incase I'm being pedantic, but does SR2 have upgrades to increase the player's max HP? I thought only SR3 and above had those as upgrades.
IIRC the player's max health is always 1000 unless modded, and that the difficulty only scales the damages done and received (amongst other things).
From common.vpp_pc:
XML:
<Difficulty_Levels>
            <Difficulty_Level>0.0<Damage_Received_Mult>0.45</Damage_Received_Mult>
                <Health_Regen_Wait_Mult>0.6</Health_Regen_Wait_Mult>
                <Health_Regen_Speed_Mult>1.3</Health_Regen_Speed_Mult>
                <Damage_Dealt_Mult>1.1</Damage_Dealt_Mult>
                <Notoriety_Decay_Mult>1.3</Notoriety_Decay_Mult>
                <Homie_Revive_Timer_Mult>1.33</Homie_Revive_Timer_Mult>
                <Vehicle_Damage_Received_Mult>0.6</Vehicle_Damage_Received_Mult>
                <Player_Ram_Delay>240</Player_Ram_Delay>
                </Difficulty_Level>
            <Difficulty_Level>0.0<Damage_Received_Mult>0.75</Damage_Received_Mult>
                <Health_Regen_Wait_Mult>1.0</Health_Regen_Wait_Mult>
                <Health_Regen_Speed_Mult>1.0</Health_Regen_Speed_Mult>
                <Damage_Dealt_Mult>1.0</Damage_Dealt_Mult>
                <Notoriety_Decay_Mult>1.0</Notoriety_Decay_Mult>
                <Homie_Revive_Timer_Mult>1.0</Homie_Revive_Timer_Mult>
                <Vehicle_Damage_Received_Mult>0.8</Vehicle_Damage_Received_Mult>
                <Player_Ram_Delay>60</Player_Ram_Delay>
                </Difficulty_Level>
            <Difficulty_Level>0.0<Damage_Received_Mult>1.1</Damage_Received_Mult>
                <Health_Regen_Wait_Mult>1.3</Health_Regen_Wait_Mult>
                <Health_Regen_Speed_Mult>0.5</Health_Regen_Speed_Mult>
                <Damage_Dealt_Mult>0.75</Damage_Dealt_Mult>
                <Notoriety_Decay_Mult>0.7</Notoriety_Decay_Mult>
                <Homie_Revive_Timer_Mult>0.5</Homie_Revive_Timer_Mult>
                <Vehicle_Damage_Received_Mult>1.2</Vehicle_Damage_Received_Mult>
                <Player_Ram_Delay>5</Player_Ram_Delay>
                </Difficulty_Level>
            </Difficulty_Levels>
This means when you change difficulty the game doesn't do fancy calculations on what your health should be.

That said, I do think it's a better way to calculate a percentage of the player's HP should they choose to mod it!

EDIT: Surprisingly, play_as npc morphs don't crash the game with the outfit effects! It does apply to your base character when you use reset_player though (but still can't use the outfit menus with, probably due to the npc morph itself).
 
Last edited:
Apologies incase I'm being pedantic, but does SR2 have upgrades to increase the player's max HP? I thought only SR3 and above had those as upgrades.
IIRC the player's max health is always 1000 unless modded, and that the difficulty only scales the damages done and received (amongst other things).
From common.vpp_pc:
Ah, my bad. I just misunderstood slightly. I haven't actually looked at that file yet, tbh.
I could be wrong (I haven't done a playthrough in ages), but I think there are health boosts available through Activities.
 
SR2 LUA Chaos - Update v1.0.1!

  • "Random Movement Animation" effects have been split into two effects: "Random Stand" and "Random Walk".
  • "Teleport" effects have been consolidated into one effect, to make the chance of one occurring less frequent and more consistent.
  • "Play Random Song" now has a Volume setting.
  • "Car Bomb" is now a timed effect.
  • "Explosive Pedestrians" is now a timed effect.
  • "Play Pause Music" is now a timed effect.
  • Fixed a delay after loading into a save which blocked other scripts from loading.
  • Fixed an issue where some debug messages were not printing.
 
Back
Top