function name variable?

0 favourites
  • 8 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • since when is using a string variable in functions not possible?

    i even tried with constant variable, nopes

    has this been changed maybe?

  • vtrix, in the past twenty releases I've used, I don't think it was ever possible. Just, about 5-10 or so releases ago, a using a constant string variable didn't give an error until compile-time, as opposed to at the time you add it.

  • vtrix, I am not sure exactly what you mean... I just tried half a dozen ways of using a string variables with functions and they all worked.

    I passed a string variable in as a parameter, accessed a global string variable, and even called a function by assigning the name of the function I wanted to call in a string variable.

    (I am running version 161)

  • danialgoodwin

    i think it worked with rex function in the early days, i didn't need this because i wasn't using functions alot but now it would be helpfull

    AllanR

    its on function "name" , i want it to be a variable

    so i can rename my funtions more easy

    does that work for you?

  • danialgoodwin

    i think it worked with rex function in the early days, i didn't need this because i wasn't using functions alot but now it would be helpfull

    AllanR

    its on function "name" , i want it to be a variable

    so i can rename my funtions more easy

    does that work for you?

    vtrix

    Never worked for me to set the function, however, I think you can call functions with a variable (not sure about that).

    Maybe a dictionnary can work for that?

  • There is a typo I have made before:

    Make sure the variable of the function name is NOT in quotes, or else the system will make the decision ""name""=/="name"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aphrodite

    yes calling works, but to be usefull, on funtion "string" should take the string of the variable

    this way you can just rename the functions at one place

    not sure how a dictionnary would help... to keep track of my functions?

  • Aphrodite

    yes calling works, but to be usefull, on funtion "string" should take the string of the variable

    this way you can just rename the functions at one place

    not sure how a dictionnary would help... to keep track of my functions?

    Now that I think abut it, the dictionnary may be more confusing..

    Personnally I like to have all functions in one event sheet, maybe you could do like this:

    Global variable : FunctionName = "My function"

    On Function "My Function"

    Global variable : FunctionName = "My function2"

    On Function "My Function2"

    So you have the two things to edit in the same place

    Then you call functions only with the global variables

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