Goregonzola Posted October 8, 2020 Share Posted October 8, 2020 I've succesfully made my custom character immune to Charlie, the next step would be to make him faster in total darkness. Is there a simple code for it I could use? Link to comment Share on other sites More sharing options...
penguin0616 Posted October 8, 2020 Share Posted October 8, 2020 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). Link to comment Share on other sites More sharing options...
Yakuzashi Posted October 10, 2020 Share Posted October 10, 2020 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! Link to comment Share on other sites More sharing options...
penguin0616 Posted October 11, 2020 Share Posted October 11, 2020 @Yakuzashi :SetExternalSpeedMultiplier does not exist in any version of Don't Starve, only DST. Link to comment Share on other sites More sharing options...
Yakuzashi Posted October 11, 2020 Share Posted October 11, 2020 @penguin0616 My bad. I haven't realized that's DS mod forum. Anyway, I think he has abandoned this topic so I won't waste time here. Cheers! Link to comment Share on other sites More sharing options...
Goregonzola Posted October 20, 2020 Author Share Posted October 20, 2020 @Yakuzashi Thanks for the tip, I'll try it out Modding fell out of my schedule in the past weeks. 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.