Jump to content

How can I add Wagstaff vision to my character, but only daytime?


Recommended Posts

On 11/22/2020 at 10:30 AM, BillTheCipher said:

Hey!

Basically the title. He would see worse daytime, but normally in dusk- and night time.

The absolute best would be if it wouldn't be activate at all in the caves.

The time of day is separate for caves and the overworld, so basically you can create code for the overworld day and it wouldn't affect daytime in caves.

 

local function AtDay(inst)     

	if TheWorld.state.isday then           
		--turn on wagstaff vision (I do not know how to do specifically this)
		else
	--turn off wagstaff vision (I also do not know how to do specifically this)
	end
	
end

---put the code above in yourcharacter.lua

---put the code below inside the master_postinit within yourcharacter.lua

	inst:WatchWorldState("isday", AtDay)

Also I would like to thank you for creating this post because I could use this information about the blindness part myself.

Edited by Earthyburt
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...