Bottom line up front: Which modding tool is current (link to current site would be helpful), and can I use a script to trigger a sound to play.
Discussion:
I'm trying to get started in modding but there is a lot of jumbled old/new information out there and I want to make sure I am on the right path before I dedicate lots of time to doing it wrong...
What is the current for 2022 modding method? Is SDX replaced with DMT? Is DMT Harmony? Where do I start?
Here is what I've done so far:
Installed/licensed Unity 2020.3.4111, working through Unity's tutorial project...
Copied SDXCore into my Mods folder and examined ui scripts to try to determine how to obtain values
What I am trying to accomplish:
I want to try making a sanity mod that will run a sanity calculation based off current health/hunger/thirst/debuffs and randomly play a sound if sanity is below a certain threshold. Is this possible? I'm pretty sure I can get the variables from the player, running the actual calculation is trivial, but I don't know if I can make the game play a sound based off an event that isn't currently coded into the game.
Here is some pseudocode. (I can write the code myself, just want some experienced modders to tell me if what I am trying to accomplish is possible)
// Initialize variables
int health, stamina, hunger, thirst, infected, maxHealth, maxStamina, etc...
float pctHealth, pctStamina, etc...
float sanity
boolean concussion, lasceration, borken bone, sprain
// Code so that function only runs once every 60 seconds or so
Use a delay or possibly check game time and run below function when evenly divisible by a predetermined number
Sanity()
// Get values from current character state
get health, stamina, etc...
// Prepare for calculation
Convert each stat into a percentage
Apply weightings to debuffs such as concussion, etc by converting to a preset float if true (if concussion = true, pctConcuss = .2)
sanity = average of above
// Run calculation
Multiply average against random number (so sound doesn't play every time)
if sanity < threshold
generate random number between x and y
play a sound based off number generated above
else end
If I can get this to work I would like to try to expand into triggering events other than sounds such as momentary lighting changes, or even spawn and quickly despawn a zombie in front of the player
Thanks!
Discussion:
I'm trying to get started in modding but there is a lot of jumbled old/new information out there and I want to make sure I am on the right path before I dedicate lots of time to doing it wrong...
What is the current for 2022 modding method? Is SDX replaced with DMT? Is DMT Harmony? Where do I start?
Here is what I've done so far:
Installed/licensed Unity 2020.3.4111, working through Unity's tutorial project...
Copied SDXCore into my Mods folder and examined ui scripts to try to determine how to obtain values
What I am trying to accomplish:
I want to try making a sanity mod that will run a sanity calculation based off current health/hunger/thirst/debuffs and randomly play a sound if sanity is below a certain threshold. Is this possible? I'm pretty sure I can get the variables from the player, running the actual calculation is trivial, but I don't know if I can make the game play a sound based off an event that isn't currently coded into the game.
Here is some pseudocode. (I can write the code myself, just want some experienced modders to tell me if what I am trying to accomplish is possible)
// Initialize variables
int health, stamina, hunger, thirst, infected, maxHealth, maxStamina, etc...
float pctHealth, pctStamina, etc...
float sanity
boolean concussion, lasceration, borken bone, sprain
// Code so that function only runs once every 60 seconds or so
Use a delay or possibly check game time and run below function when evenly divisible by a predetermined number
Sanity()
// Get values from current character state
get health, stamina, etc...
// Prepare for calculation
Convert each stat into a percentage
Apply weightings to debuffs such as concussion, etc by converting to a preset float if true (if concussion = true, pctConcuss = .2)
sanity = average of above
// Run calculation
Multiply average against random number (so sound doesn't play every time)
if sanity < threshold
generate random number between x and y
play a sound based off number generated above
else end
If I can get this to work I would like to try to expand into triggering events other than sounds such as momentary lighting changes, or even spawn and quickly despawn a zombie in front of the player
Thanks!