Collision problems with actors created in Global code

Non-platform specific questions.

Collision problems with actors created in Global code

Postby ondy1985 » Thu Sep 08, 2005 6:22 pm

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?
Image

Motto: "I never let my schooling interfere with my education" --- Mark Twain
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby BeyondtheTech » Thu Sep 08, 2005 6:31 pm

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).
User avatar
BeyondtheTech
 
Posts: 270
Joined: Wed Mar 30, 2005 6:34 am
Location: Edison, NJ
Score: 4 Give a positive score

Postby ondy1985 » Thu Sep 08, 2005 6:47 pm

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 :(.
Image

Motto: "I never let my schooling interfere with my education" --- Mark Twain
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby makslane » Thu Sep 08, 2005 7:26 pm

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?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest