Jump to content

Need help for modding my character


Recommended Posts

Another mod character's script inspired me to work on my own mod character.

I rewrite the mod in this way:

    function inst.components.locomotor:UpdateGroundSpeedMultiplier()
        _UpdateGroundSpeedMultiplier( self )
        
        if inst.components.sanity.current > 50 then
 
            inst.components.locomotor:SetExternalSpeedMultiplier( inst, "normal speed", 1.1 )
 
        elseif inst.components.sanity.current <= 50 and inst.components.sanity.current > 20 then
 
            inst.components.locomotor:SetExternalSpeedMultiplier( inst, "fast speed", 1.25 )
 
        elseif inst.components.sanity.current <= 20 then
 
            inst.components.locomotor:SetExternalSpeedMultiplier( inst, "top speed", 1.5 )
 
        end
 
    end

This makes my mod character runs faster when in low sanity. Then I want to use 

function inst.components.combat:UpdateDamageMultiplier() to mod on melee attack damage, but this part has no effect in the game.

 

So how can I rewrite this part to make it valid? If possible I don't want to change the overall structure of the mod. This is my starter mod, many thanks for advice :3

 

If possible, I also want to know the right function style to mod sanity drain and attack period in this way.

 

Many thanks:3

Link to comment
Share on other sites

@ArchivistKim, it is recommended to always start by looking at the original files to determine how they work.

 

Damage multiplier is easy because simply set damagemultiplier on the combat component like: inst.components.combat.damagemultiplier = 1

 

As far the other question, take a look at the functions in the combat component and the sanity component; I'm sure you will be able to figure it out from there.

Link to comment
Share on other sites

@ArchivistKim, For the speed multipliers, since you're giving each one a different "key" ("normal speed", "fast speed"), those multipliers will actually be multiplying together as they get applied (so if you start out at 100% sanity and it gradually drops to less than 20, the speed will be 1.1*1.25*1.5, and after that no sanity changes will affect speed). I'm guessing what you want instead is to just use "sanity speed" or something as the key for all of them, so that it changes the multiplier at different sanity levels.

Link to comment
Share on other sites

@ArchivistKim, it is recommended to always start by looking at the original files to determine how they work.

 

Damage multiplier is easy because simply set damagemultiplier on the combat component like: inst.components.combat.damagemultiplier = 1

 

As far the other question, take a look at the functions in the combat component and the sanity component; I'm sure you will be able to figure it out from there.

@Kzisor,I‘ve tried to find some similar functions in the game's data file but failed. Where can I find a list of the game's functions?

Link to comment
Share on other sites

@ArchivistKim, Look at Wigfrid's and Wolfgang's files (data/scripts/prefabs) for damage multipliers.

Thanks very much and I have finished the script of my mod. 

Now I am just wondering whether one character can have several sets of speech.

Take wolfgang as an example, if I want his quotes change with his mightiness, how can I mod on him?

E.g. If he checks hounds when he is strong he will say "tiny beast", when he is skinny he will say "dangerous monster".

Can this be realized in DST?Many thanks :3

Link to comment
Share on other sites

@ArchivistKim, I'm not actually sure about that. Poking around, it looks like the way to do it would be to make two speech files, load them into the character's prefab file, and then on transformation, slot them into the appropriate STRINGS.CHARACTERS entry. So..

local SPEECH_MIGHTY = require "speech_wolfgang_mighty"local SPEECH_WIMPY = require "speech_wolfgang_wimpy"local function transform(inst, mighty)    STRINGS.CHARACTERS.WOLFGANG = mighty and SPEECH_MIGHTY or SPEECH_WIMPYend

I'm not sure if these transitions need to be networked. I don't think they do, but they might.

Edited by rezecib
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
 Share

×
  • Create New...