Jump to content

Prefab death upon losing it's player link? (RESOLVED)

Recommended Posts

My edit of Abigail loses it's allegiance when I go into a cave. It stays above ground and when i come back up I can treat it like any other creature and it won't follow me at this point. Does anyone have a way to get it to die if it loses its alliance, so it drops as a flower again? Or alternatively to reestablish it's alliance when that player comes back up, but that may be too complicated.

Edited by Burae
Link to comment
Share on other sites

It depends which state Abigail is in when you come back. With the way the game works, she was probably just saved as any other entity and loaded like any other entity. So I guess what you need, is for Abigail to remember who her master is (save player ID in OnSave), and when she is loaded in, her data then contains the ID of the player, so you in her OnLoad function can start a periodic task where she attempts to reestablish her alliance with any players in her vicinity, checking them for whether they have the right ID.

Let me know if that goes way over your head. I think I can write it up pretty fast.

Edited by Ultroman
Link to comment
Share on other sites

Hi! I don't need assistance anymore, since I was just doing a direct edit of the standard character files the code was always there to make this work.

The problem was that I didn't change ALL of my references away from "Abigail" to my edit, looking at the "OnSave" like you mentioned caused me to notice I missed a few and i changed them and now the ghost stays allied, and even actually comes into the cave with me now. Problem solved!

Link to comment
Share on other sites

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