Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Can Python access and/or modify behaviors? From what I've tried so far it does not seem to be possible.
For example, if I want to change sprite[CustomMovement].XSpeed, how would I set that or get the value of in script?
you can still use python though, with the python() expression
Sprite - Custom Movement - Set X Speed to:
if it gets messy, or you want to tweak it alot:
an alternative is to set a python variable:
Then in the event sheet:
[b]Sprite - Custom Movement - Set X Speed to:[/b]
for retrieving the value of Sprite[CustomMovement].XSpeed, the only thing I can think of is to set a private or global variable to Sprite[CustomMovement].XSpeed just before the script in the eventsheet, then using the variable in your script in place of the expression
Develop games in your browser. Powerful, performant & highly capable.
Thanks for the example! I figured there would be syntax issues since the way Construct specifies Behaviors would clash with Python syntax, so this is a pretty good work around.