Jump to content

Recommended Posts

You can use the function CanEntitySeeTarget to see if you can see yourself in the darkness (how most things usually do it I think).

If yes, give them speed.

if no, remove speed if its there.

Giving/removing speed modifiers is tricky, since it changes based on what version of the game you are running (base, rog, sw, hamlet).

Hi
@BillTheCipher

At the first glance this might work, but I haven't ran the complex test. You need to copy and paste everything under "master_postinit".

 

local function lanuit(inst)
	if TheWorld.state.isnight then 
		inst.components.locomotor:SetExternalSpeedMultiplier(inst, "ilya_speed_mod", 5)
	else
		inst.components.locomotor:SetExternalSpeedMultiplier(inst, "ilya_speed_mod", 1.25)		
	end
end	
	
	inst:DoPeriodicTask(30, lanuit, nil, inst)

You need to replace "YOURCHARACTER'SNAME_speed_mod" to something like "billy_speed_mod" or whatever your character name is.
Value of "5" is the night speed and the other one (1.25) is the default speed of your characer.

Your mod will check time every 30 seconds thus "inst:DoPeriodicTask(30...". And that means your character might be running on high octane fuel till the next morning.

Cheers!
 

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