Jump to content

Recommended Posts

Hello, I am back!

Anyways today I have a new interesting issue, now I'm trying to make a mod where a character when their sanity goes down, does not get naturally aggrod by shadow creatures unless they attack to aggro them(they will still spawn though). The true goal is to get this to work only with shadow monsters on the surface but not for the ruins/caves, but if it's too much trouble I don't mind just no natural aggro in general.
I actually found some code that works for this and got it to work(thread here), however said code only works when I bring my sanity down with the nightmare amulet/bone helm. If I naturally lower my sanity by normal means like standing around evil flowers then the shadow creatures attack me on site like normal.

Any suggestions or help on fixing this issue? will link my modmain.lua file too so you can see what we're working with here.

modmain.lua

Edited by silvesary

EDIT: oh my gosh I solved it, it was simple as actually fixing and adding the character tag LMFAO

I'll leave this up here for reference for anyone that needs it, but by adding
-- Tag for shadow creature aggro
    inst:AddTag("shadowfriend")
to the prefab file and then adding said tag to the code shown above(which is in modmain), it will actually work!

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