Petleash public LinkPet


Recommended Posts

Could we get the private/local function LinkPet, in the petleash component, changed to be a public member? This would be very useful for adding pets spawned through other means to the petleash component, to be tracked, saved, loaded, etc. I could make a local renamed version of petleash in the mod I am working on, but it would be cool if I didn't have to, and I am not sure why this function is private anyways. Thanks!

(To preemptively answer 'why not just spawn them with petleash', sometimes this is not feasible in the specific circumstance due to the need to use other preexisting game functions/components to spawn the creature, which cannot be modified without also creating local copies of those functions/components. Changing this one small thing in petleash would be much simpler/cleaner than rewriting or changing those other functions.)

Link to comment
Share on other sites

So it didn't occur to me that, though the function itself is private, everything it is doing relies on public stuff. I added an exact duplicate of the function, but public, using AddComponentPostInit, and it worked fine. >.> That said, it would still be somewhat cleaner to just have access to the existing one; as everything it does IS public stuff, it seems odd for the function itself to be private.

(Sorry if public/private aren't the right terms for LUA. Local/Global?)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.