Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: EAD_Agamemnon on February 14, 2008, 10:51:51 pm

Title: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 14, 2008, 10:51:51 pm
Somehow despite all my other gaming, I keep coming back to the SCP...just as well...

My modding abilities are slowly improving...even FRED I'm getting enough confidence to make simple alterations to stock missions. But here's my questions:

1. I'm sure this has been brought up before, but I'm unsure what exactly to look for. I believe somewhere that someone made it possible to manually control a turret on whatever craft you might fly? Correct me if I'm wrong on this. If indeed this is true, which would be nice, where might I turn to get a template on how I should set it up to work?

2. As of yet, I've been unable to get beam weapons to function in turreted positions on player ships...or even AI controlled wingmates. Even "player allowed" fighter beams I've tinkered with, which I can make them work in the gun slots, have refused to work as I want them. The only ships capable of firing any beam I install on them, even when a laser is replaced by beam it works, are the true AI big ships and not the 'gunships' I try to turn stuff into.

Any help here?
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 15, 2008, 05:13:04 am
you can with scripting but its sort of hackish. some problems are for example that its difficult to control a turret and fly a ship at the same time. though i might look into slaving the turret to the free look control. another problem is you have to use the mouse. its possible to control a turret with a joystick but it requires completely giving up your ship. it might be possible to use the axes on an invisible imaginary ship to control turrets on a warship, which would be cool for a bridge/battle stations simulator.

beam weapons are a special case. while its possible to fire any other type of weapon, the only way to fire a beam is to let the turret fire it (the fire command may be sctipted, but the ai will be doing the aiming). none of my demos even attempted a beam though. it might be possible to aim them with some accuracy from single part turrets, but im not 100% sure.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Wanderer on February 15, 2008, 02:59:29 pm
Hmm... wont fire at all you say... Have you beam freed all the ships? What beam types have you tried? Also try keep the intended target targeted when you try to get the turret to fire at it
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 15, 2008, 05:45:05 pm
In answer to Wanderer, I'm not entirely sure how to beam free all ships. The beam types I've tried are stock AAA beams and fighter gun beams. The turret if equipped with it will just sit in its initial barrels-up position. When I have a standard laser in the turret, it does its thing with no issue...merrily targets enemies to try and blast them to itty bitty pieces. Any hostile warships I can change weapons armament to all beams with no problem either....only a nogo when I attempt to equip beams on any turrets the players ships (or wing mates) fly. I'd like to make my gunships able to unleash continuous raking beam fire on shivan fighter swarms.

In answer to Nuke, any problems I'm willing to live with to at least see whats like to control a ship turret. Reading a post by someone regarding turret control wasn't very clear on what exactly must be done. Though it'd be nice to have control, my other problem I'd like to solve more atm.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 16, 2008, 12:34:24 am
check the scripting forum, i know ive posted a couple of turret scripts in there somewhere. also try the virtual cockpit demo as it has a pretty good implementation of player operated turrets.

http://www.game-warden.com/nukemod-cos/downloads/cockpit%20test.rar

and use bob's rtt build

http://freespace.volitionwatch.com/blackwater/fs2_open_r_bobboau_1-15-08_rtt.zip

Title: Re: 2 Questions (Turrets n Weapons)
Post by: Getter Robo G on February 16, 2008, 04:33:07 am
There are FS2 fighters with turrets, I just don't remember them. Try using them as is just to see how they operate.

There is also a fan made Shivan Bomber and some of TBP ships are basically fighter beams.



Title: Re: 2 Questions (Turrets n Weapons)
Post by: Wanderer on February 16, 2008, 04:47:51 am
While fredding... In mission specs editor check that you have 'all ships beam-freed by default' checked.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 16, 2008, 08:01:55 am
ive implemented a few styles of turret control. i think the best was the freespacelancer meathod (mouse script + turrets that chase a mouse pointer). that was the easiest to operate. the direct control meathod that my first try used as well the one in the cockpit demo  is ok if you dont do anything other than operate the turret. but what i really want to try is the vision slaved method. where the turret aims where you look (possibly with an aimbot to aim within a small, specified cone). the idea is use track ir or other free look controls to get a circle over the target. once the target is in the circle the aimbot takes over and gets a well lead bead. even without freelook it would still act as a blindfire system.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 16, 2008, 06:10:15 pm
I'm looking in the Mission Specs, but I dont see such an option. I'm using stock FRED2.

The RTT build when I run it keeps giving me LUA ERRORs....ie

LUA ERROR: attempt to call a string value

LUA Debug:
------------------------------------------------------------------
Name:      (null)
Name of:   
Function type:   C
Defined on:   -1
Upvalues:   0

Source:      =[C]
Short source:   [C]
Current line:   -1
------------------------------------------------------------------

LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Polpolion on February 16, 2008, 10:14:30 pm
Quote
I'm using stock FRED2.

There's your problem.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 16, 2008, 10:56:25 pm
Where do I find FRED2 OPEN....the SCP site at indiegames dont have it...though one that it says is FRED..its just the FSO for 3.6.5. I'll check here however...
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Retsof on February 16, 2008, 10:58:56 pm
Just use Turrey's Installer.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 16, 2008, 11:06:56 pm
Sorry to sound like a broken record. I ran a search on Turrey's Installer....um....where
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 16, 2008, 11:54:27 pm
just use fred 3.6.9. thats what i used to create the demo mission that came with the cockpit demo.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 17, 2008, 12:01:42 am
Okay. Ill try that version, as soon as I can find it. Just found an older version of FRED2 Open but even with beams freed option... my turrets dont track...let alone fire. (This is totally seperate from my manual turret issue.)
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Wanderer on February 17, 2008, 01:04:13 am
Post here the entry of the weapon you were trying to use (only the single entry please, not the whole table). Then describe the test mission you are using.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 17, 2008, 07:43:56 am
has anyone got the cockpit demo to work? im just curious if i overlooked something/want feedback.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 17, 2008, 01:54:04 pm
The cockpit mission I got it to work...just hard to see where the turret is pointing on that little screen.

Heres a portion of the weapon TBL entry. I left out posting the information on the beam behavior. I used this in place of the Subach HL-7 as a gun mount and any ship with the subach will fire it normally. Renaming it for tests was easier than making a separate name then having to make sure it was set up in the mission to be on the armament. It just wont work in turrets. This WAS the Ultra Fighter Beam...

$Name:                          @Subach HL-7
$Model File:                    none ; laser1-1.pof
@Laser Bitmap:                  laserglow01
@Laser Color:               136, 243, 249
@Laser Length:               0.0
@Laser Head Radius:            0.60
@Laser Tail Radius:            0.60
$Mass:                          100.0
$Velocity:                      1000.0          ;; speed of the weapon (initially) -- may or may not change
$Fire Wait:                     2.2            ;; in seconds
$Damage:                        30            ;; NOTE: for beam weapons this is kind of a "continuous" damage applied every few fractions of a second that the beam is on.
$Armor Factor:                  1.0
$Shield Factor:                 1.0
$Subsystem Factor:              1.0
$Lifetime:                      40.0            ;; How long this thing lives
$Energy Consumed:               0.10            ;; Energy used when fired
$Cargo Size:                    0.0             ;; Amount of space taken up in weapon cargo
$Homing:                        NO
$LaunchSnd:                     124             ;; The sound it makes when fired
$ImpactSnd:                     88              ;; The sound it makes when it hits something
+Weapon Range:               4000         ;; Limit to range at which weapon will actively target object
$Flags:                         ( "player allowed" "beam" "fire down normals" )
$Icon:                          icongun05
$Anim:                          LoadGun07
$Impact Explosion:              ExpMissileHit1
$Impact Explosion Radius:       13.0
$BeamInfo:
   +Type:                  3            ;; 0 - 4 are valid #'s

Since my FREDing skill is still quite deplorable...I'm only now beginning to get an idea of what to do beyond the simplest of modifications, let alone making a stand alone test mission. I've been using Surrender Belisarius and A Lion at the Door for testing purposes.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Polpolion on February 17, 2008, 03:15:03 pm
"Fire down normals" is IIRC a turret subsystem flag for the Ship table file. Also, post the rest of the entry.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 17, 2008, 03:18:37 pm
Here's the remainder of the weapon that is shown after the beam class.

+Life:                    2.5            ;; how long it lasts once the beam is actually firing
   +Warmup:                 450            ;; warmup time in ms
   +Warmdown:               500            ;; warmdown time in ms
   +Radius:                 30.0         ;; muzzle glow radius in meters
   +PCount:               12            ;; particles spewed every interval
   +PRadius:               1.2            ;; particle radius
   +PAngle:               65.0         ;; angle of the random "cone" where the particles are generated
   +PAni:                  particleexp01   ;; particle ani
   +Miss Factor:            6.0 5.0 4.0 3.0 1.5    ;; magic # - higher == miss more (only really applicable to type 0 and type 3 beams)
   +BeamSound:               121            ;; the looping beam-firing sound
   +WarmupSound:            122            ;; associated warmup sound
   +WarmdownSound:            123            ;; associated warmdown sound
   +Muzzleglow:            none   ;; muzzle glow bitmap
   +Shots:                  3            ;; only used for TYPE 3 beams
   +ShrinkFactor:            0.0         ;; what percentage of lifetime where beam starts shrinking (0.1 == 10% life left)
   +ShrinkPct:               0.0         ;; what percentage of max width we subtract per second
   $Section:                        ;; one section of the beam (you can have up to 5)
      +Width:               2.0            ;; width of the section
      +Texture:            BeamWhite2      ;; texture for this section
      +RGBA Inner:         255 255 255 255   ;; rgba values (only for non-textured beam compiles)
      +RGBA Outer:         150 150 150 10   ;; rgba values (only for non-textured beam compiles)
      +Flicker:            0.1            ;; how much it flickers (0.0 to 1.0)
      +Zadd:               2.0            ;; hehe
   $Section:                        ;; one section of the beam
      +Width:               6.0            ;; width of the section
      +Texture:            beam-dblue2      ;; texture for this section
      +RGBA Inner:         160 160 0 255   ;; rgba values (only for non-textured beam compiles)
      +RGBA Outer:         60 60 0 10      ;; rgba values (only for non-textured beam compiles)
      +Flicker:            0.1            ;; how much it flickers (0.0 to 1.0)
      +Zadd:               1.0            ;; hehe
   $Section:                        ;; one section of the beam
      +Width:               8.0            ;; width of the section
      +Texture:            beam-dblue      ;; texture for this section
      +RGBA Inner:         255 0 0 255      ;; rgba values (only for non-textured beam compiles)
      +RGBA Outer:         60 0 0 10      ;; rgba values (only for non-textured beam compiles)
      +Flicker:            0.1            ;; how much it flickers (0.0 to 1.0)
      +Zadd:               0.0            ;; hehe

This weapon I installed on (a single part) turret this time and still it wont work on the player ship that has it...though an AI freighter will fire it no problem.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Nuke on February 17, 2008, 08:13:27 pm
use the satyr and press 2. you get a slightly bigger screen :D
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Retsof on February 17, 2008, 08:59:45 pm
This is somewhat unrelated, but could it be done so that after you die you can entertain yourself by taking over a turret on a nearby friendly warship?
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 17, 2008, 11:19:33 pm
IDK retsof. Atm though my main priority is getting beams to work on turrets on player ships...even enemy AI fighters and bombers cannot use the test bed fighter beam...except when installed in their gun slots.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: EAD_Agamemnon on February 18, 2008, 01:02:19 pm
It'd be nice to get this to work....got my energy missiles idea working...just need to refine it. Of which needs to be tweaked cause the RoF tends to fill the screen with multicolored, interceptable enemy weapons....and if I'm testing the weapon from my ship...i might only see 2 of the 6 shots render..........beams in the fighter turrets will help with this I think.
Title: Re: 2 Questions (Turrets n Weapons)
Post by: Wanderer on February 19, 2008, 05:16:23 am
Hmmm... Make sure have given orders to attack something for the wing that you are part of.

As for energy missiles.. there are several ways of doing those. One quite obvious is to make an invisible model and place a glowpoint into the model. Another way would be to make a 3d model to function as a projection for the model and then use transparent textures combined with certain table options, like '$Transparent:' in weapons.tbl etc.