Jump to content

Recommended Posts

Well I tried to decipher that. But I couldn't. I tried copying Chester's brain file to my creature, renamed chester's brain to my creature's, and now I get the error, "Attempt to index field 'Health' (a nil value)"

I made a Tiny Box Tim for my Markiplier mod and had many bugs with him not following me if I left to the caves or died and revived at a touchstone or something... so if you have similar bugs insert this into your creature's prefab file not brain

 

inst:AddComponent("follower")
inst:DoPeriodicTask(1/10, function()
local player = GetPlayer()
if player and player.components.leader then
player.components.leader:AddFollower(inst)
end
end)
 
then further-more write this into your character's prefab name
(inside the fn function)
 
inst:AddComponent("leader")
 
unless you are making this creature for all characters then you will want to look into postinits...

Now after MUCH toying and detective work in the data files, I got my creature to successfully follow me. Now I want it to fight for me. How would I do that?

Did you give the creature the combat component?

 

And put: 

        ChaseAndAttack(self.inst, 5),

in the brain's OnStart() function?

 

then further-more write this into your character's prefab name
(inside the fn function)
 
inst:AddComponent("leader")
 
unless you are making this creature for all characters then you will want to look into postinits...

 

Nope, all the characters already have the leader component. Don't need to add that anywhere on the character.

Edited by Mr. Tiddles

Did you give the creature the combat component?

 

And put: 

        ChaseAndAttack(self.inst, 5),

in the brain's OnStart() function?

I'm actually using your William mod to decipher which parts control combat, it's a bloody fantastic mod, and I'll try adding those lines.

I'm actually using your William mod to decipher which parts control combat, it's a bloody fantastic mod, and I'll try adding those lines.

I've made and am making better.

 

The robots are just a modified Shadow Puppet (minions summoned by playable Maxwell) to have different functions. Looking through their coding would probably help alot.

I've made and am making better.

 

The robots are just a modified Shadow Puppet (minions summoned by playable Maxwell) to have different functions. Looking through their coding would probably help alot.

It seems to work, but it does no damage, I assume I have to set the damage through. Also could I add you on steam if I have other coding questions, and also you seem like a pretty cool guy.

It seems to work, but it does no damage, I assume I have to set the damage through. Also could I add you on steam if I have other coding questions, and also you seem like a pretty cool guy.

If you can handle my unstable brain, sure.

 

And yeah, pretty sure you need to set damage.

 

Also, make sure in the stategraph you have:

 

            inst.sg.statemem.target = inst.components.combat.target
            inst.components.combat:StartAttack()

 

    and

 

inst.components.combat:DoAttack(inst.sg.statemem.target)

Edited by Mr. Tiddles

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
×
  • Create New...