Coffgirl Posted January 4, 2015 Share Posted January 4, 2015 (edited) *Closed Topic* Thank you for Ryuushu I tried to figure it out every way I know now but I have no clue. ;_;I use "extended sample character-DST1.1.1" ghost template to make mine.I try to fix like copy and replace anim.bin and build.bin from esctemplate to my mod and rename build.bin.everything is fine, no crash but the ghost is invisible in game. please help me!! This is all files of my modhttps://drive.google.com/file/d/0B58QJDwa4vq3S1ZZTVU2dkp3cU0/view?usp=sharingThank you ;A;*Closed Topic* Thank you for Ryuushu Edited January 5, 2015 by Coffgirl Link to comment Share on other sites More sharing options...
Ryuushu Posted January 4, 2015 Share Posted January 4, 2015 (edited) @Coffgirl inst:DoPeriodicTask(1/10, function() if inst.components.hunger.current > 100 then inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.5) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.5) inst.AnimState:SetBuild("coffgirl") elseif inst.components.hunger.current > 30 then inst.components.locomotor.walkspeed = 4.5 inst.components.locomotor.runspeed = 5.5 inst.AnimState:SetBuild("coffgirl_hungry") else inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 4 inst.components.eater.ignoresspoilage = true inst.components.eater.strongstomach = true inst.AnimState:SetBuild("coffgirl_starving") endend) ^^^That part. You're running that function every .1 seconds, all the time, even when you're a ghost. So, when you are a ghost, it'll check for your hunger (ghosts don't update it) and say something like "Well, her hunger is 102. Let's make her faster and set her anim build to coffgirl"... which is pretty bad for the ghost since that build lacks all ghost anims, thus making her invisible. You should first check if the player is a ghost, and if it is, immediately return. Also, you could change DoPeriodicTask for ListenForEvent("hungerdelta", -function goes here-). I think it's a bit more efficient, since the function will only run when the character hunger changes. .. So! You'd end up with something like this:inst:ListenForEvent("hungerdelta", function(inst) if inst:HasTag("playerghost") then return end -- If the player is a ghost then exit. if inst.components.hunger.current > 100 then inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.5) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.5) inst.AnimState:SetBuild("coffgirl") elseif inst.components.hunger.current > 30 then inst.components.locomotor.walkspeed = 4.5 inst.components.locomotor.runspeed = 5.5 inst.AnimState:SetBuild("coffgirl_hungry") else inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 4 inst.components.eater.ignoresspoilage = true inst.components.eater.strongstomach = true inst.AnimState:SetBuild("coffgirl_starving") endend) Edited January 4, 2015 by Ryuushu Link to comment Share on other sites More sharing options...
rezecib Posted January 5, 2015 Share Posted January 5, 2015 That periodic task o_o I remember actually having a similar issue when I was porting Wolfgang. His mightiness would mess up his ghost build. Link to comment Share on other sites More sharing options...
Coffgirl Posted January 5, 2015 Author Share Posted January 5, 2015 @Ryuushu Ohh, so that's the problem. Thank you very much! Now the ghost is working fine. Thank you. >< Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now