Sign in to follow this  
Astadyl

Companion Mod issues

Recommended Posts

Astadyl    0

Hi everyone,

I'm currently working on a character mod where the main feature is to be able to summon a companion 
The main issue I have left is that the following:

the companion follow the player when summoned, but if you leave the server and then join it again, the companion doesn't follow the player anymore and simply wanders.

I mostly used the code of abigail and it is possible I missed some major coding elements as I'm new to modding.

here is the file in case anyone can help me out with this

bill_cipher.lua

Share this post


Link to post
Share on other sites
Andmann    18

I would suggest removing the follower on leave and resummoning it when you rejoin the server.

The resummon could be done through a "AddPlayerPostInit (function(inst) ... end)"   call in your modmain

 

Share this post


Link to post
Share on other sites
Serpens    570

you could also take a look at the mod "Personal Chester" in the workshop.
The personal chester is also leaving and resummoining together with the player.

Share this post


Link to post
Share on other sites
Astadyl    0

Oh I see the idea you're going for.
I tried to insert such feature using another mod (kyle the symbiont) but it still doesn't works
here are the files again, bill_cipher is the follower, woom is the character and there's the modmain as well 

Thanks for helping me on this

modmain.lua

woom.lua

bill_cipher.lua

Share this post


Link to post
Share on other sites
Andmann    18

I am not 100% sure what the problem is... I would need to write debug lines but for that I need the full mod.

For now some extra information would be helpful:

- do you know if bill is desummoned or not when you leave the server? this is very important

it looks like he should be, he is even stored away in the data.

 

Share this post


Link to post
Share on other sites
Astadyl    0

Ok so I tested the mod with other players and the companion isn't apparently the only issue.
As the host I can see and interact with the item called "The Statue" and with Bill but other player joining with the mod enable can not see or interact with those two elements apparently. They can build the statue but it is invisble to them.

I still don't know if bill is desummoned but I don't think so as when i join again bill is not linked to me and I can attack him like anyother creature
 here is the current version of the mod I'm working with (don't pay attention to all the visual aspects, I will work on the artwork once I'm done with the code)

TEST 7.zip

Share this post


Link to post
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
Sign in to follow this