Page 1 of 1

[Question] Communication between Manialinks

Posted: 31 May 2017, 20:06
by undef.de
I'm unsure if my script was ever working, I guess it was... but maybe I've forgot to test it well... or something...

Anyway, I have a server side manialink which asks for a vote (answers are "Yes" or "No").
Image

To display on every players screen the status, I want to store each players' vote into the array "Players" with my var "VoteManager_CurrentVote":

Code: Select all

Void StorePlayerVote (Text _Login, Text _Vote) {
	foreach (Player in Players) {
		if (Player.User.Login == _Login) {
			declare Text VoteManager_CurrentVote for Player = "None";
			if (VoteManager_CurrentVote != _Vote) {
				VoteManager_CurrentVote = _Vote;
			}
		}
	}
}
mmain () {
	while (True) {
		foreach (Event in PendingEvents) {
			switch (Event.Type) {
				case CMlEvent::Type::KeyPress : {
					// Prevent the initiator from changing his vote
					if (InputPlayer.Login != InitiatorLogin) {
						if (Event.KeyName == "F5") {
							StorePlayerVote(InputPlayer.Login, "Yes");
						}
						else if (Event.KeyName == "F6") {
							StorePlayerVote(InputPlayer.Login, "No");
						}
					}
				}
			}
		}
	}
}
But that is not working, the Input.Player see only his own vote and not the votes from the other. How can i communicate this between the manialinks?

Re: [Question] Communication between Manialinks

Posted: 31 May 2017, 21:07
by oliverde8
Hi,

you can't do that with ingame manialinks. You can't share data between players.

What you must do is send the data to the controller which in return it will send to everyone a new manialink which updates only the player value without displaying anything.