Author Topic: Bot Damage  (Read 1473 times)

I'm working with AI Players and I want to allow bots weapon's (mountImage + setimagetrigger) to damage players exactly as the normal weapons would.

However, this isn't working. I THINK this may have to do with minigames, but I'm not really sure.

Is there a way to add bots to a minigame? Or do I need to repackage some sort of projectile collision to make it work with bots?

I'm sure this has been addressed before, but search yielded no conclusive results - but feel free to point me in the right direction if you know of a thread!

I can't access it at the moment but...
try looking through the Bot Events coding if you have not already done that.

Took a look at the code, couldn't find the section pertaining to damage/weapons.

Could anyone point me in the right direction?

Also; another bot question.

I'm using armor::onDisabled() to detect bot death.
Any way I could get the killer?

I saw this in Amade's code, but I don't really understand it...
Code: [Select]
if(isObject(%client = %obj.lastPusher) && (%obj.lastPushTime + 1000) > getSimTime())

TRIPLE TOAST

Ok. So, I've got some things cleared up and some things far from cleared up.

I solved all my damage problems using AIConnection and adding the fake client to my minigame. Yay!

However, this now causes a spam of error messages whenever a bot dies.

I also found a workaround for the armor::onDisabled problem.

So my question now is, how do I fix the error messages?

QUADRUPLE POST

WAIT I JUST HAD AN IDEA
Now that my bots have clients, I can use GameConnection::onDeath to get the killer, right? :D

The bot events mod does ALL this for you already.

why re-invent the wheel?

The bot events mod does ALL this for you already.

why re-invent the wheel?
That's a joke, right?

First off, maybe I'm designing this mod for the process, not the product. Stupidly downloading add-ons will not improve my ability to code. Secondly, the bot mod does NOT by any stretch do all the things I want to do. Agreed, the problems in this thread are solved with it - but obviously I have some sort of plan for using these non-glitchy bots.

This is coding help. If you don't want to help me code, don't post.

I'm not sure if I know what you're talking about, but...
>start a minigame
>include all players' bricks
>enable weapon damage

That should do it.

The bot events mod does ALL this for you already.

why re-invent the wheel?
It's not a very nice wheel.

More to the point, with bots it is important that you have your own goddamned wheel.

I'm not sure if I know what you're talking about, but...
>start a minigame
>include all players' bricks
>enable weapon damage

That should do it.
No.

You shouldn't need to add it to the minigame, just set the %bot.client.minigame = %minigame;

Uh yeah that's what I'm doing.

Maybe I'm confused about what "adding to the minigame" means.

Anyways, still got a problem:
a spam of error messages whenever a bot dies.

So my question now is, how do I fix the error messages?

This should be enough for it to work:
Code: [Select]
%bot = new AiPlayer()
{
dataBlock = PlayerStandardArmor;
};
%bot.client = new AiConnection()
{
player = %bot;
minigame = %minigame;
};

yep, that's what im doing

i still get error mesages