Author Topic: Weapon Ranges  (Read 1693 times)

0 Members and 1 Guest are viewing this topic.

MastaRyan

  • Guest
OK, so I made a new ballistic weapon called the Vulcan, (In this case "made" means made a table entry and then stole the effect from the Procyon insurgency. I'm going to need to ask permission to use it.) And I want it to have a range of 1800 meters. But, currently it can hit an Aten from 2400 metres out. How do I make it have a range of 1800 meters? (I know it has to do with a combination of life and velocity, i just don't have a formula for figuring this out.

Table Entry:
Code: [Select]
; ----------------------------------------------------------------------------------
; Vulcan
;
$Name:                                  Vulcan
+Title:                                 XSTR("GTW-84 Vulcan", -1)
+Description:
XSTR(
"Ballistic Weapon
Level 2 Hull Damage
Level 1 Shield Damage
Power Use 1W Very High ROF 2.5/s", -1)
$end_multi_text
+Tech Title:    XSTR("GTW-84 Vulcan", -1)
+Tech Anim:                     Tech_GTW_ML-70
+Tech Description:
XSTR(
"GTW-84 Vulcan description: write me!", -1)
$end_multi_text
$Model File: none
@Laser Bitmap: newglo10
@Laser Glow: 2_laserglow03
@Laser Color: 125, 125, 125
@Laser Color2: 10, 10, 10
@Laser Length: 10.0
@Laser Head Radius: 0.2
@Laser Tail Radius: 0.2
$Mass: 0.2
$Velocity: 2500.0 ;; speed of the weapon (initially) -- may or may not

change
$Fire Wait: 0.1 ;; in seconds
$Damage: 9
$Armor Factor: 1.2
$Shield Factor: 0.5
$Subsystem Factor: 0.6
$Lifetime: 2.0 ;; How long this thing lives
$Energy Consumed: 0.10 ;; Energy used when fired
$Cargo Size: 0.01 ;; Amount of space taken up in weapon cargo
$Homing: NO
$LaunchSnd: 163 ;; The sound it makes when fired
$ImpactSnd:                                                             162 ;; The sound it makes when it hits something
$Rearm Rate: 12.0
$Flags: ("in tech database" "player allowed" "stream" "ballistic")
$Trail:
    +Start Width:0.2
    +End Width:0.2
    +Start Alpha:0.8
    +End Alpha: 0.0
    +Max Life: 0.25
    +Bitmap: newmiss6  
$Icon: iconflail
$Anim: flail2
$Impact Explosion: none
(I know there's no Vulcan D: I only need one Vulcan.)

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Distance = Lifetime * Velocity

+Weapon Range is the distance where AI starts using the weapon.

EDIT: ...and you don't seem to be using that either. If you have 2500 m/s as velocity and 2 seconds of life time, what did you expect the range to be? :p
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 
There are two things you can do to specify the range of a weapon.

First, take a look at the lifetime of your weapon and its velocity. Usually, the range is determined by how long it lasts and its velocity. For example, a weapon that last 2.5 seconds and has a velocity of 600 could cover a total of 1500.

Second, check the weapon range section of the weapon data. It'll usually tell you how far a weapon can go, regardles of velocity or lifetime. Take the above and say your maximum range is 1200. If your lifetime or velocity goes higher, it'll go up to 1200. Go below this and it'll be back to the top again.

Took me a while to figure out back when I began restoring Cerberus. You'll get the hang of it.

Previous Projects: Ancient-Shivan War | GTF Durandal

Current Projects: Exile: Into The Dark Waters (Proof-editing/misc)

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
There are two things you can do to specify the range of a weapon.

First, take a look at the lifetime of your weapon and its velocity. Usually, the range is determined by how long it lasts and its velocity. For example, a weapon that last 2.5 seconds and has a velocity of 600 could cover a total of 1500.

Second, check the weapon range section of the weapon data. It'll usually tell you how far a weapon can go, regardles of velocity or lifetime. Take the above and say your maximum range is 1200. If your lifetime or velocity goes higher, it'll go up to 1200. Go below this and it'll be back to the top again.

Took me a while to figure out back when I began restoring Cerberus. You'll get the hang of it.

Sorry to say this, but as Herra pointed out, $Range: is only significant for the AI.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Well.. if the weapon requires a lock on then  range is important for the player as well.

And the weapon range thing is only used if it is smaller than the velocity x lifetime
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Reading the wiki tends to help you on the way of modding.

And I misremembered the entry name, it's +Weapon Range instead of $Range, but anyway.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

MastaRyan

  • Guest
Thanks, it works fine now.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Setting a weapon range for a player primary will determine the range the lead indicator appears on the hud.
While I don't really see the point of it, you could in theory set the lead indicator to appear at a range of 2000 while the actual effective range of the weapon is 3000
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

  
You could use it as a gameplay element by saying 2km is the maximum range targeting computers can generate a profile for the targeted craft.
17:37:02   Quanto: I want to have sexual intercourse with every space elf in existence
17:37:11   SpardaSon21: even the males?
17:37:22   Quanto: its not gay if its an elf

[21:51] <@Droid803> I now realize
[21:51] <@Droid803> this will be SLIIIIIGHTLY awkward
[21:51] <@Droid803> as this rich psychic girl will now be tsundere for a loli.
[21:51] <@Droid803> OH WELLL.

See what you're missing in #WoD and #Fsquest?

[07:57:32] <Caiaphas> inspired by HerraTohtori i built a supermaneuverable plane in ksp
[07:57:43] <Caiaphas> i just killed my pilots with a high-g maneuver
[07:58:19] <Caiaphas> apparently people can't take 20 gees for 5 continuous seconds
[08:00:11] <Caiaphas> the plane however performed admirably, and only crashed because it no longer had any guidance systems