problem with clone-kind-of stuff

Non-platform specific questions.

problem with clone-kind-of stuff

Postby jimmynewguy » Mon May 11, 2009 2:08 am

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);
}
}
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: problem with clone-kind-of stuff

Postby skydereign » Mon May 11, 2009 3:23 am

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);
  }
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: problem with clone-kind-of stuff

Postby jimmynewguy » Mon May 11, 2009 7:21 pm

thanks, but both ways work actually, it was "EventActor" were it should be "Event Actor" wow......
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron