FreeSpace Releases > Scripting Releases

[Release] CSC V3

(1/1)

The_Force:
Ever Played The Blade Itself and found the controls clunky? Ever Wanted to make your own capship mission but found the script too intimidating? If the answer to any of these questions is yes then Good News!

CSC V3 Has been releasedAvalible either here ****Pending**** or attached below
This is a complete rewrite of the CSC script included in BP. The main upgrades offered by this version over the previous are,

* A new graphical UI powered by AXUI
* Mouse Control
* An external config file -- no more messing with the script needed to add ships
* Fully customisable turret groups
Playing

For the player the scripts functionality is almost identical to the previous version. Holding down `Alt` frees the mouse which lets the player click on the buttons next to the Weapons setting there Mode, The 4 modes are from left to right,

* Auto - Turret is under AI Control.
* Track - Turret will shoot at the players target.
* Lock - Turret will continue to shoot at current target even if targeting in changed.
* Offline - Turret will not shoot.
By using the buttons next to the group Name the player can set targeting parameters for the whole group.

Modding

Requirements
Latest AXBase from the FSO-Script Repository
FSO 23.0+

Config
Ships are defined in csc.cfg in the mods config folder. Ships are retrived by there name in the Ships.tbl or tbms, if the ship is not present the script will error.

Inside the ship definiton is the WeaponGroups section, a group is a JSON Object. the id of the object doesn't matter hear so long as it is unique in this ship and recognizable to you.
The first option for the group is Name which will be the groups display name on the UI so try to make it informative to the player.
Colour Contains the RGBA value which is used for the group on the UI and brackets.
Turrets An array the list of turrets in to be added to the group. Should use the Subsystem name from the table. Script will error if a turret is present in this list and not the model.
PlayerControl A boolean, if true the group will appear in the UI and be under player control. If false the group will not appear in the UI but will still show targeting brackets of the groups colour
NoIndividual Don't show individual turrets in group.

Exmple

--- Code: --- "UEFg Karuna#Player": {
    "WeaponGroups": {
      "front": {
        "Name": "Front Weapons",
        "Colour": {
255,
93,
48,
255
}
        "Turrets": [ "turret01", "turret02", "turret03", "turret04", "Turret52", "Turret53"],
"PlayerControl": true
      },
"rear": {
        "Name": "Rear Weapons",
        "Colour": {
255,
187,
53,
255
}
        "Turrets": [ "turret05"],
"PlayerControl": true
      },
"torpedoes": {
        "Name": "Torpedoes",
        "Colour": {
255,
255,
53,
255
}
        "Turrets": [ "turret32", "turret36", "turret37" ],
"PlayerControl": true
      },
"pd": {
        "Name": "Point Defense",
        "Colour": {
61,
93,
255,
255
}
        "Turrets": [ "turret28","turret29","turret30","turret31","turret35", "turret38","turret39","turret40", "turret41", "turret42", "turret43", "turret43","turret44","turret45","turret46","turret47","turret48","turret49","turret50","turret51"],
"PlayerControl": false
      }
    }
  }
--- End code ---

Script
In the script file there are only two real options. In the CSCUI:Init() function of cscui-sct.tbm there are self.startX and self.startY which can be used to adjust the UI's position.

Interface
In here are the files used by the UI they should be 64x64 image files.

* `*.dds` The base image for the button
* `*hover.dds` The image for the button when it is hovered over.
* `*filled.dds` The image for the button when it is active.
Misson
Enable CSC with the toggle-CSC sexp
Show/Hide the UI with the hide-csc sexp

Changelog

* V3.0.1 - Add test mission, fix bug with Weapon name display, add noIndividual Option
* V3 - Complete Rewrite. Add AXUI and external Config file
* V2 - Dragon's Release - see https://www.hard-light.net/forums/index.php?topic=80373.0
* V1 - Orginal BP
ToDo

* Better Interface Images
* Abilities System
* Re add Keyboard Control
Copyright
No paticular license you are free to distribute and modify however you please just please credit Me(TheForce172), Dragon, and the orginal BP Team.
If you do make something with this do please message me as I would like to see what you've made!
Enjoy!

wookieejedi:
Wow, quite an undertaking and really fantastic update. Thank you for your work and sharing it!  :)

Navigation

[0] Message Index

Go to full version