Jump to content

Current Correct Modding Method?


DanLW

Recommended Posts

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!

Link to comment
Share on other sites

Interesting idea. And there really is a lot going on in the background that isn't being shared too frequently in the forum.

 

A mod like the Wasteland has achieved a variety of buffs/debuffs based on player/environmental stats and features just through xml (some incredibly surprising and creative) whereas Score, OCBCore (in development) are incorporating scripts and Harmony patching. Some mods use a specific unity such as NPCMod (2019.1.14f1) since certain scripts were made for it. Others are more flexible.

 

Guppy's Unofficial 7DtD Modding Server over at Discord seems to have attracted a lot of the forum creators with updates being posted here and mod chat and development going on over there.

 

A20 has seen a preponderance of Harmony Patch .dll since it was integrated into the modding side of the game.

 

https://discord.gg/D4BkN3Qy

 

Not my forte at all but I think the above is accurate.

There's something for everyone over there, and well worth a visit.

Link to comment
Share on other sites

I know a few people, like magejosh, has a sanity thing in their mod. I would join the discord arramus linked. Plenty of us there to help and a bit easier to help than the forums here. I would think the vast majority of what you wanna do can be done with just xml using buffs and game events for the zombie spawn type stuff.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...