Page 1 of 1

problem with clone-kind-of stuff

PostPosted: Mon May 11, 2009 2:08 am
by jimmynewguy
i need this code to send an activation event to all actors colliding with the target actor, iv'e been up for ever and really can't see a problem with this. to make sure the problem wasn't the other code i just had on activation event play sound....didn't get any sound though......
Code: Select all
int n;
Actor *actors;
actors = getAllActorsInCollision("EventActor", &n);
if(actors)
{
int i;
for(i = 0; i < n; i++)
{
SendActivationEvent(actors->clonename);
}
}

Re: problem with clone-kind-of stuff

PostPosted: Mon May 11, 2009 3:23 am
by skydereign
I think it is supposed to be this... Haven't tested it, but I think it is right as you did not specify the actors[i]
Code: Select all
int n;
Actor *actors;
actors = getAllActorsInCollision("EventActor", &n);
if(actors)
{
  int i;
  for(i = 0; i < n; i++)
  {
    SendActivationEvent(actors[i].clonename);
  }
}

Re: problem with clone-kind-of stuff

PostPosted: Mon May 11, 2009 7:21 pm
by jimmynewguy
thanks, but both ways work actually, it was "EventActor" were it should be "Event Actor" wow......