Author Topic: AI Players  (Read 7903 times)

I didn't know there was bots, how do you make them?




Nitramj is the person to ask this.

Well, I know how...but you'd need to migrate a few things from RTB. I was thinking of remaking my old kittybot thing minus kitty-ness, but then I decided not to.

Anyways...use
Code: [Select]
new AIPlayer(Name){datablock = "DataBlockHere, usually PlayerStandardArmor or something" };
I think. (Can't be bothered to check :P)

Well, I know how...but you'd need to migrate a few things from RTB. I was thinking of remaking my old kittybot thing minus kitty-ness, but then I decided not to.

Anyways...use
Code: [Select]
new AIPlayer(Name){datablock = "DataBlockHere, usually PlayerStandardArmor or something" };
I think. (Can't be bothered to check :P)
theres no aiPlayer script in retail blockland :P

Well, I know how...but you'd need to migrate a few things from RTB.

Quote from: Badspot
Fixed AI players not being able to ride player-based vehicles

Code: [Select]
function createBot()
{
     %bot = new AIPlayer()
     {
          datablock = "PlayerNoJet";
     };
     return %bot;
}
//to make bots take damage do %bot.minigame = %client.minigame;
//%bot.client = %bot; %bot.player = %bot;
//make sure the client is in a minigame

wtf, there is an aiPlayer script? o.O

That pretty much just spawns the freaky black bots found in F11.

They won't do much without proper programming...

Yes, the programming is up to the scripter, not me =)
I'll through out another piece of code for you to use:
Code: [Select]
//GameConnection::ApplyBodyParts(%client);
//GameConnection::ApplyBodyColors(%client);
//This code works on bots only if you make their .client and .player = themselves
GameConnection::ApplyBodyParts(%bot);
GameConnection::ApplyBodyColors(%bot);
//to find the names of appearance prefs do %client.dump (when %client is a client object)
//The appearance variables are pretty noticable

Good luck getting bots to do what you want! I'll be around if anyone needs more help, but I won't get too specific always.

Nitramj is the person to ask this.

heh.. i asked nitramtj how to make bots and stuff and i ended up given him the idea ^^" but yea i made a bot mod its simple realy i added it to 00002 when i get home ill give you the code or just use simple things like this

//the heart of the whole thing
function botfollow(%bot,%client)
{
if(%bot.following $= "1")
{
echo("This bot is already in use");
echo("Use the stop command to stop it");
}
else
{
%player = %client.player;
//the command that moves the bot
%bot.setmovedestination(%player.getposition);
//this next thing makes it so you can't make a bot follow 2 objects or it will be a little glitchy
%bot.following = 1;
%bot.lawl = schedule(100,100,refreshbot);
}
}

//make the bot refresh
function refreshbot(%bot,%client);
{
%player = %client.player;
//the command that moves the bot
%bot.setmovedestination(%player.getposition);
%bot.lawl = schedule(100,100,refreshbot);
}

//stop the bot with this
function stopbot(%bot)
{

%roflmao = %bot.lawl;
cancel(%roflmao);
}


the spawn command ill put later this stuff mite not work cause
i made it up just barley when i get home Like i said i will upload my
aiplayer.cs onto my site www.sihous.com then i will put a link

hope thios helps :x

fishpen0

  • Guest
Woah,so when are you gonna upload?