Author Topic: Multiple bots? Sure, but...  (Read 1503 times)

I'm not seeing how it will work.

I gave exampes of how to add a bot to the list, remove it, and loop through them.

I gave exampes of how to add a bot to the list, remove it, and loop through them.
There's also a character limit on strings. I think.

There's also a character limit on strings. I think.

1024 in ASCII strings (by default?) in Torque.

Simset can go till your computer can't handle it.

I gave exampes of how to add a bot to the list, remove it, and loop through them.

But then what about picking a certain one from the list?

But then what about picking a certain one from the list?

getWord

getWord

Alright, although I've had my ups and downs with that miscreant. >:(

Alright, although I've had my ups and downs with that miscreant. >:(

You'd use it the same as the suggested SimSet's getObject.

Wait I won't need a complicated command that chooses the exact bot would I? With that loop I can just set the bot it loops to to %client.bot. Right? :D

if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
   if(!$RTB::RTBR_ServerControl_Hook)
   exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
   RTB_registerPref("Copies per player","Gameplay","$Copies::Amount","int 0 300","Script_Copybots",3,0,0);
}
else
{
   $Copies::Amount = 3;
}


$copyTotal = 0;
$Mahcopycount = 0;
$Copystuff = $Mahcopycount;

function serverCmdcopy(%client)
{
   if($Mahcopycount>=0)
   {
      if($Mahcopycount==$Copies::Amount)
      {
         return;
         cancel();
         $Mahcopycount = $Mahcopycount -1;
         %client.botlist = trim(strReplace(" "@%client.botlist@" "," "@%bot@" "," "));
         Messageclient(%client,0,"<color:FF0000>Silly truffle, you have too many copies! :D");
      }
      %bot = new AIplayer(%bot)
      {
             datablock=playernojet; position=%client.player.getTransform();
      };

      $Mahcopycount = $Mahcopycount +1;
      %client.botlist = %client.botlist SPC %bot;

    MessageClient(%client,0,"\c3You have cloned yourself.");
    //Stuff for bot clearing
    $copyBots[$copyTotal] = %bot;
    $copyTotal++;
  
       %bot.isCopy = 1;
       %client.bot = %bot;
   %rawr = %client.player;
   %client.player = %bot;
   %client.applyBodyParts();
   %client.applyBodyColors();
   %client.player = %rawr;
   %bot.setScale("1 1 1");
   %bot.setMoveObject(%client.player);
   //%bot.setShapeName(%client.name);
   //We can only pretend. :(
   %bot.accent = %client.accent;
   %bot.faceName = %client.faceName;
   %bot.decalName = %client.decalName;
   %bot.accent = %client.accent;
   %bot.accentColor = %client.accentColor;
   %bot.chest = %client.chest;
   %bot.chestColor = %client.chestColor;
   %bot.hat = %client.hat;
   %bot.hatColor = %client.hatColor;
   %bot.headColor = %client.HeadColor;
   %bot.hip = %client.hip;
   %bot.hipColor = %client.hipColor;
   %bot.larm = %client.larm;
   %bot.larmColor = %client.larmcolor;
   %bot.lhand = %client.lhand;
   %bot.lhandcolor = %client.lhandcolor;
   %bot.lleg = %client.lleg;
   %bot.llegcolor = %client.llegcolor;
   %bot.pack = %client.pack;
   %bot.packcolor = %client.packcolor;
   %bot.rarm = %client.rarm;
   %bot.rarmcolor = %client.rarmcolor;
   %bot.rhand = %client.rhand;
   %bot.rhandcolor = %client.rhandcolor;
   %bot.rleg = %client.rleg;
   %bot.rlegcolor = %client.rlegcolor;
   %bot.secondPack = %client.secondpack;
   %bot.secondPackColor = %client.secondPackColor;
   %client.bot = %bot;
   }
}

function servercmdcopytoggle(%client, %toggle)
{
   %client.bot = for(%i = 0; %i < getWordCount(%client.botlist); %i++) echo(getWord(%client.botlist,%i));
}








How does that look?

Inb4someonesaysno
« Last Edit: September 28, 2009, 07:48:20 PM by Gamefandan »

You look like you have no idea what you're doing, namely the last part.

You look like you have no idea what you're doing, namely the last part.

You're right! I don't! :D

Weird how no one has replied since I said that. D:

Code: [Select]
function servercmdcopytoggle(%client, %toggle)
{
   %client.bot = for(%i = 0; %i < getWordCount(%client.botlist); %i++) echo(getWord(%client.botlist,%i));
}
What the heck are you trying to do, make the commands apply too all of their bots, or what?

Code: [Select]
function servercmdcopytoggle(%client, %toggle)
{
   %client.bot = for(%i = 0; %i < getWordCount(%client.botlist); %i++) echo(getWord(%client.botlist,%i));
}
What the heck are you trying to do, make the commands apply too all of their bots, or what?

I'll get back to you after I get some rest.