cjbruce's Recent Forum Activity

  • X3M and Psychokiller1888,

    I was poking through the code, and realized that the following lines are duplicated for buttons in the AirConsoleController. If I'm not wrong, this means that "sendHandshake()" will get called twice, and it is redeclaring the sendHandshake function:

    var sendHandshake = function () {
    				_this.airconsole.message(AirConsole.SCREEN, {
    					handshake: true
    				});
    			};
    			_this.airconsole.onReady = function () {
    				sendHandshake();
    			};
    			_this.airconsole.onMessage = function (device_id, data) {
    				if (data.handshake) {
    					sendHandshake();
    				}
    			};[/code:21donbb9]
    
    I don't know if the above really affects anything.
    
    Also, I placed an alert in c2runtimectrl.js to verify that messages are getting received by the controller and handled in this.air_console.onMessage (created by the AirConsole plugin, not the AirConsoleController plugin).  My alert fires when I place it directly into the code, but a similar alert for the onMessage trigger placed in a Construct 2 event sheet does not fire.
  • X3M,

    Also, the console is seeing a lot of handshake errors in the simulator:

    Message to 0: {\"handshake\":true}

  • cjbruce Have you tried creating an Airconsole object in your controller and getting the nickname inside an OnDeviceJoin condition?

    I think that the nickname that you will get is yours, If I'm not wrong. It is worth a try.

    X3M,

    No luck. The OnDeviceJoin condition doesn't fire on the controller side. Just for kicks, I tried an alert with OnDeviceJoin on start of layout, and the alert showed "null" for the airconsole.nicknamejoin because it had not been set yet.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • X3M and Psychokiller1888,

    I've played around a bit with the plugin, but have not been able to send messages from the screen back to the controller. A few questions:

    1. I assume that the sendhandshake() message is being sent from the screen to the controller, then back from the controller to the screen, all handled behind the scenes by the AirConsoleController plugin on the controller side and the AirConsole plugin on the screen side. Is this correct?

    2. Since the airconsoleController plugin doesn't have any event triggers or expressions to receive messages, I am using the AirConsole plugin on the controller side to try to receive messages. I have tried the following, neither of which seem to work:

    I need to be able to send the following types of information from the screen to the controller:

    airconsole.nickname

    the current screen to display (loading game, too many players, character selection screen, in-game screen, game over screen)

    Is this something that needs to be handled in the controller plugin or the screen plugin?

    Thanks for your help on this!

  • X3M,

    In order to force a landscape orientation, I added {"orientation":"landscape"} to the c2runtimectrl.js:

    So, instead of:

    			_this.airconsole = new AirConsole();[/code:3p6imdde]
    
    I used the following:
    
    [code:3p6imdde]
    			_this.airconsole = new AirConsole({"orientation": "landscape"});[/code:3p6imdde]
    
    Could this capability be added directly to the plugin?
  • Anonnymitet Just adding some stuff

    cjbruce I'm testing all the possibilities

    X3M,

    Thank you!

    I haven't (yet) figured out how to modify the code in c2runtimectrl.js to lock orientation in landscape. I'll keep poking around and (hopefully) post a solution here once I figure it out.

  • > cjbruce

    > 1- I'm figuring this out ... Have you tried triggering a message inside your condition ? Like on mouse click on sprite -> send message "up". ?

    > 2- Yes

    > 3- Fake it by rotating your controls 90 degrees and align them vertically so the the play is forced to hold the smart-phone horizontally.

    >

    X3M - You rock!

    1. Working on it now. I'm building a simple screen.html to test.

    2. Sounds good. Sometimes HTML elements get a little wonky on screen rotations for mobile devices, but hopefully this isn't an issue if I don't make the actual buttons themselves visible.

    3. Will do. When I am normally writing a controller.html file, I set AirConsole.ORIENTATION_LANDSCAPE in javascript. I don't have everything running yet, but I just wanted to make sure the controls rotate when I move the phone around.

    Orientation is a little weird in portrait. The AirConsole logo is sideways, and on the side of the screen. I'm working on manually modifying c2runtimectrl.js to lock the orientation in landscape. Is it possible to modify the plugin to set an orientation?

  • cjbruce

    1- I'm figuring this out ... Have you tried triggering a message inside your condition ? Like on mouse click on sprite -> send message "up". ?

    2- Yes

    3- Fake it by rotating your controls 90 degrees and align them vertically so the the play is forced to hold the smart-phone horizontally.

    X3M - You rock!

    1. Working on it now. I'm building a simple screen.html to test.

    2. Sounds good. Sometimes HTML elements get a little wonky on screen rotations for mobile devices, but hopefully this isn't an issue if I don't make the actual buttons themselves visible.

    3. Will do. When I am normally writing a controller.html file, I set AirConsole.ORIENTATION_LANDSCAPE in javascript. I don't have everything running yet, but I just wanted to make sure the controls rotate when I move the phone around.

  • X3M,

    Thank you for making this! This opens up a whole number of possibilities for gameplay. I am playing with the demo .capx now, and have a few questions:

    1. Is there a way to change the images on buttons? Or should we just not include the image files (leaving the button invisible, but still active), and instead put sprites onscreen underneath the buttons?

    2. Are the controls themselves HTML elements?

    3. Is it possible to lock orientation to landscape?

  • cjbruce It gives you the device id through "AirConsole.deviceIdJoin as this was a join action

    Here's what I tried, unsuccessfully:

    1. Set AirConsole->max players to 8

    2. In the simulator, "Add a New Controller" to create a total of 9 players.

    3. The first 8 players triggered an "On Device Join".

    4. The 9th player did not trigger an "On Device Join".

    What I have not tried:

    Instead of looking for an "On Device Join" for the 9th player, instead I should be using the "On Too Many Players" trigger, then inside its action use the "AirConsole.DeviceIDJoin" expression to get the deviceID of the 9th player?

  • You have a ''on too many players'' trigger for that...

    I was struggling with this one. Does "on too many players" give you the deviceid of the device which is trying to join? Maybe using AirConsole.deviceID?

  • QuaziGNRLnose

    Is there a simple demo on how to get a 3D character model (w/ walking animations) to work in a 2D environment?

    I couldn't find anything like this in the tutorials.

    So in a 2D environment the camera angle on the 3D character model would be locked to a diagonal view, the actual Player object will be a 2D invisible sprite that moves, and the 3D model will just position itself on top of this invisible sprite at all times - so 3D character model would be for appearance only.

    Badmiracle,

    Since you are just using the 3D model for appearance only, could you pre-render your 3D animations, then import them into a 2D sprite strip in Construct 2? There are a number of good tutorials on this, and you will save a lot of CPU time (at the expense of download time and memory).

cjbruce's avatar

cjbruce

Early Adopter

Member since 25 Apr, 2013

Twitter
cjbruce has 4 followers

Connect with cjbruce

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies