[Plugin] AirConsole - local multiplayer for your game

Post your completed addons to share with the community

Post » Fri Feb 17, 2017 3:22 pm

@ishmaelmoreno
@Psychokiller1888


So I have to put this inside the controller.html?

AirConsole.prototype.getNickname = function(device_id) {
if (device_id === undefined) {
device_id = this.device_id;
}
var device_data = this.devices[device_id];
if (device_data) {
return device_data.nickname || ("Guest " + device_id);
}
};
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 5:55 am

That's what I said, you need some basic programing skills for that. What you've showed is a copy paste of the API get nickname function...

You have to use, as simple as it sounds

Code: Select all
var nickname = airConsole.getNickname();
var deviceId = airConsole.getDeviceId();


Now, I understand you are in a rush, but I don't think doing all your controller is a good thing. You will never learn if we do code your controller. In max 5 hours you are set in Javascript if you check a couple of courses. And you have 9 days left for the competition, so it's easy, given days are 24 hours. At that point, I will gladly help when it comes to Javascript, but for now, I cannot just code for you, it makes no sense.
B
33
S
11
G
3
Posts: 226
Reputation: 4,326

Post » Sat Feb 18, 2017 1:28 pm

@Psychokiller1888

Thank you! I will try my best.
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 2:51 pm

@Psychokiller1888

I tried it but I'm not getting the value for nickname.


var nickname = airConsole.getNickname();
document.getElementById("Nickname").innerHTML = nickname;
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 2:52 pm

Chek your console using F12. Debug values using console.log(nickname)
B
33
S
11
G
3
Posts: 226
Reputation: 4,326

Post » Sat Feb 18, 2017 3:05 pm

Do I have to send the Airconsole.Nickname from the screen to the controller?
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 3:41 pm

No you don't....... That's the whole point of the API and these functions, as stated, can run on any devices....

Image

My last hint for this, because then I gonna make your controller myself and that I don't want to

Image

Image

Then please, if it's about JS, open a new topic, this one was basically to present the plugin
B
33
S
11
G
3
Posts: 226
Reputation: 4,326

Post » Sat Feb 18, 2017 3:47 pm

@Psychokiller1888

I will try this.

No problem. Thank you for all your help.
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 4:42 pm

@ Psychokiller1888


Just to let you know I figure it out.

Instead of this: airConsole.getNickname();

I have to put this: air_console.getNickname();

I don't know why but it works.

Thank you!
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Sat Feb 18, 2017 4:45 pm

That up to you on how you declared your airconsole instance
B
33
S
11
G
3
Posts: 226
Reputation: 4,326

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 7 guests