AirConsole Game Dev Contest 2017

Discussion and feedback on Construct 2

Post » Mon Oct 17, 2016 12:14 pm

nvbenegra wrote:I just can't believe there is a contest for C2 "devs" and there is not a propper tool kit for it. Just a link with "snippets" of information done by sombody not involved with airconsole.


The point is that it's not a contest dedicated for C2 devs. It's more dedicated to Unity developers. Construct 2 is not ready yet to work with AirConsole by itself. There's no "export to AirConsole" option nor any good AirConsole C2 plugin. But it is still possible to make AC games using C2 + Java Script. That's why I thought it's worth to mention this game jam here.
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Mon Oct 17, 2016 12:24 pm

Colludium wrote:I have a question that I hope someone might be able to answer... If a device connects, the trigger event is as I would expect. However, if a device disconnects, the trigger event asks you for the id of the device you are checking for. This seems a little recursive... Am I correct to load the trigger expression as below?

Code: Select all
<condition name="On device left" type="AirConsole">
                            <param name="DeviceID">AirConsole.DeviceIDLeft</param>


Thus the trigger will check against the device id that triggered the trigger...?

Thanks.

Edit - very early stages of looking into this and I have nothing to test yet.


This is a generic approach which should work I think (if it returns the correct ID - I haven't tested this one). Basically after each controller joins the screen you save "AirConsole.DeviceIDJoin" to some variable/array. Something that will become this particular player's handler.

Then when player disconnects you may put this variable as a param of condition "On device disconnects". This way you can take proper action when a particular user diconnects.
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Mon Oct 17, 2016 12:48 pm

Thanks @BackendFreak - that what I suspected too, although I haven't tested it - I was hoping that the trigger would simply return an expression for the leaving device's id, rather than you have to check for a specific id in the trigger itself. Given that these ids cannot be known beforehand, I feel like it'll make for some clumsy events (however, my caveat is I haven't actually tested it yet).

I was looking through the plugin and noticed that DeviceIDLeft in the edittime is a number, but the returned value from the runtime is a string. Possibly an error? Or am I just misunderstanding it?

I'm still reading through the controller setup info, but returning c2 json messages is definitely the way to go.
A big fan of JavaScript.
B
76
S
20
G
73
Posts: 2,242
Reputation: 45,958

Post » Mon Oct 17, 2016 12:58 pm

Colludium wrote:Thanks @BackendFreak - that what I suspected too, although I haven't tested it - I was hoping that the trigger would simply return an expression for the leaving device's id, rather than you have to check for a specific id in the trigger itself. Given that these ids cannot be known beforehand, I feel like it'll make for some clumsy events (however, my caveat is I haven't actually tested it yet).

I was looking through the plugin and noticed that DeviceIDLeft in the edittime is a number, but the returned value from the runtime is a string. Possibly an error? Or am I just misunderstanding it?

I'm still reading through the controller setup info, but returning c2 json messages is definitely the way to go.


You have to store the ID of each player anyway in order to handle player's actions. This id determines which action is comming from which player (and the other directions as well).
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Mon Oct 17, 2016 1:04 pm

Yes, but if I have 8 players (ambitious!) max, then with this setup I will need 8 trigger condition events. I would rather have just one and then action according to id afterwards. Unless my code above works then it'll be impossible to do any other way than with multiple triggers (because AC site says that id numbers are assigned on connection and may not be predicted).
A big fan of JavaScript.
B
76
S
20
G
73
Posts: 2,242
Reputation: 45,958

Post » Mon Oct 17, 2016 1:08 pm

If I can get a test running this weekend then I'll have a hack around in the plugin to see what's going on.
A big fan of JavaScript.
B
76
S
20
G
73
Posts: 2,242
Reputation: 45,958

Post » Mon Oct 17, 2016 2:07 pm

New challenge: You plugin developers develop a plugin that adds airconsole functionality into CS2 w/o the scripting hassle and add it to the scirra store for a reasonable value point and us non-coders will pay you back. :D

I don't care about the contest but it looks like a really fun system to develop games to use with family and friends.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549

Post » Mon Oct 17, 2016 2:46 pm

It's good to be me
B
7
S
1
Posts: 29
Reputation: 481

Post » Mon Oct 17, 2016 2:54 pm

Colludium wrote:Yes, but if I have 8 players (ambitious!) max, then with this setup I will need 8 trigger condition events. I would rather have just one and then action according to id afterwards. Unless my code above works then it'll be impossible to do any other way than with multiple triggers (because AC site says that id numbers are assigned on connection and may not be predicted).


I'm pretty sure your generic approach will work. I use the same trick for IAP's and other plugins and it works fine. I mean that the data is already available on condition trigger and you can use it as a condition parameter.

chrisinfinger wrote:New challenge: You plugin developers develop a plugin that adds airconsole functionality into CS2 w/o the scripting hassle and add it to the scirra store for a reasonable value point and us non-coders will pay you back. :D


Yeah would be good. It's absolutely doable. Just need to add few functions to the plugin. I almost get it working back in March when there was previous game jam. But not many people from C2 were interested in AC at all. Scirra and AirConsole didn't seem to be keen to cooperate that time as well so I dropped this experiment as I had my freelance tasks to do. But now it looks like Scirra and AirConsole finally got interest in each other so hopefully we won't need any hacks in near future and instead we'll have built-in export options and valid plugin. Fingers crossed ;)
ImageImageImage
B
27
S
16
G
82
Posts: 1,029
Reputation: 45,777

Post » Mon Oct 17, 2016 8:42 pm

am sorry if my questions are stupid but can someone pls tell me how I am supposed to read the messages ?
Using "{""c2dictionary"":true,""data"":{""1"":2}}" ?

from this msg for instance : "message": '{"c2dictionary":true,"data":{"action":"joystick_move","x":' + position.x + ',"y":' + position.y + '}}'
B
7
S
1
Posts: 29
Reputation: 481

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests