Python question: System.Create

For questions about using Classic.

Post » Thu Dec 23, 2010 11:00 am

I'm trying to dip my toes into python and I'm already bumping into problems.

As a simple test I would like to create 100 instances of Sprite with the loop index as it's X value.

[code:10j5k26t]
for n in range(0, 100, 1):
System.Create(Sprite,"top",n,30)
[/code:10j5k26t]
It doesn't create anything. When I run the debugger it even says there's only the one initial instance in existance.

But when I use the loop index for something else, like: ListBox.Add(n) that works fine.

Am I missing something?
B
3
S
1
G
4
Posts: 42
Reputation: 1,609

Post » Fri Dec 24, 2010 10:45 pm

Put the object to be created in quotes:
[code:3ml3sjfg]System.Create("Sprite","top",n,30)[/code:3ml3sjfg]
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Sun Dec 26, 2010 7:25 am

OOooohh... haha thank you sir! :o
B
3
S
1
G
4
Posts: 42
Reputation: 1,609


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests