I'm having a weird problem with signs I spawn in with code: When running a command, I spawn a sign above the button I'm looking at:
After spawning it in, I use the mod Sign Artist to load a picture from the internet on it:
This all works perfectly fine. (Did require me to make the API functions in SignArtist private).
However when I leave the sign and go for example to the other side of the map and back to the sign, sometimes one or more signs appear blank.
When I press my button again (the button adds the image), it tells me the image was placed successfully, but the sign stays empty. But... only for me.
At the same time I see a blank sign, other players do see the image. It feels completely random and related to the client: It's not always the same sign appearing blank, it's never really empty as other people might see it while you don't.
- When leaving the sign and teleporting back, there is a big chance you see most of the signs without a problem.
- If you don't see an image and reconnect, the image is visible
I have the feeling I'm missing something I have to do with the sign after spawning it. Something that happens after teleporting or connecting/waking up, but not when you walk towards a sign. Maybe it has to do with the distance from your spawn point to the sign? There are a few cases the closest signs were all visible, but signs further away (walking towards them) were not. Do I have to make it active or something? Or give it a flag to load the image when a player is nearby? Just guessing now, I'm out of options.
FYI: It's not the 'duplicate image' problem, all images are unique. They are also not gone, just not visible for all.
Thanks!
var prefab = "assets/prefabs/deployable/signs/sign.pictureframe.landscape.prefab";
BaseEntity bSign = GameManager.server.CreateEntity(prefab, button.transform.position);
if (bSign == null) return;
bSign.SetParent(button);
bSign.transform.localPosition = new Vector3(0f, 1.5f, 0.05f);
bSign.Spawn();After spawning it in, I use the mod Sign Artist to load a picture from the internet on it:
SignArtist.Call("API_SkinSign", player, targetEntity, url, false);This all works perfectly fine. (Did require me to make the API functions in SignArtist private).
However when I leave the sign and go for example to the other side of the map and back to the sign, sometimes one or more signs appear blank.
When I press my button again (the button adds the image), it tells me the image was placed successfully, but the sign stays empty. But... only for me.
At the same time I see a blank sign, other players do see the image. It feels completely random and related to the client: It's not always the same sign appearing blank, it's never really empty as other people might see it while you don't.
- When leaving the sign and teleporting back, there is a big chance you see most of the signs without a problem.
- If you don't see an image and reconnect, the image is visible
I have the feeling I'm missing something I have to do with the sign after spawning it. Something that happens after teleporting or connecting/waking up, but not when you walk towards a sign. Maybe it has to do with the distance from your spawn point to the sign? There are a few cases the closest signs were all visible, but signs further away (walking towards them) were not. Do I have to make it active or something? Or give it a flag to load the image when a player is nearby? Just guessing now, I'm out of options.
FYI: It's not the 'duplicate image' problem, all images are unique. They are also not gone, just not visible for all.
Thanks!