Unable to build standard MouseKeyb plugin

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon May 16, 2011 5:05 pm

Hello guys,

I've been trying to add an expression to the Mouse & Keyboard plugin but I failed miserably.

I downloaded the plugin but I can't get it to build with VS2008. I just download the latest SDK so I guess some things changed since the last official build of that plugin.

All I need is an expression to retrieve the key that has been pressed. Even that, I wouldn't really know how to do it since the only tutorial I found about making plugin was about a coloring sprites.

I checked in the main.cpp and I quickly realized that it was a bit more complicated that just ADDEXP(Bla bla bla ExtObject::GetKey()).. And I wouldn't have any idea what to put into GetKey() anyway..

Should I have to get an older version of the SDK to build the plugin ?

Thanks a lot folks.
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Mon May 16, 2011 5:43 pm

That tutorial is relevant to any plugin you decide to make regardless of the sprite coloring stuff.

There's a lot of "grunt work" for every plugin you design, outside simply what the plugin does. You have to explain to Construct what your plugin does, and how to present it to the end user. That's what ADDEXP will do. ADDEXP will also link up with a function you write in Expressions.cpp. That's where you want to place your GetKey stuff. You'll also have to define your new expression function within Main.h.

ADDEXP is known as an "ACE Table Entry", particularly in your case the "E" in ACE. You want to pay attention to that particular part of the tutorial.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Mon May 16, 2011 6:01 pm

Yeah I know the tutorial covers the basics of any kind of plugin.

The problem is that handling the keyboard device seems to be a bit more complicated than having 2 color values. I know that the same concepts apply no matter what your plugin does but after looking at the standard mouse and keyboard plugin, I don't have the skill to do it from scratch, so I'd like to modify the standard plugin and add an expression to retrieve which key is pressed. (Even that I'll have to dig the internet to find out how to do it, I'm no programmer :P)

The problem is that I can't build the plugin, some things must have changed, for example, there's no action/condition/expression files, they're all in the main.cpp.
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Mon May 16, 2011 6:23 pm

Why can't you build it? You should always provide the error messages you get.

Also, are you using VS2008 Express? The express edition doesn't have all the necessary headers.
Scirra Founder
B
358
S
214
G
72
Posts: 22,946
Reputation: 178,363

Post » Mon May 16, 2011 6:41 pm

Aaaah what was I thinking! Sorry.

I'm using Visual C++ 2008 VC9 and I get these error messages:

[quote:10ey5uj1]Warning: compiler or settings not compatible with Construct Runtime ABI. Enabling workaround functions. See SDK docs on 'Runtime ABI'.[/quote:10ey5uj1]

[quote:10ey5uj1].\Main.cpp(184) : error C2039: 'GetControlState' : is not a member of 'VRuntime'
c:\program files\scirra\sdk\newkey\..\..\Common\VRuntime.h(136) : see declaration of 'VRuntime'[/quote:10ey5uj1]

[quote:10ey5uj1].\res\ConstructSDK.rc2(18) : fatal error RC1021: invalid preprocessor command 'doc3'[/quote:10ey5uj1]

Thanks
B
6
S
2
G
1
Posts: 122
Reputation: 1,194

Post » Mon May 16, 2011 8:36 pm

[quote="Ashley":1xwc712j]Also, are you using VS2008 Express? The express edition doesn't have all the necessary headers.[/quote:1xwc712j]

Is it possible to make alternative source versions that don't need the ATL and MFC for the SDK so express could build plugins like particles, sprite and movements?

I am having no luck building the SVN plugins with express -

viewtopic.php?f=7&t=9178&start=20#p72996
B
2
S
2
G
1
Posts: 121
Reputation: 1,092

Post » Mon May 16, 2011 9:09 pm

I figured out the issue, The common folder in the sdk download is out of date. You need to use the latest version of that folder from the SVN. Click Download GNU tarball to get it.
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests