Page 1 of 1

Collision problems with actors created in Global code

PostPosted: Thu Sep 08, 2005 6:22 pm
by ondy1985
Hi.
I have 1.3.0 version of GE. I have an enemy and in it's "Destroy Actor" event I call my KillEnemy() function defined in Global Code as
Code: Select all
void KillEnemy()
{
   CreateActor("explosion", "explosion1", "no parent", "no path", false);
}


which should create the "explosion" actor just before the enemy actor is destroyed. The problem is, that the explosion seems to not respond to "Collision" events. When I create the explosion simply in the enemy's Destroy Actor event, it works. It doesn't work only when created from Global Code. But strange is, that sometimes the collision test works. I create e.g. 10 explosions and usually at least 1 responds to collision with player, but the others do not. Is it a 1.3.0 bug or what?

PostPosted: Thu Sep 08, 2005 6:31 pm
by BeyondtheTech
This doesn't solve your problem, but I found the Global Code to act weird also when it comes to actors. In 1.3.1, I had to use the getclone feature to access the internal variables.

Code: Select all
void DamageBattlestar()
{
    battlestar.hull_integrity-=10;
}


...did not work.

Code: Select all
void DamageBattlestar()
{
    getclone("battlestar")->hull_integrity-=10;
}


works fine.

I've learned to put things into ActivationEvents when the Global Code just doesn't want to work properly (read: I use the Global Code sparingly).

PostPosted: Thu Sep 08, 2005 6:47 pm
by ondy1985
I have no problems accessing internal actor variables through Global code. But if it occurs, I will use your solution. Thanks.

I will have to play a bit with my problem, but I'm afraid I won't be able to release demoversion of my game tomorrow as I promised to my publisher :(.

PostPosted: Thu Sep 08, 2005 7:26 pm
by makslane
I have made a little test here and works using the kill function in global code.
Can you send me a little ged with this problem?