how to make construct2 game to listen to COM PORT

Discussion and feedback on Construct 2

Post » Thu Jun 07, 2012 7:51 pm

hi all
I am trying to connect construct2 to listen to COM PORT.
Is it possible ? if so how ? if not please suggest me some game engines that listen to com port.


this is what i am trying to do
http://pinastro.wordpress.com/2012/06/07/can-we-connect-construct2-games-to-com-port/

Thanks
Karthikeyan
B
6
Posts: 30
Reputation: 585

Post » Thu Jun 07, 2012 8:01 pm

@pinastro
If you're wanting "the game to be played using a GAMEPAD" (as you say in your blog), then take a look at the Gamepad (beta) plugin. Studying its code will show you how/where C2 gets its peripheral input (at a basic level, it's handled by the OS rather than by C2 itself directly).Velojet2012-06-07 22:19:13
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Thu Jun 07, 2012 10:50 pm

Direct COM access is not possible in HTML5. Unless you want to use Gamepads (for which there's the Gamepad plugin beta), you may have to use a different tool to gain this kind of low-level access.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Jun 08, 2012 7:56 am

thanks for the info.

But is it possible to connect to some 3rd party plugins made in C or C++ that can listen to COM PORTs and connect to HTML5 ?
B
6
Posts: 30
Reputation: 585

Post » Fri Jun 08, 2012 11:20 am

@pinastro : the only way to do what you want is to have a java applet, give it full rights, and let that applet access the COM port.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Fri Jun 08, 2012 1:22 pm

thanks @pode

I will try the java applet way

I have figured another way.yet to test it.
though it is long route to achieve but may be it can work
See this
http://pinastro.files.wordpress.com/2012/06/maybeit-will-work1.jpg
B
6
Posts: 30
Reputation: 585

Post » Fri Jun 08, 2012 1:45 pm

@pinastro - C and C++ don't work with HTML5. You can only use Javascript - unless you mean developing a browser plugin like Flash yourself, but that is a very difficult project.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Jun 08, 2012 2:31 pm

@pinastro : in fact you want to listen to a Neurosky BCI ?

For what I now, a Flash swf can't access COM port (you need to use an AIR app, so outside the browser).
However, if you self-sign a Java applet, you can listen to a COM port. That JAva applet can talk with Javascript after that to transmit avlues to C2.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Fri Jun 08, 2012 5:03 pm

@pode ...exactly Neurosky BCI

I am trying a java applet ...let me try and see
B
6
Posts: 30
Reputation: 585

Post » Fri Jun 08, 2012 6:22 pm

thanks all.

It worked like cheese :D
B
6
Posts: 30
Reputation: 585

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests