[Question] Linking special attack to energy reserve

Hi All,

Has anyone linked a visible special attack like the repair beams to an energy reserve before? We were thinking of ways to rationalise the magical repair beams for the Star Trek universe and simply calling them shield energy transfers is what was settled on. This would be more convincing with a limited store of energy that can be transferred from the repair ship so I was wondering if anyone had touched on this before :slight_smile:


1 Like

Hmm… let me check, cause I think you’d have to make the repair weapon a special ability that activates the normal repair behavior.

You will have to make a new CustomCommand, I think. Look at the Kushan and Taiidan Gravwell generators. Perhaps @BitVenom can explain how that line works?

Specifically, this line:

I shortened it up to make it easy on the eyes.

Sorry I can’t be much help here, I’ll experiment a little and try to figure out what each number does, but this really needs to be updated on the Hw wiki sites and such, cause I can’t information on it.

1 Like

Here are two links that help, but I don’t know enough about creating or editing ship luas to enable a weapon or not.

CustomCommand Demystified!..mostly…sorta

Custom Code Examination

1 Like

Thanks for that @CryCoh, I didn’t think of the custom command as an option for that… that’s a lot to digest but opens up an interesting possibility!

The KUS and TAI repair corvettes have this line in them:


The *.lua file indicated has this in it:

function Create_Kus_RepairCorvette(CustomGroup, playerIndex, shipID)

function Update_Kus_RepairCorvette(CustomGroup, playerIndex, shipID)
if Player_GetLevelOfDifficulty(playerIndex) > 0 then
SobGroup_AbilityActivate(CustomGroup, AB_Targeting, 0)
SobGroup_AbilityActivate(CustomGroup, AB_Attack, 0)
SobGroup_RepairSobGroup(CustomGroup, “Player_Ships”…SobGroup_OwnedBy(CustomGroup))

function Destroy_Kus_RepairCorvette(CustomGroup, playerIndex, shipID)


  1. Custom script execution without a command explicitly needed to execute it
  2. Auto-{insert action here} ships!

Unfortunately, just a simple copy and paste didn’t result in any auto-repairing… So I am going to be bashing on this for a while given my basic LUA, but it’s an excellent lead thank you :slight_smile:

Looks like you can be pretty free with the code in there!

SETUP >> | Setting Federation build options to TNG
CONSTRUCTION >> | Player 1 has built a fed_TNG_resourcecollector
Player 0 has lost a fed_TNG_repairship with ship ID 1536
CONSTRUCTION >> | Player 1 has built a fed_TNG_peregrine
Player 1 has lost a fed_TNG_repairship with ship ID 3056
Restoring video mode

Interestingly, the second ship listed was “destroyed” by the game ending

//Double edit
Taking the SobGroup_* lines out of the if statement got it working! :smiley:

Now back to figuring out my original question :no_mouth:

Let me know if you need any help with the custom command codes. I’ve worked pretty extensively with them.


The AddCustomCode points to a lua for specified behaviors and such, while the CustomCommand brings up the ui button and special ability.You can create your own ui icons as well, or reuse the ones in game (I’m new to particular part).

@radar3301, can multiple CustomCommand be used, each to a specific weapon?

1 Like

I am not sure on that, I’ve only experimented with one at a time (never really had the need/want to try more than one). I don’t think you can apply custom code to weapons though.

EDIT: No, you can’t have more than one.

Ah, okay.

Another thought, can a ship have multiple special attacks? And if so, how does one change the active time and cool-down time of a custom special attack?

1 Like

I think you’re mixing up special attack and special abilities?

In any case, if it’s an ability added by CustomCommand/addCustomCode, that’s defined by your script.

If it’s defined in a weapon, there technically is no active time other than how long the weapon FX lasts, and the cool-down time is the fire delay time.

I can’t really go into more specifics without having more detail… :confused:

Perhaps I didn’t word my question right.

For now, I’ll be messing around with weapons and I’ll chime back in when I run into issues, if any.

1 Like