Creating 425 actors

Non-platform specific questions.

Creating 425 actors

Postby Troodon » Sun Feb 25, 2007 11:57 am

Hi,
How can I make the 'create actor' make for example 425 actors?
I'm working on a graphic effect and I need to have big amounts of different actors created randombly in the screen. However I don't know how to make many actor at once without typing 400 lines of code.
:wink: Please help.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Sun Feb 25, 2007 1:30 pm

how big is the screen?
for a 800x600 screen use:
Code: Select all
CreateActor("Particle", "particleAnimation", "(none)", "(none)", rand(800), rand(600), false);

:D
and if you Game is 30fps,
it will create 30 actors a second :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Sun Feb 25, 2007 2:06 pm

Sparky, I don't want to have 30 actors in second, I want to have n amount of actors in one event once.

For example think that you are making a game where you are on a planet. You want to have in the beginning of the game a random nature (trees, stones etc). You think that the island looks natural when it has 80 trees in random position. It would look pretty weird if your actor should avoid trees growing everywhere every second, wouldn't it? :wink:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Mon Feb 26, 2007 12:02 am

okay,
on the create actor Event do that 425 times....
I do no know any other way :(
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby makslane » Mon Feb 26, 2007 12:21 am

Try this:

Code: Select all
int i;

for(i = 0; i < 425; i++)
{
  CreateActor("Particle", "particleAnimation", "(none)", "(none)", rand(800), rand(600), false);
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Mon Feb 26, 2007 1:49 pm

It works like a new cow! Thanks! :D :D
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest