Python Crash - Set Var for TiledBG

For questions about using Classic.

Post » Sun Dec 29, 2013 1:59 pm

I think this is probably a bug in CC but I wanted to get some verification.

I'm trying to do something fairly simple: change a private variable of a TiledBackground object in Python. However I keep crashing the game when I attempt.

This is the code: TiledBackground.SetValue('test',10)

And here's a cap showing the problem in action:
https://dl.dropboxusercontent.com/u/28484936/tiledBG_var_python.cap

As you can see in the example, this exact code works fine for Sprites but it doesn't like TiledBGs. Any help would be greatly appreciated. I need this for a level editor/loader that Im working on.

I would also appreciate any ideas for a workaround if this is indeed an unfixable bug.

Thanks again!
B
21
S
5
G
3
Posts: 65
Reputation: 3,789

Post » Sun Dec 29, 2013 4:48 pm

Instead of using the variable name you can try using the variable's index. 0 for the first, 1 for the second, and so on.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Sun Dec 29, 2013 4:58 pm

Thanks ROJO.

Unfortunately, I just gave that a shot and it still causes the same crash.
B
21
S
5
G
3
Posts: 65
Reputation: 3,789

Post » Sun Dec 29, 2013 7:01 pm

The only other idea that comes to mind is to use the function object and make functions to set/get variables.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Mon Dec 30, 2013 3:21 am

It's odd, I also get a crash if I attempt to call a TiledBackground's variable name by "Expression" in the event editor. This must also be tied into the Python crash.

Regardless of that I found a workaround method that's messy, but works.
B
21
S
5
G
3
Posts: 65
Reputation: 3,789


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests