Jump to content

Increased soldier population WIP mod


mxmstr

Recommended Posts

I don't know programming stuff, so this is very hard to me, i just edit your work, i can't do anything without your help, thanks again...

 

Now i'm already removed some soldier from data list, most of the large CP got around 20~25 soldier. I found that the soldier won't spawn after the line 376 of data list...

 

Now the problem is some area got 3 or more soldier stand together at the same location, i have to figure out how to spread them. Some sentry guard are missing, maybe is because i remove it?

 

Is possible to increase soldier for main story/side mission? It would be nice if this is possible. Free roam feel a little bit boring because you have no mission objective to complete.

Link to comment
Share on other sites

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

If you find guards standing in the middle of the base that means they either haven't been assigned a patrol route or I mistakenly assigned them a route that doesn't exist. By default, if you assign soldiers to a CP and there are more than 12, the game will just place the extra soldiers at their default position since there aren't any paths left to assign them to. So I added the this.setRoute_CPName functions at the bottom of the _enemy.lua file in order to assign those extra soldiers to paths. It's kind of trial and error to figure out where each path actually takes the assigned soldier. All I've figured out is that, when looking at the route name, "d" means day, "n" means night, "c" means caution (when the soldier is alert), and then there's "s" and "h" and "l" which I'm not sure about.

 

You can edit the soldiers in the story missions as well. It's the same process, except each mission pack is located in a file with the format s#####.fpkd. Those files will have the same _npc and _enemy files you can edit. You might have more room to add soldiers as well since only a part of the world is active during missions.

Link to comment
Share on other sites

I stop work on free roam mode, now focus work on story mode first. The oil tank story mission file is locate in chunk4.dat s10080 folder. After try and spent many hour finally success make the extra soldier show up. Damn, I forgot to add soldier name to enemy.lua cp list. lol

Link to comment
Share on other sites

Extra soldier all stick together, don't know what i'm missing...0000~0017 is official setup, I add 0018~0024, not working at all. .

 

-this.flowStation_clearing_start = function()

TppEnemy.SetCautionRoute( "sol_flowStation_0000" , "rt_flowStation_c_0001")
TppEnemy.SetCautionRoute( "sol_flowStation_0001" , "rt_flowStation_c_0002")
TppEnemy.SetCautionRoute( "sol_flowStation_0002" , "rt_flowStation_c_0003")
TppEnemy.SetCautionRoute( "sol_flowStation_0003" , "rt_flowStation_c_0003")
TppEnemy.SetCautionRoute( "sol_flowStation_0004" , "rt_flowStation_c_0005")
TppEnemy.SetCautionRoute( "sol_flowStation_0005" , "rt_flowStation_c_0007")
TppEnemy.SetCautionRoute( "sol_flowStation_0006" , "rt_flowStation_c_0009")
TppEnemy.SetCautionRoute( "sol_flowStation_0007" , "rt_flowStation_c_0009")
TppEnemy.SetCautionRoute( "sol_flowStation_0008" , "rt_flowStation_c_0010")
TppEnemy.SetCautionRoute( "sol_flowStation_0009" , "rt_flowStation_c_0010")
TppEnemy.SetCautionRoute( "sol_flowStation_0010" , "rt_flowStation_c_0012")
TppEnemy.SetCautionRoute( "sol_flowStation_0011" , "rt_flowStation_c_0004")
TppEnemy.SetCautionRoute( "sol_flowStation_0012" , "rts_flowStation_c_0001")
TppEnemy.SetCautionRoute( "sol_flowStation_0013" , "rts_flowStation_c_0002")
TppEnemy.SetCautionRoute( "sol_flowStation_0014" , "rts_flowStation_c_0003")
TppEnemy.SetCautionRoute( "sol_flowStation_0015" , "rts_flowStation_c_0004")
TppEnemy.SetCautionRoute( "sol_flowStation_0016" , "rts_flowStation_c_escape_0000")
TppEnemy.SetCautionRoute( "sol_flowStation_0017" , "rts_flowStation_c_escape_0000")
TppEnemy.SetCautionRoute( "sol_flowStation_0018" , "rt_flowStation_c_0002")
TppEnemy.SetCautionRoute( "sol_flowStation_0019" , "rt_flowStation_c_0003")
TppEnemy.SetCautionRoute( "sol_flowStation_0020" , "rt_flowStation_c_0003")
TppEnemy.SetCautionRoute( "sol_flowStation_0021" , "rt_flowStation_c_0005")
TppEnemy.SetCautionRoute( "sol_flowStation_0022" , "rt_flowStation_c_0007")
TppEnemy.SetCautionRoute( "sol_flowStation_0023" , "rt_flowStation_c_0009")
TppEnemy.SetCautionRoute( "sol_flowStation_0024" , "rt_flowStation_c_0009")
Link to comment
Share on other sites

SetCautionRoute only sets the "caution" route, which is when they are searching for you. You need to add SetSneakRoute for each enemy as well, which will set their default route. There might not be enough day and night routes available for the extra soldiers so you'll need to assign some of the caution routes as their sneak routes as well. Also make sure that, in the fox2 file, arraySize in the property name="dataList" line is equal to the total number of soldiers in the list, and that under <value>Soldier2GameObject</value> the value realizedCount is equal to the number of soldiers on the base (don't set it above 30 or it will crash) and the value totalCount is equal to the total number of soldiers.

 

Looking forward to seeing what you come up with man

Link to comment
Share on other sites

