0 Favourites

Troubleshooting Expression in Plugin

This forum is currently in read-only mode.
  • I just built-up the example plugin to get started learning how to write these. Everything compiled fine and I was able to load the plugin with Construct.

    Then I followed all the steps in the tutorial to build the color gradient plugin with the setcolors actions and getcolor expression. The problem is when I select "Get Color" from the expression box nothing happens and the window just closes. Any ideas on what I'm doing wrong? I can't find any mistakes in the code.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • it might have something to do with ACETABLE.cpp, if you paste the code I can tell your for sure if it does, just the part relating to that expression. If it is the problem, you can probably figure out from this: the ADDEXP relating to the get color, check number 3 below, but here's a breakdown on the others as well, I don't remember if the tutorial went in detail:

    ADDEXP("My expression", "My category", "MyExpression", &ExtObject::eMyExpression, RETURN_INTEGER);

    [/code:3scnhft6]

    • "My expression" should be what you see when in the Add Expression dialogue in the editor
    • "My category" is the category it's under
    • "MyExpression" is what you actually have to type to use the expression, like "Angle" is what is here in the sprite plugin's sprite.angle expression. not case-sensitive. Checking if this is an empty string is probably where I'd first look, or if it was invalid with a space or something that wouldn't work in construct.
    • &ExtObject::eMyExpression is a pointer to the c++ function that actually returns the value at runtime for this expression
    • RETURN_INTEGER is the return type of the c++ function. RETURN_STRING, or RETURN_FLOAT are two more valid constants, if you right-click - go to deceleration in visual studio on any one of these, you can see a full list.

    if it's not this, it's probably not to do with the ace_table, but I'd suggest checking number 3 before moving on to other troubleshooting

  • Thanks Lucid for the details. Unfortunately, everything still looks ok. On a separate note, I am getting an error when building for release mode (something about:

    ConstructSDK.def : error LNK2001: unresolved external symbol GetInfo

    Release/ConstructSDK.lib : fatal error LNK1120: 1 unresolved externals

    The whole debug/runtime/release mode settings for output and linker confuse the heck out of me. I still get a warning about output path being different than linker path even though they all seem to be the same. It compiles fine under the "Debug" build option.

    I zipped up the relevant source files if you have time to take a look:

    http://www.box.net/shared/dmdy4r6qta

    I'm at a loss at this point how to debug this. Is there a way to be able to debug the execution of this plugin?

  • Think I might be narrowing down at least the runtime/release build error for GetInfo.

    In internal.hpp the function is defined, but it has this config macro

    // EDITTIME

    #ifndef RUN_ONLY

    And the function below is grayed out.

    void WINAPI GetInfo(LPOINFO objectInfo)

    {

    objectInfo->MinimumVersion = MINIMUM_VERSION;

    objectInfo->ideFlags = IDE_FLAGS;

    }

    Still not sure why it compiles fine under debug mode.

    What does it mean in Visual Studio when there is a tiny little red circle with a minus sign sitting over the file name in the solution explorer? I'm using Visual Studio Pro 2010 and the project I coverted over was the MFC visual studio 2005 solution.

  • ok, i figured out the problem with the plugin. It might have just been a stupid error (not selecting "use expression") but I now successfully am using it.

    Still having the problem with building in release mode. The runtime portion of the plugin is still getting an error as mentioned below.

    p.s. Are there any instructions on debugging a plugin at runtime?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,069 148,719
han96's avatar
han96
Unread hot topic
0 Favourites
[plugin] firebase
687 65,181
cybertron7's avatar
cybertron7
Unread hot topic
0 Favourites
[PLUGIN] Canvas
627 186,731
zenox98's avatar
zenox98