Author Topic: Adding bots to Minigames  (Read 4407 times)

How do I add bots to minigames, so they can damage other players etc?

You need to add:
Code: [Select]
%bot.minigame = minigame;
%bot.player = %bot;
%bot.client = %bot;

-Yay for first ever post on bl forums


You script them. I needed this because Grimreaper wanted a Bot War Script. I made him one, and used this to make them cause damage. If you want to see look at his server...

And I got them from a script that I made.

I have bots but I accidentally broke them JUST when I started losing interest in the game (not that I'll never play again, but I'm not going to play for a while). They were basic, but that's because I was going to release them as a base for people to make into their own special bot buddies. They'd actually still be working if people didn't keep suggesting I add more commands when I already said to them that it'd serve as a base.

Anyway, since the topic was answered and this is a topic about bots, how do you get a bot to have everything the player has....I made a new datablock for the bots so that they could have enhanced speed but now they can only die if a bot explodes next to them.

You mean weapon-wise, appearance wise, or what?

Well, since bots use the AIPlayer class rather than the Player class, when any checks use if(%obj.getClassName = "Player") it won't work anymore. Does the Bot Exploding thing use a check for "Player" or "Player" || "AIPlayer"?


Bot explosion during the time when my bots only followed was part of the follow script :o the explode itself is a branched command off the datablock, but the follow just activated it off a 1/7500 chance every 0.03 seconds. I'm assuming aiplayer will have to be based off the datablock itself, meaning none of the datablock-assigned stuff can be changed...

I could start on my script again when I finish LoZ: TP. I'm at Snowpeak Ruins now, going to the second, supposed, place of a shard of the Mirror of Twilight. THen I would post it and you'd understand...I even made a botwand but I never got to hooking it into the bot stuff since I was worried about selecting a follow bot when they always follow behind.

Fixed from above:
Quote
Code: [Select]
if(isObject(%client.minigame)) %bot.minigame = %client.minigame;
%bot.player = %bot;
%bot.client = %bot;

%client would be either whoever spawned it's client object (Making it no game if the client isn't in one) or perhaps it could be the host's minigame in things like RPG's where everyone will be in one game to be able to attack each other.

Also, MasterCE, try using the above code and if you haven't, make the datablock like the other 'branching off' player datablocks like Quakeplayer - so it has all the properties in PlayerStandardArmor::OnDamage etc.

You could make the bot aim at the position slightly in front of the player, too.

Code: [Select]
datablock PlayerData(Speedplayer : PlayerStandardArmor)
{
   cmdCategory = "AIPlayer";
   groundImpactMinSpeed = "3";
   horizMaxSpeed = "120";
   horizResistSpeed = "15";
   maxBackwardCrouchSpeed = "15";
   maxBackwardSpeed = "20";
   maxForwardCrouchSpeed = "15";
   maxForwardSpeed = "20";
   maxSideCrouchSpeed = "15";
   maxSideSpeed = "20";
   maxUnderwaterBackwardSpeed = "15";
   maxUnderwaterForwardSpeed = "20";
   maxUnderwaterSideSpeed = "15";
   minImpactSpeed = "5";
   upMaxSpeed = "125";
   upResistSpeed = "15";
   maxSideProneSpeed = "15";
   maxSideWalkSpeed = "20";
   maxForwardProneSpeed = "15";
   maxForwardWalkSpeed = "20";
   maxBackwardProneSpeed = "15";
   maxBackwardWalkSpeed = "20";
   minJetEnergy = 0;
   jetEnergyDrain = 0;
   canJet = 0;
};
That's what I'm using, it's branching off it right, but it won't use the commands. I set it to change datablocks to that when players velocity is over 10 (just like skis)

The skis mount you to a vehicle, not change datablocks. It could cause a problem - resetting some things with "Armor::OnAdd" etc. Just set it to that datablock in the new AIPlayer(){datablock = Speedplayer}.

It could be the cmdCategory thing - My bots don't use it, just using the generic PlayerNoJet like you mentioned, and work fine. Maybe it's blocking off functions like Player::OnDamage?

The skis mount you to a vehicle, not change datablocks. It could cause a problem - resetting some things with "Armor::OnAdd" etc. Just set it to that datablock in the new AIPlayer(){datablock = Speedplayer}.
...
That datablock is the Player, not skis. Skis don't work if your velocity is over 10, so that's why I said "just like skis."

What about for spaceguy's mod? I don't understand a word he said.

What about for spaceguy's mod? I don't understand a word he said.
Your post has[color=AFC6DB]n't[/color]help every one.