This s10080 mission have 3 location,

Swamp, Outland and Flow station. The enemy.lua original setup Swamp and Outland have SetSneakRoute & SetCautionRoute .

But Flow Station only have SetCautionRoute which i already show to you as above. What i confuse about is how the flow station soldier's route functioning without SetSneakRoute in the enemy.lua file?

 

Yes, i know how to set the array size of datalist, realizedcount i set to 24, 25 will crash.

 

Is that value in fox2 file very important? 0x03AF9930... is this got any meaning? I just use your free roam data paste to story mode without change any value, surprisingly the extra soldier show up in story mode, so i didn't care about the value.

 

Now i change 0018~0024 from cautionroute to sneakroute, still not working.

Edited by townnet
Link to comment
Share on other sites

The sneak routes are automatically assigned to the soldiers once you add their name to a CP list in the _enemy.lua file. However there are a limited number of predefined routes per CP (usually one for each default soldier), so if you add extra soldiers and there are no paths left, the game will just place them at their default position in the middle of the base. SetSneakRoute can be used to override this automatic soldier placement and will let you assign the soldiers to whatever path you want.

 

I'm not really sure how the game uses the hexadecimal values, I just changed them arbitrarily for each soldier I added. Since you were able to paste the soldier data in it seems that you shouldn't have to worry about them.

Link to comment
Share on other sites

Override just like below? The black text is command? And the green text is description? Free roam and story lua file have some different, i have waste a whole day to figure out but get nothing. lol

 

this.SetUpEnemy = function ()
Fox.Log("Set up enemy")
TppEnemy.RegisterCombatSetting( this.combatSetting )
local cpList = {
mafr_cpGroups.group_Area1,
mafr_cpGroups.group_Area2,
mafr_cpGroups.group_Area3,
mafr_cpGroups.group_Area4,
mafr_cpGroups.group_Area5,
}
this.cpList = cpList
-- this.AddToCp(missionTable.enemy.soldierDefine)--tex
--TppEnemy.DefineSoldiers(this.soldierDefine)--mvars.ene_soldierDefine)--tex WAS missionTable.enemy.soldierDefine
this.setRoute_outland()
this.setRoute_flowStation()
this.setRoute_swamp()
this.setRoute_pfCamp()
this.setRoute_savannah()
this.setRoute_banana()
this.setRoute_diamond()
this.setRoute_hill()
this.setRoute_factorySouth()
this.setRoute_hillNorth()
this.setRoute_hillWest()
this.setRoute_factoryWest()
this.setRoute_lab()
-- this.SwitchEnableCpSoldiers( this.soldierDefine.mafr_outland_cp, false)
-- this.SwitchEnableCpSoldiers( this.soldierDefine.mafr_outland_cp, true)
--this.SetForceRealize()
--for
-- TppEnemy.SetSneakRoute( "sol_flowStation_"..tostring() , "rt_flowStation_d_"..tostring())
--d=12 n=10 h=4 s=4 l=2
-- for key, value in pairs( this.sol_swamp ) do
-- local gameObjectId = GameObject.GetGameObjectId( "TppSoldier2", key )
-- local command = { id = "ChangeFova", faceId=EnemyFova.INVALID_FOVA_VALUE, race=0 }
-- GameObject.SendCommand( gameObjectId, command )
-- end
-- for key,value in pairs(StrCode32Table) do
-- TppUiCommand.AnnounceLogView("Found member "..key)
-- end
-- local gameObjectId = GameObject.GetGameObjectId( "sol_swamp_0000" )
-- GameObject.SendCommand( gameObjectId, { id = "SetForceRealize", forceRealize = enable, } )
-- local gameObjectId = GameObject.GetGameObjectId("EnemyHeli")
-- GameObject.SendCommand(gameObjectId, { id="Unrealize" })
-- local command = { id="SetSoldier2Flag", flag="forceRealize", on=true }
-- GameObject.SendCommand( gameObjectId, command )
--for key, value in pairs(this.soldierDefine[mafr_flowStation_cp]) do
--TppUiCommand.AnnounceLogView(this.soldierDefine[mafr_flowStation_cp])--key..", "..value)
--end
TppEnemy.SetupQuestEnemy()
end
Link to comment
Share on other sites

The green text is code I used for testing (you can use the -- to disable lines of code). All the this.setRoute_ commands were added in by me in order to manually set the routes. Those commands are defined further up the file in the form of "this.setRoute_CPName = function()" with the SetSneakRoute commands below each one. So in the story mission file you need to make sure that whatever function() blocks you paste in are executed in this.SetUpEnemy (I'm assuming that the story mission file has this.SetUpEnemy).

Link to comment
Share on other sites

Oh man, i'm gonna mad, i just realized that i'm waste a lot of time because of this sh##...Each time the mission 13 game start it force you ride the helicopter, so when i want to exit game to edit file, i just exit to title screen and exit the game without go to ACC. After edit the file i only have to launch game and select continue then i can faster way get into a game, spawn at check point without ride the helicopter again. But i just know that this method have a downside, the new repack lua file won't load into a game, it just load the old lua data, thats why the reason i aways get the wrong result even i'm already do the right thing for the latest file. lol

 

My point is you have to abort the game and go to ACC, then the latest repack file just can load effectively by start a new game.

 

Finally all extra soldier have their route now, yeah !

 

I will share file to you after the whole works are complete, thank you, wish you a happy new year.

Edited by townnet
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...