Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: starbug on June 24, 2021, 03:22:32 am

Title: Homing Primaries??
Post by: starbug on June 24, 2021, 03:22:32 am
Is it possible to make Primary weapons like the Terran Turret for example to home like a missile?? I'm sure ive seen a video over on discord where theres a shivan cruiser firing their laser turrets and they are all homing on to their target.

Is it as simple as adding something like this to the weapon table?
$Homing:                     YES
   +Type:               ASPECT
   +Turn Time:            2.0
   +View Cone:            360.0
   +Min Lock Time:         3.0
   +Lock Pixels/Sec:      40
   +Catch-up Pixels/Sec:   80
   +Catch-up Penalty:      10
   +Seeker Strength: 10
Title: Re: Homing Primaries??
Post by: 0rph3u5 on June 24, 2021, 04:17:30 am
From one of my testing builds:

Code: [Select]
$Name: Smart Rifle
$Model File: none
@Laser Bitmap: LaserGlow03
@Laser Glow: 2_LaserGlow03
@Laser Color: 150, 150, 150
@Laser Color2: 150, 150, 150
@Laser Length: 2.0
@Laser Head Radius: 1.0
@Laser Tail Radius: 1.0
$Mass: 1
$Velocity: 400.0
$Fire Wait: 0.8
$Damage: 15 ;;TBD
;;Damage Type: Rifle-lvl0
$Detonation Range: 1600
$Blast Force: 0
$Inner Radius: 0
$Outer Radius: 0
$Shockwave Speed: 0.0
$Armor Factor: 1.0 ;;modified elsewhere
$Shield Factor: 1.0 ;;modified elsewhere
$Subsystem Factor: 1.0 ;;modified elsewhere
$Lifetime: 4.0
$Energy Consumed: 0.0 ;;uses ammo instead
$Cargo Size: 0.25 ;; TBD
$Homing: YES
+Type: HEAT
+Turn Time: 1.0
+View Cone: 40.0
+Seeker Strength: 3.0
+Target Lead Scaler: 0
$LaunchSnd: -1
$ImpactSnd: -1
$FlyBySnd: -1
$Rearm Rate: 0.3 ;;TBD
$Rearm Ammo Increment: 25
+Weapon Range: 1600
$Flags: ( "Player allowed" "Ballistic" "no pierce shields" "small only" "no primary linking" "no homing speed ramp" )
$Icon: iconcirce
$Anim: circe
$Impact Explosion: exp20
$Impact Explosion Radius: 0.0

EDIT: This is a proof of concept for a homing primary - as such many values are "just there". It is meant to be used by the player and slot into a "specialist weapons slot", which is a primary weapon slot with only a single firing point on the model.
Title: Re: Homing Primaries??
Post by: starbug on June 24, 2021, 07:16:38 am
Ah right so would that work on a Capital ship weapon for say a Energy type Torpedo for example?
Title: Re: Homing Primaries??
Post by: 0rph3u5 on June 24, 2021, 08:28:21 am
Sure - it depends on the effect that you would want (e.g. the "no homing speed ramp"-flag in the example above is so that the it looks like a normal bullet has been fired, but if you leave it out it might be more like a gyro-jet effect)
Title: Re: Homing Primaries??
Post by: Colonol Dekker on June 24, 2021, 09:27:34 am
Wings of dawn has many examples.
Title: Re: Homing Primaries??
Post by: 0rph3u5 on June 24, 2021, 09:50:01 am
Original Wings of Dawn cheats by using secondaries for the "homing lasers" of the enemy ships.

The new Wings of Dawn relies on custom builds, so I don't know if that is fully transferable.
Title: Re: Homing Primaries??
Post by: starbug on June 24, 2021, 10:06:21 am
Ah cheers guys will give it a test when I get home from work
Title: Re: Homing Primaries??
Post by: Asteroth on June 24, 2021, 10:40:19 am
The only caveat is that they can't use aspect seeking, but aside from that, it works just like missiles.
Title: Re: Homing Primaries??
Post by: Antares on June 24, 2021, 10:11:40 pm
Can't primaries be coded to auto-aim? I seem to recall some guns in Wing Commander Saga having aiming assist within the reticle.
Title: Re: Homing Primaries??
Post by: Strygon on June 24, 2021, 10:36:42 pm
Yes, that's been a thing for a pretty long while.