Jump to content

Basic brain lua file


Recommended Posts

You don't add components to the brain. That brain controls which state the creature is in, and depending on the state, the creature uses different functions in its prefab file to do stuff.

What in particular are you interested in changing?

Link to comment
Share on other sites

Remove the most of beefalo traits (like in heat, grazing, getting different personalities,  ) and add that only my custom character (who has the summoning item) can command to attack mobs or to stay. They gives you sanity and warmth when near. Most of the field mobs like beefalos and hounds gets scared and doesn't attack first. Only one wolf can be summoned at a time

 

Link to comment
Share on other sites

I have to say, I don't think it's a good idea to make a character mod which makes that kind of changes to an entity in the game. It seems a bit extreme to force a world change just because one player on the server chooses a certain character. That said, you can do whatever you want :)

It actually looks like all the code you need to worry about is in beefalo.lua (prefab), beefaloherd.lua (prefab) and mood.lua (component). When a beefaulo entity "is in the mood" that means it is in heat. Go nuts.

Link to comment
Share on other sites

@UltromanI think he does not want to change beefalos. He is only using the beefalo as help/base to create the pet for his character mod.
It should be a ridable pet, and therefore he is using all beefalo files as base. And now asks how to remove all things (from his copy of beefalo files) that do not fit to his wolf pet.

But this is a quite big task, so I dont have the time to write the whole code for it, therefore no real help from me, unless you have smaller and specifc questions. Eg most of the things you mentioned are, like Ultroman wrote, not defined in the brain, but elsewhere. So simply dont give your pet the mood component and nothing related to beefaloherd will already help alot.

From the brain file itself, I would write it from scratch. But if you really want to use it as base, I think remeoving every block that contains "InState" and "herd" is a good start. But really, write it from scratch is much better.
The brain is responsible for the behaviour of your pet. So eg. when and how long/far away it will follow you. If it should Panic when on fire. if it should run away from enemies and such stuff.

@HEANIt is really much to do and this as your first modding project... Even I learned recently how stategraphs and brains work and do not understand everything and I do mod DST since few years.
So if I would try to code your mod, it would take roughly 100 hours of work. And I mostly know what to do (I cant wrtie stategraphs on my onw yet, but maybe this is not needed with the beefalo stategraphs)
This is just to show you the scope of your mod and why I cant "simply help" you. it would be a very big task to help you doing everything.

Edited by Serpens
Link to comment
Share on other sites

1 hour ago, HEAN said:

I'm beginning to regret what I started...:shock:

Maybe I should quit. Thank you for that Ultroman and Serpens.

you should try to understand how the coding and the game works step by step. Start with smaller mods.
Or read the code of simpler mobs already in the game and try to understand as much as you can. You can ask short questions here and we will be happy to explain. But we can not do that much at once. Also there might be several tutorials for some stuff although I dont know them, I also started from scratch by studying game files and asking many many questions here :D

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...