Page 1 of 1

creating infinite actors using code?

PostPosted: Sun May 22, 2011 7:55 pm
by sonicfire
the topic says it all :) -> is it possible?
(xy infinite actors)

Re: creating infinite actors using code?

PostPosted: Sun May 22, 2011 9:57 pm
by lcl
There is no option for selecting that in CreateActor() function, but if the actor you want to create is infinite in editor it will be also when it's created by code, I think.

Re: creating infinite actors using code?

PostPosted: Mon May 23, 2011 6:54 pm
by Hblade
You can do something simliar. make an i variable

Code: Select all
for (i=0;i<50000;i++) { //WILLLLL cause lag xD
    CreateActor("Actor", "Animation", x+(i*32), y+(i*32), FORWARD);
}

the i*32 part basically is the spacing between the actors. This is untested so the code may be wrong in some ways. Anyways, that should create 50,000 actors going on a diagnal line. If you want them to be straight accross take away the y+ part and replace it with 0. Same if you want them to go vertical. If you want them to be cloned left, change the x+ to x-, and if you want them to go up change the y+ to y-.

Other than that idk xD

Re: creating infinite actors using code?

PostPosted: Mon May 23, 2011 8:00 pm
by savvy
you could make it so they are created relevant to the view perhapse? so they dont actually exist far beyond the view.
that would reduce lag, and its how the actual option (xinfinite, yinfinite, infinite) works; hence why actors fall off infinites when they go off screen.

Re: creating infinite actors using code?

PostPosted: Tue May 24, 2011 8:38 pm
by sonicfire
thanks guys!