Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Fandango on November 28, 2009, 05:33:46 am

Title: Rapid Fire Weapons
Post by: Fandango on November 28, 2009, 05:33:46 am
Hi

I've been trying to make a rapid fire weapon for capital ships, kinda like the ones you see in battlestar galactica. So far I haven't had any luck with it as there is always a pause between shots. Can anyone give me a hint on how to do it, I know its possible because I have seen some freespace videos on youtube where ships have rapid fire weaponry.
Title: Re: Rapid Fire Weapons
Post by: Fury on November 28, 2009, 05:49:08 am
http://www.hard-light.net/wiki/index.php/Ai_profiles.tbl
http://www.hard-light.net/wiki/index.php/Ai.tbl

What you want is to do is to create custom AI profile with following flag enabled.
Code: [Select]
$don't insert random turret fire delay: YES

And in ai.tbl create custom AI class for large ships.
Code: [Select]
$Name: Largeship Captain
$accuracy: 0.5, 0.55, 0.6, 0.65, 0.7
$evasion: 10, 20, 30, 40, 50
$courage: 10, 20, 30, 40, 50
$patience: 10, 20, 30, 40, 50
$Friendly AI Fire Delay Scale: 1.0, 1.0, 1.0, 1.0, 1.0
$Hostile AI Fire Delay Scale: 1.0, 1.0, 1.0, 1.0, 1.0
The five values are difficulty levels from very easy to insane. So you could use 2.0, 1.75, 1.5, 1.25, 1.0 as an example of difficulty scaling.

Now, balancing it properly is another matter entirely. But with these, turrets will fire as fast as set in weapons.tbl or -wep.tbm. Note that turret AI does nothing, turrets use pilot AI.


Easier way to set it up is to use "same turret cooldown" flag in weapons.tbl.
http://www.hard-light.net/wiki/index.php/Weapons.tbl#.22same_turret_cooldown.22
The downside is that rate of fire is same regardless of difficulty level, so you can't have rof scaling based on difficulty level. This flag is most useful on weapons that have "huge" flag, as it makes balancing capital ship engagements that much easier.
Title: Re: Rapid Fire Weapons
Post by: Snail on November 28, 2009, 06:34:43 am
Easier way to set it up is to use "same turret cooldown" flag in weapons.tbl.
http://www.hard-light.net/wiki/index.php/Weapons.tbl#.22same_turret_cooldown.22
The downside is that rate of fire is same regardless of difficulty level, so you can't have rof scaling based on difficulty level. This flag is most useful on weapons that have "huge" flag, as it makes balancing capital ship engagements that much easier.
I would personally go for "same turret cooldown" seems a lot easier than the alternative method.
Title: Re: Rapid Fire Weapons
Post by: Dragon on November 28, 2009, 07:14:20 am
Yes, it's easy and usefull, I've been using it since it was introduced, with great results.
Also, if you want to see something epic, try using it with flak cannons and Nighteyes' flak explosion (it should be in Hollywood effects beta package).
If you have good computer, you won't be disappointed with the results.
And of course, you can play on Insane, it makes even standard FS2 weapons to fire rapidy compared to other levels.
It also ups AI skill and removes boosts from player's fighter, so unless you're a very good pilot it may be too difficult.
Title: Re: Rapid Fire Weapons
Post by: Fandango on November 28, 2009, 07:40:29 am
Thanks for the replies, tried it out and it works perfectly (used "same turret cooldown").

Title: Re: Rapid Fire Weapons
Post by: Nuke on November 28, 2009, 08:19:14 pm
as for me i scripted a gatling turret feature. they fire in bursts so they can still have an adjustable delay. not only does it look really awesome, but it is just as scarey as an aaa beam or flak barrage.
Title: Re: Rapid Fire Weapons
Post by: Woolie Wool on November 28, 2009, 08:55:16 pm
You don't need a script for that anymore, not with $Burst Shots and $Burst Delay.
Title: Re: Rapid Fire Weapons
Post by: Nuke on November 29, 2009, 05:14:06 am
aye but that doesnt come with the scripted spinning barrels or the accelerating/decelerating fire rates which looks badass.