fluffnflight Posted June 5, 2017 Share Posted June 5, 2017 Hello! I am making a mod for Chat Noir from Miraculous Ladybug, and I've finished all of the art and coding aside from specific character abilities. If somebody could, would you be awfully kind in helping me figure out how to make him weak to rain, see in the dark(if possible?), and able to poison, similar to the sans mod here? https://steamcommunity.com/sharedfiles/filedetails/?id=559804807 Link to comment Share on other sites More sharing options...
Lumina Posted June 5, 2017 Share Posted June 5, 2017 For the rain damage, you could look at WX-78 files. See in the dark probably require night vision, maybe in woodie files. For the poison, it would probably require more work. Link to comment Share on other sites More sharing options...
fluffnflight Posted June 5, 2017 Author Share Posted June 5, 2017 I consulted with the creator of that Sans mod, who helped me with the weakening to rain and the ability of poison. However, I still can't seem to pinpoint how to narrow down the ability of night vision. Link to comment Share on other sites More sharing options...
fluffnflight Posted June 6, 2017 Author Share Posted June 6, 2017 local function SetBeaverVision(inst, enable) if enable then inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable(BEAVERVISION_COLOURCUBES) else inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end How would this be changed(if this is the correct sequence) to be able to incorporate night vision into a character ability? Link to comment Share on other sites More sharing options...
fluffnflight Posted June 8, 2017 Author Share Posted June 8, 2017 Can I get tips on how to fix this? Link to comment Share on other sites More sharing options...
pickleplayer Posted June 9, 2017 Share Posted June 9, 2017 Is there anything calling those functions? Before you can worry about whats in them, you have to find a way to call them when its dark/bright respectively so they will run. Where are those functions from? Can you figure out what's calling them? Maybe you could use an event listener to call them. I happen to remember an event listener I used in one of my old mods for a character when entering the dark. inst:ListenForEvent("enterdark", function(inst) --you can put the code you want to run in here-- inst.entity:AddLight() --like probably this, --and the rest of whatever was in that function end) You can put that in the master_postinit of your character. Whatever is inside of it will run every time your character enters full darkness. I remember that "enterdark" is the event name for entering darkness, but I don't remember the event name for leaving darkness. I'm sure there is one though. Link to comment Share on other sites More sharing options...
Leonardo Cox Posted June 9, 2017 Share Posted June 9, 2017 Nightvision has to be run inside of common_postinit. local NIGHTVISION_COLOURCUBES = { day = "images/colour_cubes/ruins_light_cc.tex", dusk = "images/colour_cubes/ruins_dim_cc.tex", night = "images/colour_cubes/purple_moon_cc.tex", full_moon = "images/colour_cubes/purple_moon_cc.tex", } local function SetNightVision(inst, enable) --This should be obvious if TheWorld.state.isnight or TheWorld:HasTag("cave") then inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable(NIGHTVISION_COLOURCUBES) else inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end end --In common_postinit 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) --This is here to make sure the NightVision is enabled when a player rejoins. This is the code I use in my mod. I'm sure theres a better way to WatchWorldState bit, but it'll work. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now