The Daily Click ::. Forums ::. Klik Coding Help ::. Object Limit? Cant create new objects?
 

Post Reply  Post Oekaki 
 

Posted By Message

Giga-Guy



Registered
  11/12/2004
Points
  33
16th March, 2005 at 23:19:45 -

Im working on a megaman-style engine, and everything is done, the pleyer-movement, enemies, the Special FX, everything. But halfway through the test level, the main character stops shooting bullets, and so do the enemies. It seems that objects sopped being created. Ive made sure that every explosion and bullet is destroyed after 'animation stopped is playing', and if it leaves the play area. Ive even made a counter that counts the objects, and they are being destroyed after use, so Im stumped. What do I do?

 
-coming soon-

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th March, 2005 at 02:26:50 -

TGF has a 256 object limit, if you're using MMF you can increase the object limit to 10 000 in level properties. Sometimes if you have a big level, the bullets will go inactive when they're out of "the camera" -> the bullets just stop and stay still until you move the camera over them again. You can prevent this by either make the bullets dissapear when they go out of the camera:

[bullet]is getting closer than 0 pixels from window's edge
-destroy [bullet]

or, you can prevent them from going inactive by unchecking "inactivate object if far from window" on object properties.

 
n/a

Giga-Guy



Registered
  11/12/2004
Points
  33
17th March, 2005 at 04:23:18 -

Well, Ive already done that. Ive made events that: destroy the bullet when it leaves the play area, when it hits a backdrop, when it hits an enemy, when its 1 pixel from the screen, and Ive unchecked the "inactive if far from window" option. I did ALL of that before I posted here. I even made a counter that counts the bullets, and its confirmed that teh bullet number IS decreasing soon after it increases. Thats why I posted here; I was stumped. =s

 
-coming soon-

Giga-Guy



Registered
  11/12/2004
Points
  33
17th March, 2005 at 04:32:32 -

Erm... On further inspection, I saw something else was causing the problem... I set up a counter that counted the number of bullets, enemy bullets, dust animation objects, and impact animation objects. It was a visible counter. I started up the level, and in a matter of seconds, the counter reached over 120. I eliminated object after object from the equation that the counter displayed (Number of bullets + Number of enemy bullets... etc), and saw that the impact FX object was causing it to rise so rapidly, without going down. This was because there were jumping enemies further in the level, that, when they 'collide with backdrop' create an impact FX object (an animation of dust going everywhere), that gets destroyed when its animation 'stopped' is over. It appears that since some of the jumping foes were real far away, the impact FX objects they were creating couldnt be destroyed... SO all I had to do was uncheck the 'if too far from playfield' option, and everything was fixed.

 
-coming soon-

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th March, 2005 at 05:28:26 -

yea, that's what i always do when something's wrong: delete each object/event one by one to see which one's causing it. You can decrease the object number a bit more if you check "handle background collisions even in invisible playfield" in level properties. That detects collisions out of screen.

 
n/a

Giga-Guy



Registered
  11/12/2004
Points
  33
17th March, 2005 at 23:35:50 -

I always check that option anyway. It can prevent nasty glitches with default-movement enemies further in the level -they get stuck in the ground.

 
-coming soon-

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
20th March, 2005 at 11:57:31 -

Check the "handle background collisions even in nivisibile playfield" option, because if you have jumping enemies, you don't want them to miss their bouncing detector and have them wander off aimlessly. Something you could do for special effects or detectors is to check to see if they're visible, which can be done by:
X position of Object > X Left Frame || X position of Object < X Right Frame || Y position of Object > Y Top Frame || Y position of Object < Y Bottom Frame --> Activate Group "Enemy"

And you can disable it later somewhere in the group when it gets out of the visible area.

 
http://www.klik-me.com
   

Post Reply



 



Advertisement

Worth A Click