accessing effect variables in expressions and python

For questions about using Classic.

Post » Wed Jan 26, 2011 8:47 am

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.
B
1
G
1
Posts: 6
Reputation: 437

Post » Wed Jan 26, 2011 9:24 am

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 :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests