Wanted postersSuggestion

I was thinking it would be a fun nod to supporters of my server to place some of the new "wanted" posters around Bandit Camp with their names/faces. Would it be possible to get support for remembering who is assigned to each poster, so that Monument Addons can persist these across restarts/wipes?

Here are the prefab names:

  • assets/prefabs/misc/decor_dlc/wantedposter/skins/wantedposter.wantedposter2.prefab
  • assets/prefabs/misc/decor_dlc/wantedposter/skins/wantedposter.wantedposter3.prefab
  • assets/prefabs/misc/decor_dlc/wantedposter/skins/wantedposter.wantedposter4.prefab
  • assets/prefabs/misc/decor_dlc/wantedposter/wantedposter.deployed.prefab

I'll consider this for a future update.

Started poking at this a bit as an exercise in learning how to write plugins, and it's definitely way over my head still:

The `WantedPoster` class seems pretty simple: An image CRC for the player picture, a player SteamID, and a player name.

...but dealing with images seems complicated. It looks like maybe the server depends on clients to send player images via RPC, so there's probably no way for Monument Addons to synthesize that.

As a compromise, I considered downloading Steam avatars. This is possible via Facepunch's Steamworks library, which appears to be shipped with the server: https://wiki.facepunch.com/steamworks/GetClientAvatarUnity

...but it looks like you have to do the download in the background somehow. Way over my head, but probably possible for an experienced plugin developer. In fact, I saw a paid admin menu plugin on codefling that shows Steam avatars in-game.

Merged post

Took a different approach:

WantedPoster implements ISignage, so with minimal changes to SignArtist and MonumentAddons I am able to load custom image URLs into wanted posters.

In order to control the text displayed on wanted posters, I added support to MonumentAddons' skull name features for the case of a WantedPoster. This almost works - the name gets written to JSON and applied on next profile (re)load - but I can't immediately figure out how to also make the change apply immediately in-game without a profile reload.

How about we let the admin set the information first via the vanilla UI, then the admin runs masave to record the image content into the profile data file, then the admin runs maflag Busy to prevent further edits. There's code in Backpacks for saving the contents of photos and signs (e.g., for signs that were picked with an image on them).

I thought along these lines, but didn't get around to trying it. One issue is that the image content is likely to be well over 1MB worth of binary data (more if you text encode it) due to Facepunch deciding on 1024x1024 image size.

I'm wondering if it would make more sense to save the data to a binary file named after the SteamID/playerID of the subject of the wanted poster, and then store that filename and the player name in the MA profile?