mikelester's Forum Posts

  • 7 posts

    I am pretty new to Construct 2 but have used Javascript for years.

    I accidentally posted this for Construct 3, I am actually using Construct 2.

    I am having trouble finding a complete example of "c2_callFunction " showing how to use it, and where the Javascript code is located. (And I can't find an example because the dropbox examples return "the 404 file not found" error).

    Assuming I want to do some calculation on a variable "Variable_A" (passed from Construct 2) times 2, and then return the value to Construct 2 (and then use it somewhere - ie. place as value in text.)

    The equation would be X times 2 = 18 if "X" is "9"

    My questions are:

    1. Where do I write the Javascript function(ie. Where is the HTML file (name and location) ?

    2. How do I call the "c2_callFunction".

    3. How do I return the result.

  • I am pretty new to Construct 2 but have used Javascript for years.

    I am having trouble finding a complete example of "c2_callFunction " showing how to use it, and where the Javascript code is located. (And I can't find an example because the dropbox examples return "the 404 file not found" error).

    Assuming I want to do some calculation on a variable "Variable_A" (passed from Construct 2) times 2, and then return the value to Construct 2 (and then use it somewhere - ie. place as value in text.)

    The equation would be X times 2 = 18 if "X" is "9"

    My questions are:

    1. Where do I write the Javascript function(ie. Where is the HTML file (name and location) ?

    2. How do I call the "c2_callFunction".

    3. How do I return the result.

  • Is there an easy way to load an array.

    Right now I am using many "Push back..." actions.

    This is boring when I have 15 values to add to an array.

    Is there anything like "add {1,2,3,4,5,6}" to an array

  • I am populating an array, then using each member in the array.

    At the end of this loop I want to destroy the instance of the array.

    I can't just look for the size of the array to be equal to 0 (zero) because the array starts out empty, before I fill it.

    Any ideas??

  • I am creating an Array, populating it, using the members of the array ("for each X element") then destroying the array.

    When I next create an ARRAY it has a UID one larger than the last array created. Is this correct? Do UID's never get reused???

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am trying to convert a game from Gamemaker to Construct2 and I have one very large algorithm (about 600 lines) that sets up each level of the game. I probably could translate this into an event but I could see this as difficult to write and more difficult to maintain.

    Is there anyway to have this become an importable Javascript function?

  • I have dynamically created sprites and I am using text objects to give them a label (ie one or two character numbers, such as 5 or 27). The problem is the text object needs to position to a different image point based on the size of the number in the text.

    Or is there an easier way to label an image?

  • 7 posts