Documentation for python scripting

For questions about using Classic.

Post » Fri Oct 12, 2012 6:57 am

I am fairly new to construct classic, and one of the reasons I decided to play with it over construct 2 is that it included python scripting as part of the event sheet.

I am interested if there is a good source of documentation that would list the differing variables/methods associated with built-in object and behaviors so I can call them from script?

Failing that I have been desperate to figure out how to reference self on an instance that is triggering an event.

For example if a blue guy comes within sight of a red guy and triggers an appropriate event. How would I make it so the script I attach to that even refers only to that instance of blue guy, not any or all other ones?

Thanks in advance,

Posts: 3
Reputation: 256

Post » Fri Oct 12, 2012 5:24 pm

All the variables/methods relate directly to Actions/Conditions/Expressions. You can get the list in the script editor by typing "Sprite." and the right hand side should show them all.

You can also find the names of the variables/methods by using the dir() function in this interactive python shell:

For accessing the picked objects use "SOL.Sprite".
"Sprite.X" is the x position of the first instance of Sprite
"Sprite[1].X" is the x of the second instance.
"SOL.Sprite.X" is the x of the first picked instance.
"SOL.Sprite[1].X" is the x of the second picked instance.

Some other links:
Posts: 5,555
Reputation: 85,323

Post » Fri Oct 12, 2012 9:03 pm

Thank you very much that is exactly what I am looking for. +1 to construct for having a helpful community.
Posts: 3
Reputation: 256

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest