• Content count

  • Joined

  • Last visited

Community Reputation

32 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. Sanity from wetness help

    I'm not sure if I understand exactly what you're trying to do. But If you mean that you would like to apply this custom perk to work only on one of the already existing characters. then you could try using the AddPrefabPostInit Here's how to do it: 1st place this line somewhere at the very top of your modmain.lua GetSeasonManager = GLOBAL.GetSeasonManager then place this somewhere below it. AddPrefabPostInit("CharacterHere", function(inst) if GetPlayer().prefab == "CharacterHere" then inst:AddTag("notactiverain") local function CheckForRain(inst) if GetSeasonManager() then if not GetSeasonManager():IsRaining() and inst:HasTag("activerain") then, 0) inst:AddTag("notactiverain") inst:RemoveTag("activerain") end if GetSeasonManager():IsRaining() and inst:HasTag("notactiverain") then, 1) inst:AddTag("activerain") inst:RemoveTag("notactiverain") end end end inst:DoPeriodicTask( 0.0, function(inst) CheckForRain(inst) end) if inst.components.moisture then local m = inst.components.moisture if m:GetMoisture() then TUNING.MOISTURE_SANITY_PENALTY_MAX = 1 end end end end) This should also work and make your custom perk activate on the character of your choice.
  11. Sanity from wetness help

    Ah, no. I didn't mean that you need to have the other sanity drains turned off. I just meant it as a simple reminder that they can affect a custom sanity perk, so people wouldn't be surprised when their sanity perk would suddenly be more/less effective once one of the already existing sanity functions would also get activated. (You can freely have your custom sanity perk working along with the other already existing sanity functions in the game if you wish) And if you still want to completely turn off the moisture sanity drain, then here is the code for it: (it goes in your character's prefab file in the local fn = function(inst) ) inst:DoTaskInTime( 0.1, function(inst) if inst.components.moisture then local m = inst.components.moisture if m:GetMoisture() then TUNING.MOISTURE_SANITY_PENALTY_MAX = 0 end end end) And yes... It seem that I forgot to add this to my tutorial. XD Hehe, Thanks for pointing that out. I'll add that on in
  12. Sanity from wetness help

    You can achieve that with 2 different methods. You can make it so your character's perk will react once reaching a set moisture lvl or you can make it increase/decrease along with moisture. I made a tutorial in which I explain how to do that. Here it is. So if that's what you're looking for then you could give it a try, and if you'll need more help you can let me know (and I'll try to help you once I'll be available again). I hope that helps. Good luck!
  13. 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.
  14. how can i modify firestaff?

    Yes, the AddPrefabPostInit is basically a common way to change how some prefabs work in the game. You just use the base: AddPrefabPostInit("PrefabHere", function(inst) if GetPlayer().prefab == "YourCharacterHere" then [Your changes here] end end) The "if GetPlayer().prefab == "YourCharacterHere"" is used there to make sure that the modifications you make will work only with your character. So If you're trying to make a mod that modifies something for everyone no matter what character they pick, then you can just use this base instead: AddPrefabPostInit("PrefabHere", function(inst) [Your changes here] end)
  15. 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