BraveChicken

  • Content count

    68
  • Joined

  • Last visited

Community Reputation

33 Excellent

1 Follower

About BraveChicken

  • Rank
    Junior Member
  1. Prevent birds from flying away

    I am not really "Breaking it for anyone". It would just make my mod incompatible with some other ones and not break the ones which already exist. If someone sees that a mod is incompatible with the other ones, then they turn it off and everything works as before. You don't need to humiliate people for an attempt to help someone. You can just provide them with a solution which you consider better instead. Anyways, nevermind it. I guess if you're that bothered I'll just erase it. Have a good day. I'm ending my conversation here.
  2. Prevent birds from flying away

    Maybe, but that's for the mod's creator to decide if he or she wants to take that risk. I personally never encountered any issues with this. However, if you know a working way to do that from modmain.lua then I would gladly learn that too. (As I usually find issues with the AddBrainPostInit)
  3. Yes it does work now! XD Thank you. and sorry... XD All of those files are just a way I tend to learn and test things XD (I don't really belong to people which tend to ask for help, so I usually try to figure things out on my own. That's also why I have a whole separate mod which I use only to test things out) I wanted to create a brain for one of my custom creatures which I made for one of my characters, and to try and learn how some things work, I usually copy the files and try to play around there to see what does what XD And (back then) while still having 0 knowledge of how to script for this game, I somehow managed to create a custom brain for my creature. (Made me really happy to see it work. XD) So yea, don't mind all of those messy files there XD
  4. Still can't eat anything XD lol I'm so sorry! XD I'll just take it as I'm obviously missing something, and your code is probably perfectly fine. XD And I'll just stop bothering you. XD Thank you anyways!
  5. The whole file? XD or the whole mod? (I usually use a testing files for that, so I have a lot of script in there. I can still send it to you in a privet message if you wish.) (I really feel kinda bad for spamming this post XD) As for the script, it's same as you placed it. (Even though I think there was a typo so I tried it as "ipairs" and "pairs" just to be sure. XD
  6. Hmm... this still doesn't want to work for me. o.o This time the games works fine, but this blocks my character from eating anything at all for some reason, and not only the selected foods. (I would play around with it myself but I haven't really used this type of method too much before to know exactly how it works)
  7. That's an interesting approach. I haven't tried such method before. o: I'll keep that one in mind However, when I tried testing it, it crashed my game. (Saying: 'then' expected near 'in')
  8. Ah! I see. I looked up into it and here's how to simply tweak it a little bit: AddPrefabPostInit("pigman", function(inst) inst.components.eater.ablefoods = { "HORRIBLE", "MEAT", "VEGGIE", "INSECT", "SEEDS", "GENERIC" } inst.components.eater.foodprefs = { "HORRIBLE", "MEAT", "VEGGIE", "INSECT", "SEEDS", "GENERIC" } local function OnEat(inst, food) if food.components.edible and (food.components.edible.foodtype == "MEAT" or food.components.edible.foodtype == "HORRIBLE") and inst.components.werebeast and not inst.components.werebeast:IsInWereState() then if food.components.edible:GetHealth() < 0 then inst.components.werebeast:TriggerDelta(1) end end if food.components.edible and food.components.edible.foodtype == "VEGGIE" then local poo = SpawnPrefab("poop") poo.Transform:SetPosition(inst.Transform:GetWorldPosition()) end end inst.components.eater:SetOnEatFn(OnEat) end) And of course, you don't need to add the custom food type to every single creature in the game, as only few of them can actually eat meat. (So it would be more just like pigmen, spiders, hounds, and such ) I hope that helps. Let me know if you'll have any more issues with this.
  9. I would suggest creating a custom food group and then throwing the edible food items of your choice in there. After that you would need to add that custom food group to all creatures (like pigmen) which you would want to still be able to eat them. I have created a tutorial in which I explain how to do that. (You would just need to skip the part where you would normally add the custom food group to your character, and it should work. ) Here's the tutorial.
  10. Everything is literally explained in the tutorial o.o All lines go either in the modmain.lua or in your character's prefab file in the "local fn = function(inst)" Every section tells you exactly where to place the Base code which you are given. If you feel confused about one of the sections then let me know which one it is so I could give you more directions/help.
  11. The problem is that you putted the same sanity function 3 times in a row. And all of them work with the same tags, which makes the game flicker between all of them all the time. But reading your script I can see what you were trying to do. So here's how to fix that: inst:AddTag("notactive") local function CheckTime(inst) if GetClock() and GetWorld() then if GetClock():IsDay() and (inst:HasTag("notactive") or inst:HasTag("activedusk") or inst:HasTag("activenight")) and not GetWorld():IsCave() then inst.components.sanity.dapperness = 0.3 inst:AddTag("activeday") inst:RemoveTag("notactive") inst:RemoveTag("activedusk") inst:RemoveTag("activenight") end if GetClock():IsDusk() and (inst:HasTag("notactive") or inst:HasTag("activeday") or inst:HasTag("activenight")) and not GetWorld():IsCave() then inst.components.sanity.dapperness = -0.15 inst:AddTag("activedusk") inst:RemoveTag("notactive") inst:RemoveTag("activeday") inst:RemoveTag("activenight") end if GetClock():IsNight() and (inst:HasTag("notactive") or inst:HasTag("activedusk") or inst:HasTag("activeday")) and not GetWorld():IsCave() then inst.components.sanity.dapperness = -0.4 inst:AddTag("activenight") inst:RemoveTag("notactive") inst:RemoveTag("activedusk") inst:RemoveTag("activeday") end end end inst:DoPeriodicTask( 0.0, function(inst) CheckTime(inst) end) Try using this instead. I simply combined everything into 1. I marked you the Day, Dusk, and Night parts along with your custom sanity perk so you could easily change it if you'd like
  12. I never played around with adding such to a button, so I won't be able to help you out too much with this right now, but I know a mod that did create and use different button commands. Puppy princess Musha You could look around in the files of this mod to see how the buttons there are scripted. (I would have checked it out myself but I do not have that much free time lately. Sorry about that) Edit: Nevermind! I couldn't resist checking it out! Here's what you'll need: Head to your character's prefab file and add in the local fn = function(inst) these lines: local light = inst.entity:AddLight() light:SetFalloff(0.2) light:SetIntensity(0.9) light:SetRadius(6.0) light:SetColour(001/255, 255/255, 050/255) light:Enable(false) inst:AddTag("nvoff") Then head to your modmain.lua and add in there this: GetPlayer = GLOBAL.GetPlayer GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_F, function() local light = GetPlayer().entity:AddLight() if GetPlayer():HasTag("nvon") then light:Enable(false) GetPlayer():AddTag("nvoff") GetPlayer():RemoveTag("nvon") print("Night vision is OFF.") elseif GetPlayer():HasTag("nvoff") then light:Enable(true) GetPlayer():AddTag("nvon") GetPlayer():RemoveTag("nvoff") print("Night vision is ON.") end end) You can of course change the colors of your night vision (The tutorial explains how to do that) and the button from "F" to another by just changing the "F" in the "GLOBAL.KEY_F" which I marked, to the one which you would like to use. This should be enough to make it work.
  13. Back to nature [DS] [RoG]

    Hmm, that's weird. I don't seem to have any problems running the game with my mod. But I do remember seeing some people complain about having some issues with the mods after the Don't Starve update, so I suppose maybe this could be the issue? (And if it is then I guess it should be fix soon by the developers) Also, You could try enabling only this mod and checking if it still would result in the same issue (if you tend to have more than 1 mod enabled) just to make sure that the problem isn't in the mod's compatibility with some other mods that you might have enabled along with this one. Other than that, I guess I could only recommend trying to re-download the mod or maybe trying getting it on Steam (If you can). I'm sorry, I can't really help more than that
  14. how to create about regen mod

    It's the "local fn = function(inst)" in your character's prefab file, in which your character's stats are. So if you'll place the line: inst.components.health:StartRegen(amount, period) below your character's stats, then that should work.
  15. If you are working on a DST mod, then yes, there are differences in coding between the "normal" DS and the DST. I would gladly help you if I could, but sadly I do not have DST to even be aware of the coding differences that would need to be made there. However, you may want to ask for help in the DST mods and tools forum section, as I'm sure you'll manage to find someone to help you there. I'm sorry that I can't be of more help.