Author Topic: Bot script optimization  (Read 862 times)

Hi there, it's me again :D

Well, I've got a little question, I'm working on a script that works with multiple bots.
And I've got a little question....
right now I'm looping through MissionCleanup when I'm applying stuff to a variable amount of bots.

Is it more effective to create an Array where all bots are listed?
(Best would be if I could insert referers to the bot objects).
And, how do I use arrays?

(I'm not sure about it, I've read about scriptgroups, may this be the best solution for this?)

Hope someone can help me^^

You could make your own SimSet, which could be used just like MissionCleanup.
Code: [Select]
if(!isObject(BotGroup))
new SimSet(BotGroup);

//Use it like MissionCleanup
BotGroup.add(%newBot); // etc.

for(%i=0;%i<BotGroup.getCount();%i++){
%bot = BotGroup.getObject(%i);
// do some stuff
}

thx Randy, worked quite nicely :D