Jump to content

Character Mod Help, Animal Friends/Followers


Recommended Posts

Hello!

I am new to the forums and to modding, but not to the game. I am developing a character mod and would love some help and guidance. I will give a little bit of information on what I am looking for in my character idea, what resources I am currently using, and what I could use help in. On top of that, please offer ANY AND ALL help you have to offer, as I am new to this and as they say, you don't know what you don't know!

Wren is a peaceful, innocent young girl who loves nature and is appalled by anything destructive. She is attuned to animals and they can sense this. She doesn't scare them away and they can become befriended by her and follow her. This includes pig men, rabbit men (and rabbits), tall birds, etc. Does not include monsters, such as spiders, giants, bats, etc. She cannot bear the thought of killing another living thing, however, even monsters, and she suffers terrible mental and medical breakdowns if she does. She also cannot eat meat, for obvious reasons. She cannot wear clothes where animals were harmed, such as earmuffs, eyebrella, etc. There are some other slight add ons along this train of thought.

Because of her naturally innocent look on the world, she loses sanity at half the normal rate, She also becomes overjoyed if she has at least 3 followers, and gains a slight ? (sanity, speed, ?) gain from this. (open to thoughts on this, looking for balance... is this too much? Is there a way to balance, such as having a very short time that pets stay with therefore needing constant feeding, or high cost, or... just get rid of? I don't like OP characters, I think the original characters for the most part are the type of balance I'm looking for)

 

The resources I'm using are:

Extended Sample Character  

Character Mod Satori (ideas for befriending animals, not using their buffs though, don't want that)

 

Of course, using things like Notepad++ and whatnot to code.

 

Need help with figuring out the abilities I talked about, specifically with the animals. Having a hard time figuring out the coding from Satori. Also, again, would love ideas on not only the balance perspective but the coding ideas for the slight buffs for animal friends.

 

If you have any questions, please let me know! I am new so hopefully I provided enough to get some help. Thanks so much everyone!

Edited by verdago7
Link to comment
Share on other sites

For example, I am looking at the coding for the Beefalo from Satori and from the description the Beefalo should assist in combat. I want to remove that function, but still allow the other functions of letting it follow when you befriend it. So looking at this portion of code...

function BeefaloBrain:OnStart()

    if GetPlayer().prefab ~= "sat" then
     local root = PriorityNode(    
        {
            WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)),
            IfNode( function() return self.inst.components.combat.target ~= nil end, "hastarget", AttackWall(self.inst)),
            ChaseAndAttack(self.inst, MAX_CHASE_TIME),

            Follow(self.inst, function() return self.inst.components.follower and self.inst.components.follower.leader end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST, false),
            FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn),
            Wander(self.inst, function() return self.inst.components.knownlocations:GetLocation("herd") end, GetWanderDistFn)
        }, .25)    
        self.bt = BT(self.inst, root)
    else
        -- Behaviour with Satori ** TALK SENTENCES ARE IN PREFAB <-> MATING SEASON 
        local root = PriorityNode(
        {
            WhileNode( function() return self.inst.components.health.takingfiredamage end, "OnFire", Panic(self.inst)),
            IfNode( function() return self.inst.components.combat.target ~= nil end, "hastarget", AttackWall(self.inst)),
            ChattyNode(self.inst,self.inst.talk_attack,

                ChaseAndAttack(self.inst, MAX_CHASE_TIME)),
            Follow(self.inst, function() return self.inst.components.follower and self.inst.components.follower.leader end, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST, false),
            ChattyNode(self.inst,self.inst.talk_face ,
                FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn)),
            ChattyNode(self.inst,self.inst.talk_wander,    
                Wander(self.inst, function() return self.inst.components.knownlocations:GetLocation("herd") end, GetWanderDistFn))
        }, .25)
        
        self.bt = BT(self.inst, root)
    end

Would I just remove the underlined portion? 

Link to comment
Share on other sites

image.thumb.png.524d972734057f8f1c88bb1867965495.pngI am working on getting the "can't hurt any creatures" code implemented and I'm thinking there MUST be an easier way... because I want this sanity/health penalty to apply to ALL creatures and monsters, even giants... she can't kill ANYTHING. She HAS to rely on an ally, or go total pacifist. Is there an easier way than adding in every single creature? Am I doing this part correctly?

Link to comment
Share on other sites

Just had a thought.. maybe I could use that coding for things like rabbits and birds, since those could be murdered in inventory, and then use an inverse ruling of wigrids ability of gaining health upon kills? I'll try to find the code and see what I can make of it... hopefully some people who can help will chime in soon, I could use some help! 

Link to comment
Share on other sites

image.thumb.png.40f7efb5373d0488d7cb0abb92c8f414.pngSo I see here that when a valid target is killed, it triggers the command that would engage wigfrid's health and sanity ability. I have also found the component file that is used for both the health and sanity functions. However, since I want to change this ability from a percentage gain to a solid stationary loss of -15 each, I need to change some of that. So two things... what component should I use, and... I can't seem to see where it is linking to that component? Maybe I'm missing something...

Link to comment
Share on other sites

In the meantime I've been working on the taming code and I've run into a bit of a bump with that as well... I'm going to load my current main and if anyone has any insight please share your thoughts, I'm starting to run out of ideas. I'll keep scouring the web, but would love some feedback. 

modmain.lua

Link to comment
Share on other sites

I'm separating out my topics to make this easier, so I'll just focus on the taming issue on this thread and I'll get another going for the sanity/fighting thing. Sooo I've spent hours digging into bunnyman and pigman coding, looking at prefabs, brains, stategraphs... and I think I made some progress on all of those, but I could use a second pair of eyes. So my current project is to simplify the project to make sure I know what issues are happening to address one at a time, so currently I am ONLY focused on trying to tame rabbits. I have written brains, prefabs, etc for rabbits to be pets, going off of bunnyman and cross referencing both the pigman and rabbit coding to make sure I wasn't messing up. What I'm not confident on is the coding to allow the rabbit to be fed... I'm having trouble figuring out what parts go in my modmain, which go in the brain, and which go in the stategraphs. I tried putting it all in all 3, and that definitely did not work. I am loading the entire file (which is only the bare bones of the character unmodded, plus the rabbit pet coding in the pet folder and the mainmod edited) and the error log that I got. I know there are some really excellent modders out there, just waiting on some help!

Wren.zip

client_log.txt

Link to comment
Share on other sites

PROGRESS!!! I've gotten past all the bugs in loading the brain and stategraphs and prefabs and have made rabbits not scared and given them the ability to be traded with (for carrots or cooked carrots) and I think correctly used the loyalty tuning for them to follow. My problem right now is that the game crashes AFTER giving a rabbit a carrot, namely due to the follower component. I tried adding the AddCompoment for follower, but this also created a problem. I'm getting close! I know I haven't really gotten any help or replies, but I'll keep trying...

 

image.png.6047f936b3fdca25fb8275eb66f300bd.png

rabbit.lua

rabbitbrain.lua

Link to comment
Share on other sites

I've managed to resolve the crashes and can now load the game and give carrots to rabbits with them accepting the carrot. Progress!!!

I believe I have the correct follower commands in the coding, however the rabbit will not follow upon receiving the carrot. I don't know if I have too many lines of code in causing a hole where the rabbit can accept the carrot but skip the follower action, or if I am missing something. It could also very well be something I am missing in the rabbitbrain.lua that I am missing. Still, progress is being made, just taking awhile on my own. If anyone wants to peak at the code and take a shot at it I'd greatly appreciate it.

rabbitbrain.lua

rabbit.lua

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...