Hanging program
by Crystal Pegasus · in Technical Issues · 12/11/2008 (10:27 pm) · 4 replies
Hi,
I am programming an interaction between bots. One side replicates when it kills another bot upon collision with it. The other side keeps replicating indefinitely, so long as it is near a food source.
The problem I am getting is that program "hangs" and I need to do a "force quit" on it. I think it is either to do with copying the bot, deleting it, or perhaps the collision response (e.g. having too many "send collisions"??.... yes I have read the tutorial on collisions).
%dstObj.safeDelete();
%this.cloneWithBehaviors();
Can someone please shed light on this problem. I am pretty much tearing my hair out, so if someone could help out, that would be great.
Thanks.
I am programming an interaction between bots. One side replicates when it kills another bot upon collision with it. The other side keeps replicating indefinitely, so long as it is near a food source.
The problem I am getting is that program "hangs" and I need to do a "force quit" on it. I think it is either to do with copying the bot, deleting it, or perhaps the collision response (e.g. having too many "send collisions"??.... yes I have read the tutorial on collisions).
%dstObj.safeDelete();
%this.cloneWithBehaviors();
Can someone please shed light on this problem. I am pretty much tearing my hair out, so if someone could help out, that would be great.
Thanks.
About the author
#2
Thanks muchly for looking at my problem.
I am currently working in TGB, scripting.
The problem occurs for a small number of bots, as well as a large number. I have encountered problems when bots fill the screen, and would ascribe that to the collision detection modalities.
I think I have narrowed down the problem to the handles obtained in the onCollision function. I have commented out the following, and it seems to work. Though I haven't run it for a couple of minutes.
// %dstObj.safeDelete(); // Bot B
// %srcObj.pDivision(); // Check whether it can divide - Bot A
function BotA::pDivision(%this)
{
.....
}
12/11/2008 (11:28 pm)
Hi,Thanks muchly for looking at my problem.
I am currently working in TGB, scripting.
The problem occurs for a small number of bots, as well as a large number. I have encountered problems when bots fill the screen, and would ascribe that to the collision detection modalities.
I think I have narrowed down the problem to the handles obtained in the onCollision function. I have commented out the following, and it seems to work. Though I haven't run it for a couple of minutes.
// %dstObj.safeDelete(); // Bot B
// %srcObj.pDivision(); // Check whether it can divide - Bot A
function BotA::pDivision(%this)
{
.....
}
#3
Thanks muchly for looking at my problem.
I am currently working in TGB, scripting.
The problem occurs for a small number of bots, as well as a large number. I have encountered problems when bots fill the screen, and would ascribe that to the collision detection modalities.
I think I have narrowed down the problem to the handles obtained in the onCollision function. I have commented out the following, and it seems to work. Though I haven't run it for a couple of minutes.
// %dstObj.safeDelete(); // Bot B
// %srcObj.pDivision(); // Check whether it can divide - Bot A
function BotA::pDivision(%this)
{
.....
}
12/11/2008 (11:45 pm)
Hi,Thanks muchly for looking at my problem.
I am currently working in TGB, scripting.
The problem occurs for a small number of bots, as well as a large number. I have encountered problems when bots fill the screen, and would ascribe that to the collision detection modalities.
I think I have narrowed down the problem to the handles obtained in the onCollision function. I have commented out the following, and it seems to work. Though I haven't run it for a couple of minutes.
// %dstObj.safeDelete(); // Bot B
// %srcObj.pDivision(); // Check whether it can divide - Bot A
function BotA::pDivision(%this)
{
.....
}
#4
I have fixed the weird problem. Thanks for your help.
The cause has taken me a day to find!! It was from the pDivision() function which had a .cloneWithBehaviours() function. This was confused with the behaviour 'spawnOnDelete', which had one child to be spawned when the parent was deleted. Go figure.
okies. Thanks and have a good day/evening.
Cheers.
12/12/2008 (12:45 am)
Hi silentMike,I have fixed the weird problem. Thanks for your help.
The cause has taken me a day to find!! It was from the pDivision() function which had a .cloneWithBehaviours() function. This was confused with the behaviour 'spawnOnDelete', which had one child to be spawned when the parent was deleted. Go figure.
okies. Thanks and have a good day/evening.
Cheers.
Associate Michael Hall
Distracted...
Can you determine for which set of the bots that the problem stems from?