f1amekeeper Posted June 29, 2017 Share Posted June 29, 2017 (edited) I am currently working on a character and had a few perks that I have no clue how to impliment. When standing on webbing from spider nests I want to give them night vision and regenerate health along with sanity. (working) I also want to make them give off the minimum amount of light possible to still prevent charlie from attacking (Working) and lastly I want to make them generate 1 silk per day I dont want it to be a beard or anything just to give them the item at the start of each day (working) sorry still new to dont starve modding so I would appreciate any help that anyone could provide Edited July 1, 2017 by f1amekeeper update progress Link to comment Share on other sites More sharing options...
. . . Posted June 29, 2017 Share Posted June 29, 2017 (edited) For the very little light that's enough to keep the grue away you could put this in YOURCHARACTER.lua inside the master_postinit Spoiler inst.entity:AddLight() inst.Light:Enable(false) inst.Light:SetRadius(.85) inst.Light:SetFalloff(0.5) inst.Light:SetIntensity(.1) inst.Light:SetColour(255 / 255, 255 / 255, 236 / 255) And when you want to enable/disable it you put in your event, or if the light's always enabled just put it in your master_postinit inst.Light:Enable(true) -- replace true with false if you want to disable it at some time For the silk thing I think you can do something simple like this in master_postinit Spoiler inst:DoPeriodicTask(480, function() -- 480 = 1 DS day if inst.components.health:IsDead() then return end local silk = SpawnPrefab("silk") inst.components.inventory:GiveItem(silk) end) For the standing on spider web thing I don't really know how to do since I'm not very good at coding, sorry ... Edited June 29, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
f1amekeeper Posted June 30, 2017 Author Share Posted June 30, 2017 (edited) The light and silk works perfectly thanks All that leaves is figuring out what event I would need to listen for so I can know when the player has walked onto the groundcreep from the spider nests Edited July 1, 2017 by f1amekeeper avoiding creating new reply Link to comment Share on other sites More sharing options...
RedHairedHero Posted July 6, 2017 Share Posted July 6, 2017 I would look at either Wilson's stategraph file or the spidereggs. I'm sure one of them has a listener event that slows the character down when they step onto it. Once you have the listener you can simply use it to trigger whatever effect you'd like. 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