PDA

View Full Version : Buttons not showing and/or showing at the wrong position for clients



Sancho
03-14-2017, 12:36 AM
I've been receiving multiple reports of buttons not showing up correctly in my mod from players. You can view the comments here:

http://steamcommunity.com/sharedfiles/filedetails/?id=779900330

According to them, the problem is only visible by some clients, while the host never sees the issue. It's frequent enough that it happens at least once for multiple players every game, and it happens regardless of who is hosting.

I feel it's at least partially related to changing most of the buttons to spawn on scripting zones instead of objects, using the following code:



--creates a button at the given position, dimensions, scale, and rotation
function createArbitraryButton(params)
local objectParams = {}
objectParams.type = "ScriptingTrigger"
objectParams.position = params.position
objectParams.scale = params.scale
local zoneObj = spawnObject(objectParams)

buttonParams = {}
buttonParams.position = {0, 0, 0}
buttonParams.rotation = params.rotation
buttonParams.width = params.width
buttonParams.height = params.height
buttonParams.index = 1
buttonParams.label = params.label
buttonParams.font_size = params.font_size
buttonParams.click_function = params.click_function
zoneObj.createButton(buttonParams)
end


However, there was a mention of it happening when the button is created on an object as well. Just a note, the above code is needed to avoid stretching caused by scaled objects: http://www.berserk-games.com/forums/showthread.php?3055-BUG-buttons-created-around-a-scaled-object-are-also-scaled
I could undo the code, but the buttons will go back to being warped and stretched, and as I mentioned, it seems to happen even then.

Sancho
03-14-2017, 11:37 AM
Correction, I don't know of this issue occurring when creating buttons on objects. It only occurs using the code I put above.

my_hat_stinks
03-15-2017, 11:34 AM
A similar issue also occurs when buttons are removed from objects. The button may still exist on the client when it's been removed on the server. Alarmingly the button still functions for the client when it doesn't exist on the server, strongly suggesting there may also be a potential exploit there for hackers that wish to use it.


On a vaguely related note, buttons will also appear visible for all clients if they're created on an object inside a hidden zone. The buttons are no longer visible if the client has access the hidden zone which is then revoked, suggesting it's just caused by missing a check when the button is initially created and not an issue with the buttons themselves.

Crazy
03-16-2017, 04:25 AM
You should avoid adding buttons to zones as this is an issue with the mis calibration between host and client.

I found that when I added buttons to a zone, and deleted the button after, it would sometimes appear to some clients, as you said but not host.

I changed it and added the buttons to an object instead of a zone, and it seems to be working fine.

Eskander
03-18-2017, 02:22 AM
there may be some relation to the bug I ran into:
http://www.berserk-games.com/forums/showthread.php?3461-Bug-Buttons-display-on-wrong-object-for-guests-in-server

for me, i had completely unscripted objects seemingly take on the scripting buttons of a scripted object.

The part here that is relevant -- the host never sees it this way; the host always sees the buttons as they are intended, on the proper objects.

And inconsistently, a guest on the server would see the buttons missing/on a completely different object. It is very odd.

dzikakulka
04-02-2017, 01:19 PM
This issue persists all the way since buttons were introduced. It's some kind of desync between client and host regarding buttons, it was at its worst when object.clearButtons() stopped working altogether . Right now it's the usual - sometimes buttons are not deleted, sometimes they do appear on wrong stuff out of the blue. Always only for clients, sometimes different for different cleints and it's not 100% reproducible.