Jump to content

How do I increase my modded characters speed during night


Recommended Posts

This may have been brought up before but I want it so that when its day my character is slower (90%) but when its dusk their speed is increased (150%) and when its night they have a good amount of speed (200%)

 

I am not really an expertise on coding :|

Link to comment
Share on other sites

Hello @AvgMedic, welcome to the forums. Please be aware that all DST modding related questions should be posted in the  DST Mods and Tools Subforum. I have already moved this post of yours to the correct subforum so you don't have to make another post. Hopefully the right people will be able to help you with your concerns. Just sit tight and wait for a response, it takes a while cause not everyone who could help are probably not online yet.

Cheers.

Link to comment
Share on other sites

Abigail changes its damage with the phase. Wolfgang changes its speed with the mightiness.

local function UpdateSpeed(inst, phase)
    local mult = 1
    if phase == "day" then
        mult = 0.9
    elseif phase == "dusk" then
        mult = 1.5
    elseif phase == "night" then
        mult = 2.0
    end
    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "phase_speed", mult)
end


-- inside master_postinit
inst:WatchWorldState("phase", UpdateSpeed)
UpdateSpeed(inst, TheWorld.state.phase)

 

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...