So here is the example I write for our team. I’ve translated those comments into English.
-------------------------------------------------------------
------patch001.lua-------2016/6/9---------
--By 9CCNMOD Team Lone_wolf
--Add three hardpoints to hgn_minelayercorvette for FXMOD hgn_multiguncorvette
-------------------------------------------------------------
-------------------------------------------------------------
Pi=3.1415927 --Patch file use radians, so we set a Pi here
Patch_Priority = 3.0 --Priority
Patch_Exclusive = 0 --not really useful for us
Patch_Ops = --add hardpoints in this table
{
hp_0 = --hardpoint uses"hp_"+num as their names
{
root = "Root", --these values should be easy to understand
name = "Hardpoint_TurretTop_Position",
pos = { 0.0, 6.2082, -3.627227 },
rot = { 0.0, 0.0, 0.0 },
axis = { 0.0, 0.0, 0.0 },
},
--notice that after this update, we do not need Rest and Direction if the position doesn't need rot.
--but if we need to use rot for the Position point, it seems that we still have to set up the Rest and Direction point
--so here we only omit Rest and Direction for the point for the turret at the top of the ship
-----------------------------------------
hp_1 =
{
root = "Root",
name = "Hardpoint_TurretLeft_Position",
pos = { 8.212759, 3.735897,-12.44839 },
rot = { 0.0, 0, -16.779*Pi/180}, --attention, radians here
axis = { 0.0, 0.0, 0.0 },
},
hp_4 = --Pay attention to this number. I've found that it seems
--numbers of "Child Points" like Position and Rest must bigger than all those
--"Upper Points", so I use hp_4 instead of hp_2 here
{
root = "Hardpoint_TurretLeft_Position",
name = "Hardpoint_TurretLeft_Rest",
pos = { 0, 0, 10 },
rot = { 0.0, 0.0, 0},
axis = { 0.0, 0.0,0},
},
hp_5 =
{
root = "Hardpoint_TurretLeft_Position",
name = "Hardpoint_TurretLeft_Direction",
pos = { 0, 10, 0 },
rot = { 0.0, 0.0, 0},
axis = { 0.0, 0.0,0},
},
---------------------------------------------
hp_2 =
{
root = "Root",
name = "Hardpoint_TurretRight_Position",
pos = { -8.213, 3.736, -12.448 },
rot = { 0.0, 0.0, 16.779*Pi/180},
axis = { 0.0, 0.0,0},
},
hp_6 =
{
root = "Hardpoint_TurretRight_Position",
name = "Hardpoint_TurretRight_Rest",
pos = { 0, 0, 10 },
rot = { 0.0, 0.0, 0},
axis = { 0.0, 0.0,0},
},
hp_7 =
{
root = "Hardpoint_TurretRight_Position",
name = "Hardpoint_TurretRight_Direction",
pos = { 0, 10, 0 },
rot = { 0.0, 0.0, 0},
axis = { 0.0, 0.0,0},
},
---------------------------------
hp_3 = --and I have to add a point that already exist in the HOD
--to make all my patch work take effect
{
root = "Root",
name = "Hardpoint_TurretBottom_Position",
pos = { 0.0, -4.1154, 0.3430557 },
rot = { 0.0, 0, Pi},
axis = { 0.0, 0.0, 0.0 },
},
}