Jump to content

Recommended Posts

Info: DA keeps Sun/daycare form as default. They change into their Were/Moon/Nightcare form when:
a) in complete darkness, b) below 50 sanity, c) during fullmoon

SpawnPrefab keeps spamming every second, spawning "shadow_shield1" every time DA changes into their shadow/were/moon form when they enter complete darkness/their sanity falls below set threshold.
However it doesn't happen when they change because of fullmoon (it still appears if during fullmoon their sanity will become low).

Could use help here, I'm so close to finishing this mod and I just want it to be done.

attendant.lua

I believe your problem is that ShadowFormController is getting called A LOT from the hungerdelta event listener, since that event is pushed whenever the character's hunger updates. You should add a check to both of your ShadowFormController if statements to make sure you haven't already ran that code.

You can add, remove, and check for tags using.

inst:AddTag("sunform") -- doesn't have to be sunform, any alphanumeric string afaik
inst:RemoveTag("sunform")
inst:HasTag("sunform") -- This one is treated more like a variable than a function you can run by itself, use it in if statements

 

4 hours ago, TheSkylarr said:

I believe your problem is that ShadowFormController is getting called A LOT from the hungerdelta event listener, since that event is pushed whenever the character's hunger updates. You should add a check to both of your ShadowFormController if statements to make sure you haven't already ran that code.

You can add, remove, and check for tags using.


inst:AddTag("sunform") -- doesn't have to be sunform, any alphanumeric string afaik
inst:RemoveTag("sunform")
inst:HasTag("sunform") -- This one is treated more like a variable than a function you can run by itself, use it in if statements

 

This might be what I need, but I can't find where I need to place em, either they don't work or they throw away TheWorld.state.isnight part completely, could you help? This mod is slowly growing out of my bare coding knowledge

8 hours ago, Enderia said:

This might be what I need, but I can't find where I need to place em, either they don't work or they throw away TheWorld.state.isnight part completely, could you help? This mod is slowly growing out of my bare coding knowledge

You're probably running in to some operator precedence mishap, take a look at this lua article, that should help.

Edited by TheSkylarr
16 hours ago, TheSkylarr said:

You're probably running in to some operator precedence mishap, take a look at this lua article, that should help.

Yep this ended up being too complicated for me--

Since the SpawnPrefab worked like it should before cramping fullmoon part into the main function I ended up separating sanity/light based transformation from fullmoon one and it came out working fine.

Now the problem was that both transformation overlayed.
It's not a big deal normally, only noticeable during fullmoon night - Fullmoon Transformation has no nightvision, but when sanity falls under the threshold nightvision activates, meaning Light/Sanity based transformation takes effect. So after sanity is restored Sunform from Light/Sanity activates, even though Fullmoon Nightform should be out.

I tried to block Light/Sanity from activating during whole fullmoon and it worked as far as I know, but in the morning after the event, Fullmoon Nightform continues existing, instead of switching to Light/Sanity Dayform (it fixes when you lower your sanity and get it back above threshold).

It became a one big mess, I won't lie, but im almost there. Help with this one, please?

attendant.lua

Also one thing still bothering me is that Moon loads before Sun. Usually it corrects second after spawning, so it doesn't bother me much, but things like portrait, icons etc use Moon instead of Sun. If someone can help I will own ya big one 

20220215111302_1.jpg

Daycare Attendant.rar

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