Adding Expressions [Documentation]

0 favourites
  • 6 posts
From the Asset Store
Kids Game
$24.50 USD
50% off
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • I believe that the documentation for the AddExpression function within the SDK documentation here may be intended to be described as

    AddExpression(id, flags, list_name, category, expression_name, description);

    instead of

    AddExpression(id, flags, list_name, category, expression_name, script_name);

  • No, the existing documentation appears to be correct. script_name is the name of the corresponding runtime script function. Is there something ambiguous in the documentation here which could be improved?

  • Hi Ashley, the SDK template that I had downloaded from here describes the last parameter of the AddExpression function to be as a description parameter. It also shows that the script_name parameter is used for Actions and Conditions, but not for Expressions.

    the example given within edittime.js is shown below.

    AddExpression(0, ef_return_number, "Leet expression", "My category", "MyExpression", "Return the number 1337.");

    Clearly, the "Return the number 1337." string is not a script name. Has there been a change to the AddExpression function that I am just not aware of and the template needs to be updated? I doubt that is the case because my plugin seems to be working correct with the Expressions that I have been working with.

  • It's actually correct, the expression name (exp_name) is used as the script name for expressions.

  • Ashley, sorry but it seems to be getting more confusing. My intentions is to simply point out that the SDK Template and the SDK documentation describes the parameters used for the AddExpression function differently. I am surprised to hear that this could be correct.

    I will try once again to point this out because I believe that the difference between the SDK Template and SDK Manual(as it stands) may cause confusion for newcomers to the community (it certainly did for me).

    The difference is shown below.

    [SDK Template]

    AddExpression(id, flags, list_name, category, exp_name, description);

    [SDK Manual]

    AddExpression(id, flags, list_name, category, expression_name, script_name);

    The SDK template and the SDK Manual both explain that the exp_name is used as the script name for expression (as you previously stated).

    However, if the exp_name is used for the script name, then why is there a separate "script_name" parameter in the SDK Manual for the AddExpression function? Also, the listed "script_name" parameter in the SDK Manual for the AddExpression function is not documented at all on its use.

    I believe that the SDK Template describes the parameters correctly because treating the last parameter as a string for displaying a description within the expressions panel during my plugin testing appears to work (meaning that the description that I add shows up in the expressions panel).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aaahhh, I see, sorry for being slow! You're right, the documentation in the manual was wrong and the template was right. I've updated the manual to mirror what the template says. Thanks for spotting this.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)