LyonRailStation
I am trying to get the relic encounter missions to work, I added the map to the normandy campaign, it loads fine (thank god) and works, the first thing it does is focuses the camera on 3 small riflemen squads, then to the railroad and I think it is then supposed to return to default view but get's a SCAR error. I will show the code in which the error occurs.
Code:
function LyonRail_MissionStart()
Util_AutoNISlet(NISLET_BLACK2GAME, t_LyonRail.nislet_railStart)
-- delay initial troop movement
Rule_AddOneShot(LyonRail_MissionStart_DelayMove, 5)
end
The error is coming from the delay move function.
Code:
function LyonRail_MissionStart_DelayMove()
-- move squads
local moveto = {0, 1, 7}
for i = 1, 3 do
Cmd_MoveToPosOffset(sg_rail01_p1Starters[i], Marker_GetPosition(mkr_rail01_playerstart), moveto[i], World_GetRand(7, 9))
end
-- delay first objective
Rule_Add(LyonRail_DelayCapStation)
Apparently the error is something to do with the Cmd_MoveToOffsetPos bit, which I am not sure as to whether it is correct or not.
It links it to sg_rail01_p1Starters which is found in the mission_presets function. And to the marker mkr_rail01_playerstart which matches the one on the map.
Code:
function LyonRail_MissionPreset()
sg_rail01_p1Starters = SGroup_CreateTable("sg_rail01_p1Starters%d", 3)
sg_rail01_p1All = SGroup_CreateIfNotFound("sg_rail01_p1All")
sg_snipe01_p2All = SGroup_CreateIfNotFound("sg_snipe01_p2All")
eg_snipe01_p2All = EGroup_CreateIfNotFound("eg_snipe01_p2All")
-- create the temperary starting units for player 1
for i = 1, 3 do
Util_CreateSquadsAtMarkerFacing(player1, sg_rail01_p1Starters[i], SBP.ALLIES.RIFLEMEN, mkr_rail01_playerstart, mkr_rail01_hmgfirepoint, 1, World_GetRand(4, 5))
SGroup_AddGroup(sg_rail01_p1All, sg_rail01_p1Starters[i])
end
t_LyonRail = {
pos_rail02_axTank01 = false,
}
local pos1 = EGroup_GetPosition(eg_rail01_playergoal)
local pos2 = Marker_GetPosition(mkr_rail01_playerstart)
t_LyonRail.nislet_railStart = {
{camPos = pos1, waitType = NISLET_TIME, waitValue = 5},
{camPos = pos2, waitType = NISLET_TIME, waitValue = 3},
}
local posA = EGroup_GetPosition(eg_snipe01_playerhouse)
local posB = Marker_GetPosition(mkr_snipe01_bridge)
local posC = Marker_GetPosition(mkr_snipe01_mine02)
t_LyonRail.nislet_sniperStart = {
{camPos = posA, waitType = NISLET_TIME, waitValue = 3},
{camPos = posB, waitType = NISLET_TIME, waitValue = 3},
{camPos = posC, waitType = NISLET_TIME, waitValue = 3},
{camPos = posB, waitType = NISLET_TIME, waitValue = 2},
}
local posG = Marker_GetPosition(mkr_hold01_hq)
local posH = Marker_GetPosition(mkr_snipe01_bridge)
t_LyonRail.nislet_holdStart = {
{camPos = posG, waitType = NISLET_TIME, waitValue = 3},
{camPos = posH, waitType = NISLET_TIME, waitValue = 3},
{camPos = posG, waitType = NISLET_TIME, waitValue = 3},
}
-- if areas of your script need to be kicked off early
CapStation_Init()
CapStation_Preset()
--EncounterName_Init()
-- despawn preplaced units - NO TEAM WEAPONS
if SGroup_IsEmpty(sg_rail02_axTank01) == false then
t_LyonRail.pos_rail02_axTank01 = SGroup_GetPosition(sg_rail02_axTank01)
SGroup_DeSpawn(sg_rail02_axTank01)
end
-- despawn preplaced egroups
local egroups = {eg_snipe01_opelAll, eg_snipe01_pakAll, eg_hold01_hq, eg_hold01_point}
for k, v in pairs(egroups) do
EGroup_DeSpawn(v)
end
end
I figured that if there was anywhere to get help it would be from here. I tried editing a couple things which I thought might of been causing the errors but just got more errors :P
I'm used to reading Sando's type of code, Relic's coders seem to use a different style I suppose. It is hard trying to read someone else's code when your'e as bad at coding as me!