helekiller said:
that will cause problems in multiplayer ^^ if 2 people select it at the same time, evrything is fucked, the player who first selected it could use up the gold from the second one. would need to clear selection for the first one if u do that.. and that wont look too good either :s
maybe try to give the building to a player with fullshared unit control to evryone, when it starts training a unit, check whether the triggering player has enough gold, if not then cancel the training... make sure u give infinate resources to that player then ^^
First of all, you do know what GetLocalPlayer() does?
It gets the local player.
This way you can for example show multiboards to a local player instead of having to show it to all players.
I was hoping that this would be possible for unit ownership.
Causing the building to be owned by every local player selecting it.
But you're probably right that it would cause a desynchronization.
A desynchronization means that the server is sending incorrect information to the client.
The server in this case would be the host and the client the player.
When a desynchronization occurs, a player will see stuff on his screen that is not there or not see stuff that actually is there.
Usually this causes the player to disconnect.
I did however give an alternative... Dummy taverns
You can achieve a lot of cool stuff with dummy's alright
Simply create invisible dummy units within the tavern.
Then when a player selects the tavern you can change it's selection to select the dummy unit for the corresponding player.
All that would need to be done then is set the gold and lumber cost for the units who are trained accordingly in the object editor.
This would solve his issue.
shadowvzs said:
why dont clear the selection for all player after change owner thing?
Then how can that player train a unit?
I was hoping that it would be possible to change the owner locally, causing the unit to have multiple owners.