Author Topic: Set Default Paint Color  (Read 1692 times)

Is there a way for a server to set the default paint color? What I mean by "default paint color" is the color a player spawning on a server has selected. This is usually the first row and column of the server's colorset of choice. Is there a way to change which color (i.e. which row and column) is selected on spawning? I know I could simply make a special colorset to fulfill this purpose. But that feels a bit clunky.

you could probably package the player spawning and have it shift their paint selection over

you could probably package the player spawning and have it shift their paint selection over
Well... yeah. But is that possible and how would one do that (not the packaging part, but the shifting part)?

I decided to actually look at the trace (sorry; I'm lazy) and found that serverCmdUseSprayCan(%client, %colorId) causes the player to equip a spray can with the appropriate color (as per %colorId). However, when the player activates their paint selection menu (by pressing "E"), their paint color is the one they had selected before.

Then there's a client-sided function PlayGui::updatePaintActive() which seems to mark a line of communication between the client and the server. It seems to change GameConnection.colorId. I tried changing the aforementioned variable manually. But it did nothing.

It looks like there's no way of setting the client variable from the server side. You'll have to go for the different colorset method.

It looks like there's no way of setting the client variable from the server side. You'll have to go for the different colorset method.
I don't think that's going to work for my purpose. I'm working on an item which places bricks whose color corresponds to the player's selected paint color. I want to give hosts the option of picking a default color so that the server isn't filled with red bricks (or whatever colorId == 1 happens to be) because someone didn't bother to read the tool's instructions/controls. During development, I've already seen multiple people completely ignore the help command that I have provided, despite it being right in front of their face. So I am quite certain this will be a problem.

I wouldn't want the hosts only option to be to change the colorset. For one thing, that's not something everyone readily knows how to do. Secondly, it feels a bit intrusive and over-complicates what would should otherwise be a simple add-on installation. I'm thinking maybe I will just make it so bricks conform to the host's specified default color for the tool until the player actually equips their paint can. So after player executes serverCmdUseSprayCan(%client, %colorId), %client.currentColor will be used to determine the brick color.

Although, I suppose I could make a separate add-on which allows a host to switch the first color out with another color in the colorset. I can't see why this wouldn't be possible.

if you just want it for a tool to have a different default color, just have it set to something until the player changes it, so you don't mess with building and what the player expects to happen

overall I don't think changing the default color on spawn for anything would work well for the player (even your tool, if they expect it to be their paint can color), as it just wouldn't feel right

overall I don't think changing the default color on spawn for anything would work well for the player (even your tool, if they expect it to be their paint can color), as it just wouldn't feel right
I might just leave it as is and see if spamming red bricks becomes a problem.

spam will be spam red bricks or not

Blockland has ruined the color red for me forever.

Blockland has ruined the color red for me forever.
This.

spam will be spam red bricks or not
The thing is most people should know how to use this item to some extent already. I'm essentially just extending the functionality of a well-known item.

you could tell us what this item is, and then you may get better help

you could tell us what this item is, and then you may get better help
Sorry for being vague. I just felt it wasn't necessary to be specific. Although it seems the solution we are arriving at is going to be implementation specific.

In short, I'm trying to create a better trench tool. The item is (creatively) called the Better Trench Tool. It provides a ghost brick which shows the player where they are going to place/dig, and allows the player to adjust how much dirt they can place/dig in a single swing. Here's the GitHub repository. I'm hoping on releasing the first version within a couple of weeks. I pretty much have all the math sorted out. It just needs some polishing. If you want to try it out, it kind of works. A help command, /BTTHelp, is provided.

On that note, I probably won't add the default color thing in right away. I'll let the add-on do it's rounds and see if it's necessary to add it.

I might instead add a feature which allows a host to make it so placed dirt is the same color as the dirt it is placed on, or that dirt color is queued like it is with the standard tools. This will likely something that will be added in later versions.
« Last Edit: June 06, 2017, 12:30:57 AM by Platypi »

maybe you could force a brick to change color once planted until the player decides to changed paint color