Page 1 of 1

creator actor

PostPosted: Wed Jul 11, 2007 8:27 pm
by d-soldier
.. Some functions in GE (such as CHANGE PARENT) allow you to select "CREATOR ACTOR", so obviously each actor knows what created it, right? So when scripting (without the easy to use & click interface functions) how would it be scripted? for example, my actor's DRAW script below has it moving along with another actor (which created it) while not being parented (per the parenting problem with independantly rotating actors addressed in my Hull Breach game). The problem is, if two of these actors are on the screen at once, the following actor doesn't know to follow it's creator(.1 in this case) rather then the original (.0) actor... anyone?

int weight = 1;
x = ((weight -1)*x + e_HK.x +10 )/weight;
y = ((weight -1)*y + e_HK.y +15 )/weight;

** in this case "e_HK" needs to be whatever would make it "CreatorActor"...

PostPosted: Wed Jul 11, 2007 11:10 pm
by Game A Gogo
I think its "creator"

PostPosted: Thu Jul 12, 2007 12:41 am
by d-soldier
+1 to you GOGO... now what about created actors (would be children if they were parented)... How could they be destroyed in a DestroyActor script?

PostPosted: Thu Jul 12, 2007 12:53 am
by Game A Gogo
I do not understand D:

PostPosted: Thu Jul 12, 2007 1:17 am
by d-soldier
So when the first actor is destroyed, it destroys the actors that it created. (they are not child actors, because there is no parenting involved.)

PostPosted: Thu Jul 12, 2007 2:41 am
by Game A Gogo
this is not possible, unless you saved in a string what actor it has created.
like:
Code: Select all
char*CreatedActor;
CreateActor("MyActor", "MyAnimation", 0, 0, FALSE);
strcpy(CreatedActor, "MyActor");

PostPosted: Thu Jul 12, 2007 6:24 am
by d-soldier
Is there a work around for this then? somehow?.. oh, I just figured one out... On the primary actors destroy actor event, I'll have it create an explosion actor which is unique to that object, and on the created actor, any collision with that explosion will destroy it (since it's right there on the other object anyway)... I'm so smart sometimes...