Ship Patching - Stage One


(HWRM Resurgence) #64

Did you add new hardpoints to ship file?

Because if you can rotate existing ones it sounds like you are missing something from ship file.


(ajlsunrise) #65

sigh

ship/sp_tanker/patches/patch.lua:

Patch_Priority = 3.0
Patch_Exclusive = 0
Patch_Ops = 
{
    hp_def = 
    {
        root = "Root",
        name = "NavLightR6",
        pos = { -132.7466, -14.2374, -240.2300 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_0 = 
    {
        root = "Root",
        name = "Hardpoint_Turret1_Position",
        pos = { 0, 17, 280 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_1 =
    {
        root = "Root",
        name = "Hardpoint_Turret2_Position",
        pos = { 0, 17, -207 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_20 =
    {
        root = "Root",
        name = "Hardpoint_Turret3_Position",
        pos = { 0, 17, -300 },
        rot = { rad(45), 3.141593, rad(180) },
        axis = { 0, 0, 0 },
    },
    hp_2 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft1_Position",
        pos = { 60, 13, -400 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_3 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft2_Position",
        pos = { 60, 13, -300 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_4 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft3_Position",
        pos = { 60, 13, -200 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_5 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft4_Position",
        pos = { 60, 13, -100 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_6 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft5_Position",
        pos = { 60, 13, 0 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_7 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft6_Position",
        pos = { 60, 13, 100 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_8 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft7_Position",
        pos = { 60, 13, 200 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_9 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft8_Position",
        pos = { 60, 13, 300 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_10 = 
    {
        root = "Root",
        name = "Hardpoint_TurretLeft9_Position",
        pos = { 60, 13, 400 },
        rot = { 0, rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_11 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight1_Position",
        pos = { -60, 13, -400 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_12 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight2_Position",
        pos = { -60, 13, -300 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_13 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight3_Position",
        pos = { -60, 13, -200 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_14 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight4_Position",
        pos = { -60, 13, -100 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_15 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight5_Position",
        pos = { -60, 13, 0 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_16 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight6_Position",
        pos = { -60, 13, 100 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_17 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight7_Position",
        pos = { -60, 13, 200 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_18 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight8_Position",
        pos = { -60, 13, 300 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_19 = 
    {
        root = "Root",
        name = "Hardpoint_TurretRight9_Position",
        pos = { -60, 13, 400 },
        rot = { 0, -rad(90), 0 },
        axis = { 0, 0, 0 },
    },
    hp_21 =
    {
        root = "Root",
        name = "Weapon_Torpedo1_Position",
        pos = { -7.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_22 =
    {
        root = "Root",
        name = "Weapon_Torpedo1Slave_Position",
        pos = { -22.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_23 =
    {
        root = "Root",
        name = "Weapon_Torpedo1Slave1_Position",
        pos = { -37.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_24 =
    {
        root = "Root",
        name = "Weapon_Torpedo1Slave2_Position",
        pos = { -52.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_25 =
    {
        root = "Root",
        name = "Weapon_Torpedo2_Position",
        pos = { 7.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_26 =
    {
        root = "Root",
        name = "Weapon_Torpedo2Slave_Position",
        pos = { 22.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_27 =
    {
        root = "Root",
        name = "Weapon_Torpedo2Slave1_Position",
        pos = { 37.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_28 =
    {
        root = "Root",
        name = "Weapon_Torpedo2Slave2_Position",
        pos = { 52.5, 3, 430 },
        rot = { 0, 0, 0 },
        axis = { 0, 0, 0 },
    },
    hp_29 =
    {
        root = "Root",
        name = "Weapon_HullDefense1_Position",
        pos = {73.39441, 3.002552, -264.4487},
        rot = { 0, rad(90), -0.48103232679489661923132169163975 },
        axis = { 0, 0, 0 },
    },
    hp_30 =
    {
        root = "Root",
        name = "Weapon_HullDefense2_Position",
        pos = {-73.88965, 5.299879, -264.7062},
        rot = { 0, -rad(90), 0.00904032679489661923132169163975 },
        axis = { 0, 0, 0 },
    },
}

print("rotx : " .. Patch_Ops["hp_20"]["rot"][1])
print("roty : " .. Patch_Ops["hp_20"]["rot"][2])
print("rotz : " .. Patch_Ops["hp_20"]["rot"][3])

(Comment out the hp_29 and hp_30 hardpoints to see the default rotation of those hardpoints.)

ship/sp_tanker/sp_tanker.ship:

NewShipType = StartShipConfig()
NewShipType.displayedName="$1900"
NewShipType.sobDescription="$1901"
NewShipType.maxhealth=1800000
NewShipType.regentime=0
NewShipType.minRegenTime=0
NewShipType.sideArmourDamage=1.2
NewShipType.rearArmourDamage=1.4
NewShipType.isTransferable=1
setTacticsMults(NewShipType, "DAMAGEAPPLIED", 0.90, 0.90, 0.90)
NewShipType.paradeData="dummy_parade"
NewShipType.defaultROE="Defensive"
NewShipType.defaultStance="Aggressive"
NewShipType.mass=1000
NewShipType.collisionMultiplier=1
NewShipType.thrusterMaxSpeed=40
NewShipType.mainEngineMaxSpeed=40
NewShipType.rotationMaxSpeed=9
NewShipType.thrusterAccelTime=6
NewShipType.thrusterBrakeTime=2
NewShipType.mainEngineAccelTime=6
NewShipType.mainEngineBrakeTime=2
NewShipType.rotationAccelTime=0.5
NewShipType.rotationBrakeTime=0.2
NewShipType.thrusterUsage=1
NewShipType.accelerationAngle=30
NewShipType.mirrorAngle=0
NewShipType.secondaryTurnAngle=0
NewShipType.maxBankingAmount=20
NewShipType.descendPitch=10
NewShipType.goalReachEpsilon=25
NewShipType.slideMoveRange=350
NewShipType.controllerType="Ship"
NewShipType.tumbleStaticX=0
NewShipType.tumbleStaticY=0
NewShipType.tumbleStaticZ=0
NewShipType.tumbleDynamicX=0
NewShipType.tumbleDynamicY=0
NewShipType.tumbleDynamicZ=0
NewShipType.tumbleSpecialDynamicX=0
NewShipType.tumbleSpecialDynamicY=0
NewShipType.tumbleSpecialDynamicZ=0
NewShipType.relativeMoveFactor=2
NewShipType.swayUpdateTime=2
NewShipType.swayOffsetRandomX=10
NewShipType.swayOffsetRandomY=10
NewShipType.swayOffsetRandomZ=10
NewShipType.swayBobbingFactor=0
NewShipType.swayRotateFactor=0
setTargetBox(NewShipType, 0, -0.8,-0.7,-1, 0.8,0.5,0.95)
NewShipType.dustCloudDamageTime=0
NewShipType.nebulaDamageTime=0
NewShipType.MinimalFamilyToFindPathAround="MotherShip"
NewShipType.BuildFamily="NotBuildable"
NewShipType.AttackFamily="BigCapitalShip"
NewShipType.DockFamily="Transport"
NewShipType.AvoidanceFamily="Frigate"
NewShipType.DisplayFamily="Utility"
NewShipType.AutoFormationFamily="Fighter"
NewShipType.CollisionFamily="Big"
NewShipType.ArmourFamily=getShipStr(NewShipType, "ArmourFamily", "MediumArmour")
setSupplyValue(NewShipType, "SinglePlayerMisc", 1.0)
NewShipType.fighterValue=0
NewShipType.corvetteValue=0
NewShipType.frigateValue=0
NewShipType.neutralValue=0
NewShipType.antiFighterValue=0
NewShipType.antiCorvetteValue=0
NewShipType.antiFrigateValue=0
NewShipType.totalValue=0
NewShipType.buildCost=480
NewShipType.buildTime=30
NewShipType.buildPriorityOrder=20
NewShipType.retaliationRange=1600
NewShipType.retaliationDistanceFromGoal=160
NewShipType.visualRange=3000
NewShipType.prmSensorRange=3000
NewShipType.secSensorRange=3000
NewShipType.detectionStrength=1
NewShipType.TOIcon="Parallelogram"
NewShipType.TOScale=1
NewShipType.TODistanceFade0=14000
NewShipType.TODistanceDisappear0=12000
NewShipType.TODistanceFade1=5500
NewShipType.TODistanceDisappear1=5000
NewShipType.TODistanceFade2=12000
NewShipType.TODistanceDisappear2=35000
NewShipType.TOGroupScale=1
NewShipType.TOGroupMergeSize=0
NewShipType.mouseOverMinFadeSize=0.045
NewShipType.mouseOverMaxFadeSize=0.1
NewShipType.healthBarStyle=2
NewShipType.nlips=0
NewShipType.nlipsRange=75000
NewShipType.nlipsFar=0
NewShipType.nlipsFarRange=0
NewShipType.SMRepresentation="Mesh"
NewShipType.meshRenderLimit=25000
NewShipType.dotRenderLimit=10
NewShipType.visibleInSecondary=1
NewShipType.minLOD=0.25
NewShipType.goblinsStartFade=3500
NewShipType.goblinsOff=3500
NewShipType.minimumZoomFactor=0.5
NewShipType.preciseATILimit=0
NewShipType.selectionPriority=65
NewShipType.militaryUnit=0
NewShipType.SMHighlightDistMin=20000
NewShipType.SMHighlightDistMax=25000
addAbility(NewShipType,"MoveCommand",1,0);
addAbility(NewShipType,"CanDock",1,0);
NewShipType.dockTimeBetweenTwoFormations=1
NewShipType.dockTimeBeforeStart=2
NewShipType.dockNrOfShipsInDockFormation=1
NewShipType.dockFormation="delta"
NewShipType.queueFormation="dockline"
NewShipType.dontDockWithOtherRaceShips=0
NewShipType.ignoreRaceWhenDocking=1
addAbility(NewShipType,"CanLaunch");
NewShipType.launchTimeBetweenTwoFormations=1
NewShipType.launchTimeBeforeStart=1
NewShipType.launchNrOfShipsInDockFormation=1
NewShipType.launchFormation="delta"
addAbility(NewShipType,"ShipHold",1,150,0,"rallypoint","",150);
addAbility(NewShipType,"ParadeCommand",1);
addAbility(NewShipType,"WaypointMove");
addAbility(NewShipType,"HyperSpaceCommand",1,1,1,1,1,1);
addAbility(NewShipType,"CanAttack",1,1,0,0,0.35,1,"Fighter, Corvette, Frigate, SmallCapitalShip, BigCapitalShip, Mothership","Broadside");
NewShipType.active=1
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3);
LoadModel(NewShipType,1);
-- StartShipWeaponConfig(NewShipType,"Hgn_MSHullDefenseGun","Weapon_HullDefense1","Weapon_HullDefense1");
-- StartShipWeaponConfig(NewShipType,"Hgn_TransportHullDefenseGun","Weapon_HullDefense2","Weapon_HullDefense2");

StartShipHardPointConfig(NewShipType,"Weapon_HullDefense1","Weapon_HullDefense1","Weapon","Innate","Ship","hgn_pulsar","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_HullDefense2","Weapon_HullDefense2","Weapon","Innate","Ship","hgn_pulsar","","","","","","","","");

StartShipWeaponConfig(NewShipType,"hgn_destroyertorpedolauncher","Weapon_Torpedo1","Weapon_Torpedo1");
StartShipWeaponConfig(NewShipType,"hgn_destroyertorpedolauncher","Weapon_Torpedo2","Weapon_Torpedo2");

StartShipHardPointConfig(NewShipType,"Weapon IonBeam 1","Hardpoint_Turret1","Weapon","Innate","Damageable","Hgn_BattleCruiserIonBeamTurret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon IonBeam 2","Hardpoint_Turret2","Weapon","Innate","Damageable","Hgn_BattleCruiserIonBeamTurret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon IonBeam 3","Hardpoint_Turret3","Weapon","Innate","Damageable","Hgn_BattleCruiserIonBeamTurret","","","","","","","","");

StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft1","Hardpoint_TurretLeft1","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft2","Hardpoint_TurretLeft2","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft3","Hardpoint_TurretLeft3","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft4","Hardpoint_TurretLeft4","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft5","Hardpoint_TurretLeft5","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft6","Hardpoint_TurretLeft6","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft7","Hardpoint_TurretLeft7","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft8","Hardpoint_TurretLeft8","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretLeft9","Hardpoint_TurretLeft9","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight1","Hardpoint_TurretRight1","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight2","Hardpoint_TurretRight2","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight3","Hardpoint_TurretRight3","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight4","Hardpoint_TurretRight4","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight5","Hardpoint_TurretRight5","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight6","Hardpoint_TurretRight6","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight7","Hardpoint_TurretRight7","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight8","Hardpoint_TurretRight8","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Weapon_TurretRight9","Hardpoint_TurretRight9","Weapon","Innate","Ship","hgn_vulcankineticturretheavy","","","","","","","","");



NewShipType.battleScarCoverage=4
NewShipType.battleScarBudgetLow = 800
NewShipType.battleScarBudgetNext = 1200
NewShipType.sobDieTime=3.6
NewShipType.sobSpecialDieTime=3.6
NewShipType.specialDeathSpeed=40
NewShipType.chanceOfSpecialDeath=0
NewShipType.deadSobFadeTime=0
NewShipType.trailLinger=3
NewShipType.canSurround=1
NewShipType.canJoinStrikeGroup=0
setEngineGlow(NewShipType,1,1,1.02,20,300,50,1.5,{0.27, 0.47, .69, 0.25});
loadShipPatchList(NewShipType,"data:sound/sfx/ship/misc/",0,"Engines/CCivilianEng","marker6",1,"Ambience/CKundeTankerAmb","");

hwrm.log output:

rotx : 0.7853981633974483
roty : 3.141593
rotz : 3.141592653589793

Note that none of the side turrets are rotated, the back ion cannon is not rotated, but the the pulsar turret is rotated.


(Taiidan Republic Mod) #66

I don’t get it

EDIT: does this show that rotation ONLY works when editing existing hardpoints?


(HWRM Resurgence) #67

No because rotation works fine for me

Even my hiigaran destroyer has some 90 degree angled custom turrets at it’s hull


(ajlsunrise) #68

For me and @gthompsn, apparently that is the case. For @unifin, not so much.

I’m just demonstrating my lack of ability to get hardpoint rotation to work, while @unifin and @sastrei showcase their mad skillz.

And as a side note: This patching system really pissing me off; how it works for some people, and in some cases, but not universally. This is likely going to be yet another reason why I refuse to touch any post-patch HODs (with the exception of the default joint positions I yanked from the files). However, this may piss me off enough to get my hands dirty (or more dirty, i suppose).


Has anyone else actually tried my code to see if it works on their system?


(Sastrei) #69

@radar3301 I did some more tests based on @unifin’s findings, here’s what a negative 180 rotation looks like:

rot = { 0, 0, -3.141 },

using regular angle values will give unpredictable results, but you can also use

rot = { 0, 0, rad(-180) },

Patch_Priority = 3.0
Patch_Exclusive = 0
Patch_Ops = {
hp_1 = {
    root = "Root",
    name = "Hardpoint_Af1_Position",

	--WIDTH(x) HEIGHT(y) LENGHT(z)
	--In Blender 3D lenght(z) is (y) and it is inversed.

    pos = { 20, 20, 20 },

	--RADIANS Z is inversed in Blender.
	-- 3.141R = 180D
	-- 1.570R = 90D
--x,y,z
	rot = {  0, 0, -3.141 },
    axis = { 0, 0, 0 },

    subs = {
        hp_2 = {
            root    = "Hardpoint_Af1_Position",
            name    = "Hardpoint_Af1_Rest",
            pos        = { 0, 0, 10 },
            rot        = { 0, 0, 0 },
            axis    = { 0, 0, 0 },
        },
        hp_3 = {
            root    = "Hardpoint_Af1_Position",
            name    = "Hardpoint_Af1_Direction",
            pos        = { 0, 10, 0 },
            rot        = { 0, 0, 0 },
            axis    = { 0, 0, 0 },
        },
    },
},
}

(Liuruoyang1995=Lone Wolf Akela) #70

Try adding Hardpoint_*_Direction and Hardpoint_*_Rest as sub points of Hardpoint_*_Position.
Without Direction and Rest points, rotation won’t work. I think that’s why you can effect rotation changes to pre-existing hardpoints, because they have their Direction and Rest points


(Gregorymthompso1) #71

i had noticed that and made the fix when i first copied your code. in fact, since i don’t have hgn_pds_turret i used the assault frigate turret insetead in the battlecruise .ship file.

it still doesn’t work for me.


(Gregorymthompso1) #72

that isnt SUPPSED to be needed since the 2.1 patch. @BitVenom said he addressed a long-standing HW2 bug where default values were horribly messed up.

the fact is, even when i use the _rest and _direction points, it still doesn’t work for me.


(HWRM Resurgence) #73

Hmm… try to put whole subsystem folder with all contents into data folder and see if it works then.

Anyways here is part my hiigaran destroyer code

Ship file
> StartShipHardPointConfig(NewShipType,“Hardpoint_Pds1Plat”,“Hardpoint_Pds1”,“Weapon”,“Innate”,“Damageable”,“hgn_pds_turret”,"","","","","","","","");

StartShipHardPointConfig(NewShipType,"Hardpoint_Pds2Plat","Hardpoint_Pds2","Weapon","Innate","Damageable","hgn_pds_turret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_Pds3Plat","Hardpoint_Pds3","Weapon","Innate","Damageable","hgn_pds_turret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_Pds4Plat","Hardpoint_Pds4","Weapon","Innate","Damageable","hgn_pds_turret","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_MainTurret1","Hardpoint_MainTurret1","Weapon","Innate","Damageable","hgn_kineticburstcannondestroyer","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_MainTurret2","Hardpoint_MainTurret2","Weapon","Innate","Damageable","hgn_kineticburstcannondestroyer","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_MainTurret3","Hardpoint_MainTurret3","Weapon","Innate","Damageable","hgn_kineticburstcannondestroyer","","","","","","","","");
StartShipHardPointConfig(NewShipType,"Hardpoint_MainTurret4","Hardpoint_MainTurret4","Weapon","Innate","Damageable","hgn_kineticburstcannondestroyer","","","","","","","","");

Then patch code

Patch_Priority = 3.0
Patch_Exclusive = 0
Patch_Ops = {
		hp_1 = {
        root    = "Root",
        name    = "Hardpoint_Pds1_Position",
        pos        = { 13.71898, -11.21929, 164.92462 },
	    --RADIANS Z is inversed in Blender.
		-- 3.141R = 180D
		-- 1.570R = 90D
        rot        = { 0, 0, -1.57 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_2 = {
                root    = "Hardpoint_Pds1_Position",
                name    = "Hardpoint_Pds1t_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_3 = {
                root    = "Hardpoint_Pds1_Position",
                name    = "Hardpoint_Pds1_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
		hp_4 = {
        root    = "Root",
        name    = "Hardpoint_Pds2_Position",
                   --WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { -13.71898, -11.21929, 164.92462 },
        rot        = { 0, 0, 1.57 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_5 = {
                root    = "Hardpoint_Pds2_Position",
                name    = "Hardpoint_Pds2_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_6 = {
                root    = "Hardpoint_Pds2_Position",
                name    = "Hardpoint_Pds2_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
		hp_7 = {
        root    = "Root",
        name    = "Hardpoint_Pds3_Position",
		--WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { 0.0, 24.41089, -148.25975 },
        rot        = { 0, 0, 0 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_8 = {
                root    = "Hardpoint_Pds3_Position",
                name    = "Hardpoint_Pds3_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_9 = {
                root    = "Hardpoint_Pds3_Position",
                name    = "Hardpoint_Pds3_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
		hp_10 = {
        root    = "Root",
        name    = "Hardpoint_Pds4_Position",
		--WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { 0.0, -38.81344, -75.1209 },
		--RADIANS
        rot        = { 0, 0, 3.141 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_11 = {
                root    = "Hardpoint_Pds4_Position",
                name    = "Hardpoint_Pds4_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_12 = {
                root    = "Hardpoint_Pds4_Position",
                name    = "Hardpoint_Pds4_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
				
		hp_11 = {
        root    = "Root",
        name    = "Hardpoint_MainTurret1_Position",
                   --WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { -0.595, 31.589, -3.212 },
        rot        = { 0, 0, 0 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_12 = {
                root    = "Hardpoint_MainTurret1_Position",
                name    = "Hardpoint_MainTurret1_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_13 = {
                root    = "Hardpoint_MainTurret1_Position",
                name    = "Hardpoint_MainTurret1_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
						
		hp_14 = {
        root    = "Root",
        name    = "Hardpoint_MainTurret2_Position",
                   --WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { -0.808, 26.57391, 169.87996 },
        rot        = { 0, 0, 0 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_15 = {
                root    = "Hardpoint_MainTurret2_Position",
                name    = "Hardpoint_MainTurret2_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_16 = {
                root    = "Hardpoint_MainTurret2_Position",
                name    = "Hardpoint_MainTurret2_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
								
		hp_17 = {
        root    = "Root",
        name    = "Hardpoint_MainTurret3_Position",
                   --WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { 0.184, 26.59667, -77.16655 },
        rot        = { 0, 3.141, 0 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_18 = {
                root    = "Hardpoint_MainTurret3_Position",
                name    = "Hardpoint_MainTurret3_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_19 = {
                root    = "Hardpoint_MainTurret3_Position",
                name    = "Hardpoint_MainTurret3_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
		
										
		hp_20 = {
        root    = "Root",
        name    = "Hardpoint_MainTurret4_Position",
                   --WIDTH(x) HEIGHT(y) LENGHT(z)
        pos        = { 4.92, -40.38963, 63.8262 },
        rot        = { 0, 0, 3.141 },
        axis    = { 0, 0, 0 },
		subs = {
				hp_21 = {
                root    = "Hardpoint_MainTurret4_Position",
                name    = "Hardpoint_MainTurret4_Rest",
                pos        = { 0, 0, 10 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
				hp_22 = {
                root    = "Hardpoint_MainTurret4_Position",
                name    = "Hardpoint_MainTurret4_Direction",
                pos        = { 0, 10, 0 },
                rot        = { 0, 0, 0 },
                axis       = { 0, 0, 0 },
				},
			},			
		},
        }

(ajlsunrise) #74

@gthompsn: I can confirm the subs syntax works in v2.205, but not in 2.1. And that the _Rest and _Direction nodes have to be nested in the subs table inside the _Position joint.


(Gregorymthompso1) #75

thx, but i tried it that way using ubifin’s example. i don’t get an error message in the log, but nothing happens either.

i don’t get why the code works for others but not me


(ajlsunrise) #76

Do you have version 2.1?


(Gregorymthompso1) #77

no, v2.205


(ajlsunrise) #78

Working example:

If that doesn’t work for you, then I don’t know what’s going on.


(Gregorymthompso1) #79

thanks everyone for your help, esp ajlsunrise i am now able to keep moving forward even if it is more slowly than i would like…


(ajlsunrise) #80

So, did it work? :wink:


(Gregorymthompso1) #81

yes.R/L has been wearing me out (i have a one week old son and am in the process of a job change) so it took me a lot longer to get to it than i would like.


(ajlsunrise) #82

Congratulations on all fronts!


(Gregorymthompso1) #83

Thanks. Here is what I was ultimately hoping to do. I really like both the der_heavycruiser and der_carriernew. The modelers at Gearbox did such a fantastic job on those and other models. I was disappointed that ship patching doesn’t include docpaths, but was hoping I would be able to get them to be playable units. I was experimenting wth the sp_tanker to try to just get some simple stuff done.

I think I might have a way to work around the dockpaths issue. Basically, I would build a ship from a copy of the hgn_probe that would have modified stats so it can move like I want the game ship to move but it would only have a single point of damage. The der_heavycruiser and der_carriernew would then be a “subsystem” of that ship.

I don’t know anything about modelling or texturing, but I had been hoping I would be able to use the patching system to add dock paths, hulldefense hardpoints, capture hardpoints, repair hardpoints and engine glows (if I can find ones animations that are linked to individual thruster exhaust nozzles). Those dockpaths, etc would be positioned so they would work for the derelict HOD that they are to be associated with.

The thing I have no idea how to do is to get the primary and secondary turrets of the cruiser to work. If the people at Gearbox have already created joints and all the stuff needed to make the turrets work, I’m in business but if, as I suspect, the turrets are all a single piece with the maind HOD then I’m stuck.

Any suggestions?