I'm working on a mod/mutator that's themed around various custom weapons that all use the charge bar in various ways instead of ammo. I'm having fits trying to get the bots to use them "correctly"... here's what I've got:
1. The first weapon builds up a charge when it's not being fired, then empties the charge meter when fired (adjusting the power to damage and such). The bots fire it all right, but they never wait for it to charge. I feel that setting the BotFireRate from the AI scripts might work, but so far what I've done hasn't worked, the bots keep on rapid-firing.
Here's the applicable part:
The second weapon is kind of a bastard child of the Avril (except locks on to people) and the Hellbender charging cannon. This one builds up a charge and then fires on release, much like the Hellbender's gun. The bots, once again, don't charge the thing up. This one, I've got no clue about so there isn't any applicable code. I've looked through the ONSPRVChargeGun and whatnot but I haven't found what I think I'm looking for.
Help, as always, is appreciated.
1. The first weapon builds up a charge when it's not being fired, then empties the charge meter when fired (adjusting the power to damage and such). The bots fire it all right, but they never wait for it to charge. I feel that setting the BotFireRate from the AI scripts might work, but so far what I've done hasn't worked, the bots keep on rapid-firing.
Here's the applicable part:
Code:
// set fire rates based on distance
// long range should take measured shots, short range go full auto or use beam
EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
MaxDist = 1100.000; // ugly hack 'cause there's no cutting beam yet
if ((EnemyDist > (MaxDist * 2))) {
// Use max charging time as fire rate, 2.5 sec
SunRodFire(FireMode[0]).BotRefireRate=ChargedIn;
return 0;
} else if ((EnemyDist > MaxDist)) {
// set to rapid fire, 0.2 sec RoF
SunRodFire(FireMode[0]).BotRefireRate=SunRodFire(FireMode[0]).FireRate;
return 0;
}
The second weapon is kind of a bastard child of the Avril (except locks on to people) and the Hellbender charging cannon. This one builds up a charge and then fires on release, much like the Hellbender's gun. The bots, once again, don't charge the thing up. This one, I've got no clue about so there isn't any applicable code. I've looked through the ONSPRVChargeGun and whatnot but I haven't found what I think I'm looking for.
Help, as always, is appreciated.