DerpCatThing Posted July 25, 2023 Share Posted July 25, 2023 I would like to make it so my mod character has night vision when it becomes night. Link to comment Share on other sites More sharing options...
Terry_Rosario Posted July 26, 2023 Share Posted July 26, 2023 I have a character that I couldn't really get to have night vision, so I decided to give him a light that covers the entire screen. I feel that this way is also better because the night vision is quite annoying to the eyes. local function SeeDark(inst) if TheWorld.state.phase == "day" then inst.Light:Enable(false) elseif TheWorld.state.phase == "night" then inst.Light:Enable(true) inst.Light:SetRadius(19) inst.Light:SetFalloff(0.75) inst.Light:SetIntensity(.7) inst.Light:SetColour(70/255,230/255,12/170) end end local refreshTime = 1/5 inst:DoPeriodicTask(refreshTime, function() SeeDark(inst, refreshTime) end) I suppose you can try the same thing to put night vision on it, although I couldn't do it, but I work in DST I'll see if one of these days I decide to put on night vision but I feel satisfied with the light. Link to comment Share on other sites More sharing options...
DerpCatThing Posted July 27, 2023 Author Share Posted July 27, 2023 On 7/26/2023 at 6:17 AM, Terry_Rosario said: I have a character that I couldn't really get to have night vision, so I decided to give him a light that covers the entire screen. I feel that this way is also better because the night vision is quite annoying to the eyes. local function SeeDark(inst) if TheWorld.state.phase == "day" then inst.Light:Enable(false) elseif TheWorld.state.phase == "night" then inst.Light:Enable(true) inst.Light:SetRadius(19) inst.Light:SetFalloff(0.75) inst.Light:SetIntensity(.7) inst.Light:SetColour(70/255,230/255,12/170) end end local refreshTime = 1/5 inst:DoPeriodicTask(refreshTime, function() SeeDark(inst, refreshTime) end) I suppose you can try the same thing to put night vision on it, although I couldn't do it, but I work in DST I'll see if one of these days I decide to put on night vision but I feel satisfied with the light. Ah i assume this would only be seen via the character on multiplayer right? Link to comment Share on other sites More sharing options...
Terry_Rosario Posted July 29, 2023 Share Posted July 29, 2023 Well since this is the DS forum I assumed it was perfect because it's single player, but in multiplayer the others can see by being next to you because you're emitting a light. Link to comment Share on other sites More sharing options...
Glommer2 Posted August 2, 2023 Share Posted August 2, 2023 --try this local function SetNightVision(inst) --This should be obvious if (TheWorld.state.isnight or TheWorld:HasTag("cave"))and getstate(inst)==0 then if not inst:HasTag("nightvision") then inst:AddTag("nightvision") end inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable("images/colour_cubes/purple_moon_cc.tex") else if inst:HasTag("nightvision") then inst:RemoveTag("nightvision") end inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end local common_postinit = function(inst) inst:WatchWorldState( "isday", function() SetNightVision(inst) end) inst:WatchWorldState( "isdusk", function() SetNightVision(inst) end) inst:WatchWorldState( "isnight", function() SetNightVision(inst) end) inst:WatchWorldState( "iscaveday", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavedusk", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavenight", function() SetNightVision(inst) end) SetNightVision(inst) end Link to comment Share on other sites More sharing options...
Glommer2 Posted August 2, 2023 Share Posted August 2, 2023 --try this local function SetNightVision(inst) if (TheWorld.state.isnight or TheWorld:HasTag("cave")) then--getstate is useless here, my bad if not inst:HasTag("nightvision") then inst:AddTag("nightvision") end inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable("images/colour_cubes/purple_moon_cc.tex") else if inst:HasTag("nightvision") then inst:RemoveTag("nightvision") end inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end local common_postinit = function(inst) inst:WatchWorldState( "isday", function() SetNightVision(inst) end) inst:WatchWorldState( "isdusk", function() SetNightVision(inst) end) inst:WatchWorldState( "isnight", function() SetNightVision(inst) end) inst:WatchWorldState( "iscaveday", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavedusk", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavenight", function() SetNightVision(inst) end) SetNightVision(inst) end Link to comment Share on other sites More sharing options...
DerpCatThing Posted September 6, 2023 Author Share Posted September 6, 2023 On 8/2/2023 at 5:15 PM, Glommer2 said: --try this local function SetNightVision(inst) if (TheWorld.state.isnight or TheWorld:HasTag("cave")) then--getstate is useless here, my bad if not inst:HasTag("nightvision") then inst:AddTag("nightvision") end inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable("images/colour_cubes/purple_moon_cc.tex") else if inst:HasTag("nightvision") then inst:RemoveTag("nightvision") end inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end local common_postinit = function(inst) inst:WatchWorldState( "isday", function() SetNightVision(inst) end) inst:WatchWorldState( "isdusk", function() SetNightVision(inst) end) inst:WatchWorldState( "isnight", function() SetNightVision(inst) end) inst:WatchWorldState( "iscaveday", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavedusk", function() SetNightVision(inst) end) inst:WatchWorldState( "iscavenight", function() SetNightVision(inst) end) SetNightVision(inst) end Ah this works perfectly, tho i definatly will be changing the night vision to be either full moon or moggle vision Link to comment Share on other sites More sharing options...
DerpCatThing Posted September 29, 2023 Author Share Posted September 29, 2023 How does the colour cube work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.