Adding expression function to array plugin

Get help using Construct 2

Post » Sun Dec 30, 2012 1:26 am

I have attempted to add a new expression function to the Array "plugin", but having a hard time making Construct understand that the expression is taking one parameter.

I've added the following code to runtime.js:
     Exps.prototype.rank = function (ret, playerNumber)
          var ranking = 1;
            //Do whatever...


And added the following to edittime.js:
AddExpression(13, ef_return_number, "Get rank for player", "Array", "rank", "Get rank for a player");

The expression shows up in Construct as expected (i.e. I can enter SomeArray. and the "rank" expression will show up in the dropdown menu). Though, if i enter SomeArray.rank(1), it says 'rank' does not take 1 parameter (should have 0).

What am I doing wrong? How do I properly make the expression take a parameter?
Posts: 12
Reputation: 774

Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, kellehk, Yahoo [Bot] and 27 guests