Author Topic: How do I make bots charge attacks (with spears & such)  (Read 1114 times)

So, I was shooting around with a bot with the Recurved Bow. I noticed that when he went towards me, he didn't actually CHARGE the bow and so it was just shooting the arrow without having it on fire or fully pulled back. /title

Bots will charge spears by default.

If one can find the code where they act as such, they can apply it for the weapon.

Bots will charge spears by default.

If one can find the code where they act as such, they can apply it for the weapon.
i found this in the server.cs of bot_hole

spearImage.isChargeWeapon = 1;
CannonTurret.isChargeWeapon = 1;


which designates spears and cannon vehicles as charging weapons

the question is how to apply it to a weapon add-on

Just add the feild
isChargeWeapon = true;
to the weapon's image datablock.

Just add the feild
isChargeWeapon = true;
to the weapon's image datablock.
:O

damn it's that simple?

Yes, bots use that variable to charge up weapons such as the Spear. (Which has the same variable)

Just add the field
isChargeWeapon = true;
to the weapon's image datablock.

Well forget, that was meant to be an edit. I misspelled "field" in my original post. :/

Just add the feild
isChargeWeapon = true;
to the weapon's image datablock.
No.
Add the line
RecurveBow.isChargeWeapon = true;
to the bot's server.cs under the 2 others

No.
Add the line
RecurveBow.isChargeWeapon = true;
to the bot's server.cs under the 2 others

No, that would require editing bots. You can put it in the weapon itself, which is better.

No.
Add the line
RecurveBow.isChargeWeapon = true;
to the bot's server.cs under the 2 others

While this is a valid solution, it will require the person to redownload the default server.cs just for a single update. We don't want this to be the case, right?

Uh what? The client isn't able to download the server.cs. It's fine.

No.
Add the line
RecurveBow.isChargeWeapon = true;
to the bot's server.cs under the 2 others
Same result, except your process is exceptionally worse.

Uh what? The client isn't able to download the server.cs. It's fine.
He means that people would have to redownload bots just to have them charge a certain weapon on their servers, when you could just put it in the weapon instead like a normal person.

No.
Add the line
RecurveBow.isChargeWeapon = true;
to the bot's server.cs under the 2 others
How do I access server.cs files? Do I open them with text?

Same result, except your process is exceptionally worse.
He means that people would have to redownload bots just to have them charge a certain weapon on their servers, when you could just put it in the weapon instead like a normal person.
yeah it makes more sense to add the code in for weapon.cs's rather than add all the chargable weapons you will ever need in the bot_hole thing

although it would be much easier if that was done when the weapon was created