S5SS / dual-command

Dual Command Mode Repository
3 stars 2 forks source link

custom code organization #26

Closed Novaras closed 5 years ago

Novaras commented 5 years ago

perhaps ships should call some sort of library file instead of their own scripts

im adding the same function to quite a few ships here:

addCustomCode(NewShipType, "data:ship/hgn_attackbomber/hgn_attackbomber.lua", "", "", "Update_Hgn_AttackBomber", "", 1)

dofilepath("data:scripts/ult_underattackreissuedock.lua")

function Update_Hgn_AttackBomber(CustomGroup, playerIndex, shipID)
    Ult_UnderAttackReissueDock(CustomGroup)
end

addCustomCode(NewShipType, "data:ship/hgn_interceptor/hgn_interceptorlua", "", "", "Update_Hgn_Interceptor", "", 1)

dofilepath("data:scripts/ult_underattackreissuedock.lua")

function Update_Hgn_Interceptor(CustomGroup, playerIndex, shipID)
    Ult_UnderAttackReissueDock(CustomGroup)
end

perhaps we can just call one file: addCustomCode(NewShipType, "data:scripts/ult_lib.lua", "", "", "Update_Hgn_AttackBomber", "", 1) or even addCustomCode(NewShipType, "data:scripts/ult_lib.lua", "", "", "Fighter_Fixes", "", 1) etc

S5SS commented 5 years ago

Ahh this is what I have on the ssss branch actually, the file is scripts/PlayersPatch_patches.lua I've moved the salvette fix into there and Ive been experimenting on a fix for hyperspacing in gravwells.