[V] IdolNinja
Volition Staff
NOTE: This tutorial only works for the new Modding Patch and Steam Workshop support. If you haven't already signed up to beta test, you'll want to do that first.
https://www.saintsrowmods.com/forum/threads/switching-to-the-modding-patch-test.9806/
HOW TO RUN A CUSTOM SRIV GAMEPLAY SCRIPT
Creating a Steam workshop item script that runs on city load is incredibly easy. Here's an example using the new time of day function that we just added in to the patch.
STEP 1:
Create a new lua file for your script. A lua script is simply a text file that you change the extension from .txt to .lua and add your code. For this example we'll name the new script:
gameplay_dynamic_tod.lua
*NOTE: The gameplay_ is important in the script name. Always name a modded script starting with gameplay_ so that the game knows to run the script on city load.
STEP 2:
Inside the script create a new function. This new function name should be the filename of the script, followed by _init.
STEP 3:
Inside your new function put whatever lua commands you want to run. For this example, we'll enable the new dynamic time of day that was just added to the modding beta patch.
NOTE: See the lua reference from the SR3 SDK alpha tools for available commands:
https://www.saintsrowmods.com/Kinzies-Toy-Box/script_actions/_script_actions_index.html
STEP 4:
Package your new script and upload it as a workshop item
That's it! Easy, huh? Keep in mind that you want to make your script names as unique as possible so that they don't overwrite other modders' scripts that may have similar names (or be overwritten.)
NOTE: I've also attached the script itself for reference.
https://www.saintsrowmods.com/forum/threads/switching-to-the-modding-patch-test.9806/
HOW TO RUN A CUSTOM SRIV GAMEPLAY SCRIPT
Creating a Steam workshop item script that runs on city load is incredibly easy. Here's an example using the new time of day function that we just added in to the patch.
STEP 1:
Create a new lua file for your script. A lua script is simply a text file that you change the extension from .txt to .lua and add your code. For this example we'll name the new script:
gameplay_dynamic_tod.lua
*NOTE: The gameplay_ is important in the script name. Always name a modded script starting with gameplay_ so that the game knows to run the script on city load.
STEP 2:
Inside the script create a new function. This new function name should be the filename of the script, followed by _init.
Code:
function gameplay_dynamic_tod_init()
end
STEP 3:
Inside your new function put whatever lua commands you want to run. For this example, we'll enable the new dynamic time of day that was just added to the modding beta patch.
Code:
function gameplay_dynamic_tod_init()
dynamic_tod_enable(true)
end
NOTE: See the lua reference from the SR3 SDK alpha tools for available commands:
https://www.saintsrowmods.com/Kinzies-Toy-Box/script_actions/_script_actions_index.html
STEP 4:
Package your new script and upload it as a workshop item
That's it! Easy, huh? Keep in mind that you want to make your script names as unique as possible so that they don't overwrite other modders' scripts that may have similar names (or be overwritten.)
NOTE: I've also attached the script itself for reference.
Attachments
Last edited: