Many sprites spawn many bullets -> preview crash

For questions about using Classic.

Post » Fri May 21, 2010 3:44 am

Hi, I'm new to Construct,
and am trying to copy the basic gameplay of Plants vs Zombies, just for fun (no worries if you're reading this, PopCap ;) )
i have just implemented "erase plants with shovel",
and a provisonal approach with just Snow Pea plants, and slowly moving regular zombies, wich will move even slower, and turn blueish when hit. (I haven't included Health or the gameplay grid, or anything else yet)

That works fine, for a while, until the preview crashes.
more Plants = earlier crash.



Sometimes i have to kill the temp.exe process afterwards.
Do you know what went wrong here?
Thanks in advance. :)

Here is the .cap:
http://www.box.net/shared/xb27guy2mn

I'm on Vista x64, using Construct 0.99.84
B
1
G
2
Posts: 2
Reputation: 629

Post » Fri May 21, 2010 8:33 am

Woah, this one has me stumped!!! At first i thought it must be the timer so i tried spawning the bullets every x milliseconds... nope still crashes. I have tried toggling all the events off except for the bullet events and it still crashes, so it has to have something to do with those bullets (as you already stated). Of course, it doesn't crash when toggling off the bullet creation event.

I decided to try and make a .cap with the same amount of objects that spawn the same amount of bullets at the same time intervals and it works fine :?: :!:.
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Fri May 21, 2010 11:41 am

Ah-ha! Uncheck "enable scripting" under the runtime properties, and that will fix it.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Fri May 21, 2010 2:32 pm

cool, that's it. thanks guys. :)
and i figured out, if i use one python command at Start of layout, instead of disabling scripting, it won't crash either. :mrgreen:
B
1
G
2
Posts: 2
Reputation: 629

Post » Sat Aug 28, 2010 3:18 am

Many thanks for this one! I've spent days trying to track down the cause of the crash on my game. I eventually narrowed it down to one line, a line that spawns the bullet, and I had no idea what was causing the problem!

Again, many thanks!

I have a question though. What if I want to have scripts on my game? Does this mean I can't use scripts anymore?
B
3
S
1
G
2
Posts: 86
Reputation: 997

Post » Sat Aug 28, 2010 4:49 am

Do you have Python installed?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Aug 28, 2010 7:25 am

Oh, does one need to install Python first? I thought it was already built within Construct.

Sorry. I still haven't read the documentation about Python Scripting yet since I didn't have any use for it on my current game. Will review it once I have the time.

Thanks
B
3
S
1
G
2
Posts: 86
Reputation: 997

Post » Sat Aug 28, 2010 7:46 pm

No python install is necessary. No crash will occur if you use some python at least at the start of the layout to initialize python. If python isn't initialized the app will crash if ~ 700 objects are created (it's a bug). This bug shouldn't be a problem as long as some python scripts are used when scripting is enabled.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sat Aug 28, 2010 7:49 pm

Ah, so that's how it is. Thanks a lot R0j0Hound!
B
3
S
1
G
2
Posts: 86
Reputation: 997


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests