Jump to content

Spawning new soldiers via Fox2 editing


mxmstr

Recommended Posts

So recently I made it my mission to find a way of increasing the amount of soldiers at each CP, and I have gotten it to work...up to a point. Here's a video I recorded demonstrating what happens when assigning more than 10 soldiers to a CP:

https://www.youtube.com/watch?v=ke71B6qgATQ

 

There seems to be some sort of limit on how many soldiers can be rendered and active in the player's proximity, seeing how soldiers who are too far will turn into magical green smoke (probably used as a placeholder for inactive entities) and stop reacting to the environment around them.

 

It's frustrating since I cannot for the life of me figure out how to increase these NPC limits. In Africa's enemy definition file, there is a variable called MAX_SOLDIER_STATE_COUNT but increasing it doesn't change anything, nor does DEFAULT_SOLDIER_STATE_COUNT in TppDefine.lua.

 

If anyone's interested, I can give more detailed instructions on how to do this yourself, but until the limitations are taken care of such a mod would be unplayable.

Link to comment
Share on other sites

You need to adjust realisedCount in the Soldier2GameObject entity of the fox2.

 

https://imgur.com/opcGD6b

 

On my system it hard-crashes on load at 38 for some reason, totalCount crashes out ~> 360, but since that max state count it makes sense at least.

 

Game crashes on return to acc also when near the limits, haven't narrowed down whether its realize or total.

 

Also from what I can gather (current area) quest soldiers will be eating into that total count so you need to keep that in mind.

Link to comment
Share on other sites

Setting is pretty flaky, another crash at 32, even though fine on load, it crashed while moving through a high populated area (just normal game area, none of my added soldiers).

Behavior was repeatable, crash when hitting same spot.

Dropped the count to 31, no crash, back up to 32, crash.

So I thought, a not well handled internal limit of 32?

So I quit to acc, crash. Oh dear.

Dropped to 24, no crash.

Will test at this for a while.

Link to comment
Share on other sites

The only mention of a max realized count is in the file TppEneFova.lua, which seems to set up soldiers' faces. At line 2, there's the line:

local e=EnemyFova.MAX_REALIZED_COUNT

And at line 277 there's the line:

function a.GetFaceGroupTableAtGroupType(e)local t=TppEnemyFaceGroup.GetFaceGroupTable(e)local a={}local e=EnemyFova.MAX_REALIZED_COUNT

Perhaps the game crashes because there are not enough faces loaded into the game? MAX_REALIZED_COUNT isn't mentioned anywhere else, but when I make the game print the variable it says its 255. Raising the assigned value at line 2 doesn't have any noticable effects, and the game still crashes when adding more soldiers. At line 277, changing the assigned value to anything but 255 causes the enemys' faces/heads to disappear. And it also doesn't prevent crashing when adding more soldiers. So altering MAX_REALIZED_COUNT at line 277 is causing an error that is preventing the face table from being constructed. What a bummer.

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...