How to call parameters in a function

0 favourites
  • 11 posts
From the Asset Store
Medeival & Viking War Horns Sounds / 22 Unique Calls / 2:40 minutes of audio
  • I added a parameter to the function and returned a value to the parameter when calling the function. So how can we get the value returned by this parameter when using a function?

  • You can use it in expressions:

    Functions.functionname(parameter)
  • Hello, I tried the expression Functions.functionname(parameter), but it said that the expression is invalid. I don’t know if it is not set properly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have to enter it as your own function name.

    For example, I created a 'GetRandomValue' function have 2 parameter in the screenshot and set the return type to Number of the function. Then You can call it in an 'Functions.GetRandomValue(0,0)' expression.

    Note that you must set the return type for the function then you can use it in an expression. Otherwise it is an action

  • I want to implement such function

    Return a value to parameter A when calling the function in Add Action

    Then when using this function in Add Event, compare whether the value of parameter A is equal to a certain condition.

  • do you mean this?

    Just use the local variables and then compare the variables

  • I followed your method, but I don't know why, the system said "This is an invalid expression"

  • It’s best to provide screenshots of your eventsheet or c3p project, otherwise we won’t be able to help you.

  • I'm using Chinese, I'll try my best to explain

    I use it when LoopIndex=54, when calling "调用函数 百科卡牌界面置顶(职业:“符师”)"

    When the return value of the comparison parameter is "“符师”", the event of "文本_百科卡牌备注”的事件"

  • I guess you may want to compare the variable "职业". You can do this through the system conditions: comparison variable.

    你可以加QQ群:180911504, 在群里提问

  • OK, thanks for your help

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