Jump to content

Recommended Posts

Ok, so i have this problem with my custom character, he changes art prefabs when you reach certain days but this bugs the ghost...

 

i used this code for the hair growth

inst:AddComponent("beard")inst.components.beard.onreset = function()        inst.AnimState:SetBuild("drok")end inst.components.beard.prize = "beardhair"local beard_days = {1,2,3,4,5}local beard_bits = {3,5,8,10,14} inst.components.beard:AddCallback(beard_days[1], function()        inst.components.beard.bits = beard_bits[1]        inst.AnimState:SetBuild("drokquarter")end) inst.components.beard:AddCallback(beard_days[2], function()        inst.components.beard.bits = beard_bits[2]        inst.AnimState:SetBuild("drokhalf")end) inst.components.beard:AddCallback(beard_days[3], function()        inst.components.beard.bits = beard_bits[3]        inst.AnimState:SetBuild("drokfull")end) inst.components.beard:AddCallback(beard_days[4], function()        inst.components.beard.bits = beard_bits[4]        inst.AnimState:SetBuild("drokfullstubble")end) inst.components.beard:AddCallback(beard_days[5], function()        inst.components.beard.bits = beard_bits[5]        inst.AnimState:SetBuild("drokfullbeard")end)

I know that his bugs the ghost, but im not sure on how to fix it.

 

Any ideas on how to fix it?

That code looks identic to Wilson's beard.

Are you sure the problem is there?

Yes,

When i started creating Drok for DST i finnished the first build, and ghost. Both seemed to be working so i pushed the other builds and added the beard script. I think it has something to do with the fact that he changes builds?

Thanks for your help.

Ah, yes, it's not identical, you are right: Wilson gets symbol overrides and these are build changes.

 

Well, if you think the problem is ghost related, then you can enclose things in:

if not inst:HasTag("playerghost") then     --function codeend

Like:

inst.components.beard.onreset = function()     if not inst:HasTag("playerghost") then          inst.AnimState:SetBuild("drok")     endendinst.components.beard:AddCallback(beard_days[1], function()     if not inst:HasTag("playerghost") then             inst.components.beard.bits = beard_bits[1]          inst.AnimState:SetBuild("drokquarter")     endend)

 

Ah, yes, it's not identical, you are right: Wilson gets symbol overrides and these are build changes.

 

Well, if you think the problem is ghost related, then you can enclose things in:

if not inst:HasTag("playerghost") then     --function codeend

Like:

inst.components.beard.onreset = function()     if not inst:HasTag("playerghost") then          inst.AnimState:SetBuild("drok")     endendinst.components.beard:AddCallback(beard_days[1], function()     if not inst:HasTag("playerghost") then             inst.components.beard.bits = beard_bits[1]          inst.AnimState:SetBuild("drokquarter")     endend)

 

hmm still doesn't seem to be working... any ideas?

 

EDIT: It's a good idea to enable the mod you are working on instead of an outdated version :p

 

Thanks for your help, it works :D

Edited by QuickShot010

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