Python modules and global variables

New releases and general discussions.

Post » Mon Feb 25, 2008 4:44 pm

I've talked to Ashley via MSN about this, but I guess it's worth posting to look at your comments.

1) Python modules
For now, we can just insert scripts. I suggest to have modules for scripts as event sheets for events. If you had a module, you put the code in there and then, in the main event sheet, you put a script saying something like "import module1". In this way you can use the same module in different scripts or export it.

2) Global python variables
I was making an array-based game, and I found an impossible thing to do. If I have to move my character, I can't use the same array, because this will require other scripts. Look at what I'm saying :
Since you can't do conditions in python yet, you have to put the script as a sub-event. By doing so, the bariables of the other scripts won't be used in other scripts. What a shame.
If the dev team adds something like "global x = [1,1]" then x could be used in all the scripts.
Posts: 512
Reputation: 2,674

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests