accessing effect variables in expressions and python

This forum is currently in read-only mode.
  • 1. I have a Sprite with a Lens effect on it. I want to change the Lens Magnification factor inside a python script.

    1a. Is this possible?

    1b. If so, what is the syntax for accessing an effect's variables from within a python script?

    2. I have a Sprite with a Lens effect on it. I have a text box, whose text should be set every tick to the Sprite's Lens Magnification factor. So I want an "Always" Event with a "Text: set text to [Sprite Lens Magnification factor]" action.

    2a. Is this possible?

    2b. If so, what is the syntax for accessing an effect's variables from within an expression?

    Note that for all questions above, the Lens effect is just an example. I'm really interested in effect variables in general.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The parameters of an effect are one-way only. You can set them, but you can't get them. So the answer to question 2a is: No.

    But I don't know the syntax of accessing an effect in Python, and there should be one, because you can set a parameter.

    You need to keep track of the parameter's current value by copying the value you set to a pv or global.

    Unless someone else shows a way, that is

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