creating infinite actors using code?

Non-platform specific questions.

creating infinite actors using code?

Postby sonicfire » Sun May 22, 2011 7:55 pm

the topic says it all :) -> is it possible?
(xy infinite actors)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: creating infinite actors using code?

Postby lcl » Sun May 22, 2011 9:57 pm

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.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: creating infinite actors using code?

Postby Hblade » Mon May 23, 2011 6:54 pm

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: creating infinite actors using code?

Postby savvy » Mon May 23, 2011 8:00 pm

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.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: creating infinite actors using code?

Postby sonicfire » Tue May 24, 2011 8:38 pm

thanks guys!
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest