Author Topic: [ALPHA RELEASE]: Configurable Capship Command  (Read 9104 times)

0 Members and 1 Guest are viewing this topic.

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
Hello guys,

I've started using this script in a test mission, but every time i attempt to execute the mission (from the briefing/load-out area), the games crashes and gives me this error:

Also this is done with the Default GTCv Deimos.
Code: [Select]
LUA ERROR: [string "csc-sct.tbm - On Game Init"]:45: attempt to index field '?' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------

stack traceback:
[C]: ?
[string "csc-sct.tbm - On Game Init"]:45: in function 'setTurretColor'
[string "csc-sct.tbm - On Game Init"]:60: in function 'drawTurretUI'
[string "csc-sct.tbm - On HUD Draw"]:4: in main chunk
------------------------------------------------------------------

------------------------------------------------------------------

can anyone explain this one :confused:.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
Could you post how the config section in the script looks like? Sorry for slow response, but I'm not used to the new forum layout and overlooked the scripting board.

 

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
Could you post how the config section in the script looks like? Sorry for slow response, but I'm not used to the new forum layout and overlooked the scripting board.

Here is the Configurable part of the file that u asked for, changed it to only use "SGreen" beam cannons.

Code: [Select]
-- config stuff start

-- turret group, UI display, R, G, B, Brace padding
turretInit("BC", "Beam cannons: ", 255, 187, 53, 14)

end

function defineWeapons()
csc.weapondef = {}

--weaponClassName -> turret group
weaponInit("SGreen", "BC")

end

function defineShips()
csc.shipdef = {}

local
--Karuna
--Entry number - don't forget to change while copypasting this one
i = 1
csc.shipdef[i] = {}
csc.shipdef[i].shipClassName = "GTCv DeimosPlayer"

--turrets showing target braces
csc.shipdef[i].turretTargets={"BC"}

--turrets aviable in UI
csc.shipdef[i].turretControl={"BC"}

--turrets to calculate target range
csc.shipdef[i].turretRange={}

-- possible turret weapon groups:
-- {"BC"}

end
-- config stuff end
Maybe it was something i added/deleted by accident?
« Last Edit: April 25, 2013, 02:06:49 am by k7g »

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
Is your ship class called GTCv DeimosPlayer or GTCv Deimos#Player? Also, if this doesn't work, try re-copying the script (to make sure you copied it right) and adding a new config section for the Deimos rather than replacing the Karuna one. Removing sections is nearly untested.

 

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
its is called GTCv DeimosPlayer.

But i get the script to run in game (just removed the a SEXP command  :doubt:) without issues, but when i set the turrets to lock mode or offline mode, the turrets still fire (with the beam-free-all SEXP) as if they are still set to automatic mode or will not fire at all (with the SEXP command and the turrets 'tracking' range reduced to1, to stop AI from firing it...) as if they are in locked mode. I even set the 'fire' button to the spacebar and still nothing is firing or stopping the turrets.

Also, removing the Karuna does not throw any errors to what i can tell. I'll refresh the file and do as u say and see what happens to it. I'll keep u posted

Update:
Ok, i refreshed the file, and added the Deimos in without removing the Karuna. The turrets seem to respond to the offline mode but when u change it to back to lock mode, they begin firing themselves and they do not turn them selves off when put into offline mode again (they keeping they're target), nor will they respond to player fire orders.

PS: After going AFK for awhile, i just realized that my thinking of the script was out :lol:. By pressing "0" its not meant to fire them its meant to lock them onto ur target, and lock mode is for that action *face palm*, and the turrets are meant to fire at one target until its is destroyed or another one is selected *face palm*. I was not thinking at the time, was to busy trying to get it to work a way it was not meant too :lol:
« Last Edit: April 25, 2013, 05:05:24 am by k7g »

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
So, I guess it works? Great to know. I wanted to do a "command" mode, which would fire on trigger press, but Tygrys said it would be too complicated for him to do at the time. Besides, it should be possible to implement with some crafty modding and SEXPs.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: [ALPHA RELEASE]: Configurable Capship Command
It's actually surprisingly difficult. Fire-turret is one of those dream SEXPs we've wanted for a while, but it will require some work.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
Actually, my current idea is just to give a capship both turrets and primaries/secondaries, using gunpoint normals and autoaim to simulate turrets. This has both limitations and benefits. For example, it limits component space and forces secondaries to have ammo, on the other hand allows you to have ammo-limited weapons and allows you to manage that ammo. AI doesn't take kindly to that kind of setup though, FS definitely could use improvement in this area. That said, I think most of us can live without such a "command" mode. The script works well enough most things.

 
Re: [ALPHA RELEASE]: Configurable Capship Command
It's actually surprisingly difficult. Fire-turret is one of those dream SEXPs we've wanted for a while, but it will require some work.

Scripting has subsystem.fireWeapon though. 

Actually, my current idea is just to give a capship both turrets and primaries/secondaries, using gunpoint normals and autoaim to simulate turrets. This has both limitations and benefits. For example, it limits component space and forces secondaries to have ammo, on the other hand allows you to have ammo-limited weapons and allows you to manage that ammo. AI doesn't take kindly to that kind of setup though, FS definitely could use improvement in this area. That said, I think most of us can live without such a "command" mode. The script works well enough most things.

That would only work for single-parts, no?  Which I guess most main guns are anyway.  Correct me if I'm wrong, but don't turrets already support ammo limits?
« Last Edit: April 26, 2013, 01:22:56 pm by BlasterNT »

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
No, or at least they don't seem to. Limited ammo on turrets seemed to be in since retail, but IIRC, it never actually worked.

 
Re: [ALPHA RELEASE]: Configurable Capship Command
Hmm, interesting.  Well, if you wanted to make it player limited (which seems to be the best option, for AI's sake), it would be fairly simple to keep track in scripting, and also create a simple hud gauge to display what's left. 

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
However, I'd also like AI to have limited ammo, because I don't like when it when it obviously cheats. Also, it'd be very useful with the RTS script. Maybe it's the way to do it. If the RTS script could control weapon usage of AI ships, ammo management could be a nice gameplay mechanic.

 

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
Hay dragon,

due to i love this script so much  :P, i started editting the script abit (the non-configable areas  :nervous:), and i came up with this:

Modified turret Init function:
Code: [Select]
function turretInit(weapon, display, r, g, b, p, status)
csc.turretGroup[weapon] = {}
csc.turretMode[weapon] = {"Automatic", "Track", "Lock", "Offline"}
csc.turretStatus[weapon] = status
csc.turretColors[weapon] = {r, g, b, p}
csc.turretDisplay[weapon] = display
ba.print("CSC: Turret init " .. weapon .. "\n")
end;

And the modified turret init section with the new variable:
Code: [Select]
turretInit("pd", "point defense turrets: ", 61, 93, 255, 8, 4)
what this does, if u have not guessed already, it allows u to set the default status of a turret group when u start a mission. And the script still works 100%!  :lol:

so now u can have ur flak and AA-beams on auto; ur main beams on lock/offline; and ur turrets on track, all at once!

i would love it u would add this addition to ur script, to make it more user friendly and customizable.  :pimp:

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
I'll give it a try. Did you post everything you changed? Also, could you tell me into which line (by number) this goes?

 
Re: [ALPHA RELEASE]: Configurable Capship Command
presumably you replace the existing turretinit function (search for function turretinit), and the call for that function [search for turretinit("pd" ]

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
Well, I guess so. I'll soon give it a try.

 

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
hay dragon,

firstly, sry i was not clear on my previous post about the modifications, my bad  :banghead:.

secondly, i have saved the files into a .VP file for easy download/install. I have also include a modified deimos (just a view point and flag changes) and a GTD Segomo (based on the Inferno SOD Segomo, with a few extra turret/weapons) + a test mission for them to test they're weapons (the Segomo is fun to use in it  ;7), also it contains new weapons (they are there to allow the cap ships to be used in multi-player due to primary/secondary check...).

But before i uploaded to u, i'm asking for permission to upload it, so u can grab a copy and post it in your main thread if u wish.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: [ALPHA RELEASE]: Configurable Capship Command
I'd be glad to check it out. Note, however, that I'm going to be rather busy next week, don't worry if you don't get a quick response.

 

Offline k7g

  • 25
Re: [ALPHA RELEASE]: Configurable Capship Command
thats ok dragon, i'll upload the file on this post for u, and hopefully i can get started in learning lua so i can make my own script called C-ACS (Capital-Advanced Control System). Just allows control more control over a capital ship (such as repair systems  ;7, and alert levels etc.). Of course this will not replace your csc script, it will be made to go long side of it  :p

[attachment deleted by ninja]

 

Offline procdrone

  • Formerly TheHound
  • 29
  • Balance breaker! Thats me!
    • Skype
Re: [ALPHA RELEASE]: Configurable Capship Command
Hello.

I know there been some time as the topic is here, but I recently found myself to Freespace modding and wanted to integrate this command system into my WIP mod.

So, I'm getting problems with setting this one up, tried couple of things, none shown any change really...

Here is the part of my code for ship:

Code: [Select]
-- config stuff start
-- turret group, UI display, R, G, B, Brace padding

turretInit("lt", "Laser Turrets: ", 61, 93, 255, 8)
turretInit("aff", "Anti-Fighter Beams: ", 61, 93, 255, 8)
turretInit("flak", "Flak Cannons: ", 255, 93, 48, 11)
turretInit("beams", "Beam Cannons: ", 255, 187, 53, 14)
turretInit("missile", "Missiles: ", 255, 187, 53, 14)
end

function defineWeapons()
csc.weapondef = {}

--weaponClassName -> turret group

weaponInit("Terran Huge Turret", "lt")
weaponInit("AAAf", "aff")
weaponInit("Standard Flak", "flak")
weaponInit("Heavy Flak", "flak")
weaponInit("TerSlash", "beams")
weaponInit("Piranha", "missile")
end

function defineShips()
csc.shipdef = {}

local
--Arpyia
--Entry number - don't forget to change while copypasting this one
i = 1
csc.shipdef[i] = {}
csc.shipdef[i].shipClassName = "GTVFg Arpyia#Player"
--turrets showing target braces
csc.shipdef[i].turretTargets={"lt", "aff", "flak", "beams", "missile"}
--turrets aviable in UI
csc.shipdef[i].turretControl={"lt", "aff", "flak", "beams", "missile"}
--turrets to calculate target range
csc.shipdef[i].turretRange={"turret01", "turret02", "turret03", "turret04", "turret05",  "turret06", "turret07",  "turret08",  "turret09", "turret10", "turret11", "turret12", "turret13", "turret14", "turret15", "turret16", "turret17", "turret18", "turret19", "turret20", "turret21", "turret22", "turret23", "turret024"}
-- possible turret weapon groups:
-- {"lt", "aff", "flak", "beams", "missile"}


end
-- config stuff end

My problem is, that, only beams and flak turrets fire anyhow, rest i silent, nothing i do turns them on... Im able to change target for beam weapons, but I'm unable to turn them off, also, it seems that flak's follow the targeting of their own, and do not respond to my commands and, also cannot be turned off by the "off-line" state.

Is there a problem in my customization there?
--Did it! It's RELEASED! VeniceMirror Thread--