Amineri Posted March 25, 2013 Share Posted March 25, 2013 What the title says. I was testing out using the m_iNumTerrorCivilians field to pass the number of days elapsed since game start. To keep this from breaking other things I had hard-coded the place where the 18 civilians are created in terror missions. In simulated function InitializeCivilians(){// End:0x127 Loop:Falseif(XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).GetDesc().m_iMissionType == 7){SpawnCivilians(XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).GetDesc().m_iNumTerrorCivilians);UpdateCivilianCounts();}}I changed the very long call to get the number 18, so that it decompiled as just SpawnCivilians(18); The variable m_iNumTerrorCivilians should have contained the count of the number of days since starting (I was testing with the first terror mission -- April 14), so the value should have been around 45. I had 5 soldiers on the mission. However, when I started, I had 6 soldiers deployed in the dropzone. Then, I discovered that I had -another- 4 soldiers out already in the mission area. They were all standing in the same square, but I was able to move them and control them just as any other soldier. The extra 5 soldiers were duplicates in appearance / abilities / name to the 5 soldiers that I actually took. (I had one of each type ... Sniper, Heavy, Support, Assault, SHIV -- and got one duplicate of each) Civilian count spawning and mechanics worked normally -- 18 civilians spawned, 4 killed during the mission (it is much easier with 10 soldiers :P ), leaving 14 alive, which gave me "excellent" rating, etc. Upon returning to base there were only the five soldiers that I had originally taken. My original idea failed (variable had undesired side effects) -- the implementation was glitchy -- but... more than six soldiers!! I'm not even sure where to go from here. All I can think of is that the spawning algorithm for civilians was somehow twisted into creating extra soldiers, because of the mismatch between the number of civilians to spawn (18) the the value of m_iNumTerrorCivilians (~ 45). Why this would create FIVE extra soldiers, I have no idea. What do people think? ----------------------------------------------------------------------------- If people want to replicate this, I changed two things:1) Assigned value to m_iNumTerrorCivilians in XGMission -- as far as I can tell, this variable is never set in the strategy game. The default value of 18 is how the number is set.hex code:Applied to XcomStrategyGame.upkOriginal total hex (header + function)60 37 00 00 AB 1F 00 00 00 00 00 00 5D 37 00 00 00 00 00 00 00 00 00 00 60 37 00 00 00 00 00 00 07 01 00 00 90 1B 00 00 86 01 00 00 06 01 00 00 49 02 00 28 15 07 22 00 9A 01 35 37 00 00 2C 08 16 04 01 27 37 00 00 06 7B 01 0F 00 5E 37 00 00 2E 71 FE FF FF 19 19 2E 94 FE FF FF 12 20 FD FE FF FF 0A 00 3A FB FF FF 00 1C 91 FD FF FF 16 09 00 09 FB FF FF 00 01 09 FB FF FF 13 00 A4 FA FF FF 00 1B B6 0D 00 00 00 00 00 00 1F 58 47 50 61 72 61 6D 00 16 07 F7 00 2D 00 60 37 00 00 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A 2C 2E 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A 2C 06 01 28 37 00 00 06 51 01 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A A7 2C 35 16 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A A7 2C 4C 16 01 28 37 00 00 04 12 20 8C FE FF FF 14 00 09 FA FF FF 00 1B 39 0D 00 00 00 00 00 00 01 26 37 00 00 4A 16 04 3A 5F 37 00 00 53 New total hex (header + function)60 37 00 00 AB 1F 00 00 00 00 00 00 5D 37 00 00 00 00 00 00 00 00 00 00 60 37 00 00 00 00 00 00 07 01 00 00 90 1B 00 00 72 01 00 00 06 01 00 00 49 02 00 28 15 07 22 00 9A 01 35 37 00 00 2C 08 16 04 01 27 37 00 00 06 67 01 0F 00 5E 37 00 00 2E 71 FE FF FF 19 19 2E 94 FE FF FF 12 20 FD FE FF FF 0A 00 3A FB FF FF 00 1C 91 FD FF FF 16 09 00 09 FB FF FF 00 01 09 FB FF FF 13 00 A4 FA FF FF 00 1B B6 0D 00 00 00 00 00 00 1F 58 47 50 61 72 61 6D 00 16 0F 19 01 31 37 00 00 09 00 48 FC FF FF 00 01 48 FC FF FF 19 1B 4C 0E 00 00 00 00 00 00 16 0A 00 82 41 00 00 00 1B F2 0E 00 00 00 00 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A A7 2C 35 16 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A A7 2C 4C 16 01 28 37 00 00 04 12 20 8C FE FF FF 14 00 09 FA FF FF 00 1B 39 0D 00 00 00 00 00 00 01 26 37 00 00 4A 16 04 3A 5F 37 00 00 53 Decompiled code after change: protected function string GenerateOpName(optional bool bTutorial){ local XGParamTag kTag; bTutorial = false; // End:0x22 if(m_iMissionType == 8) { return m_strOpAvenger; } // End:0x167 else { kTag = XGParamTag(XComEngine(class'Engine'.static.GetEngine()).LocalizeContext.FindTag("XGParam")); m_kDesc.m_iNumTerrorCivilians = Game().GetDays(); kTag.StrValue0 = m_aFirstOpName[Rand(53)]; kTag.StrValue1 = m_aSecondOpName[Rand(76)]; return class'XComLocalizer'.static.ExpandString(m_strOpRandom); } //return ReturnValue; } 2) Hard coded number of civilians to spawn as 18 in XGAIPlayer_Animal. A search indicated that this was the only place that this was used (apart from a piece of tactical sim code in the strategy code that I think was used to test the strategy game without having to play all the tactical missions).hex code: applied to XcomGame.upk Hex before:6C 9A 00 00 50 55 00 00 00 00 00 00 57 9A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 01 00 00 05 2C 00 00 2A 01 00 00 CA 00 00 00 07 27 01 9A 19 19 2E 33 9F 00 00 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 0A 00 85 9E 00 00 00 1B 16 32 00 00 00 00 00 00 16 09 00 B0 9F 00 00 00 01 B0 9F 00 00 2C 07 16 1B 7E 66 00 00 00 00 00 00 19 19 2E 33 9F 00 00 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 0A 00 85 9E 00 00 00 1B 16 32 00 00 00 00 00 00 16 09 00 AF 9F 00 00 00 01 AF 9F 00 00 16 1B ED 6D 00 00 00 00 00 00 16 04 0B 53 Hex after:6C 9A 00 00 50 55 00 00 00 00 00 00 57 9A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 01 00 00 05 2C 00 00 FA 00 00 00 CA 00 00 00 07 F7 00 9A 19 19 2E 33 9F 00 00 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 0A 00 85 9E 00 00 00 1B 16 32 00 00 00 00 00 00 16 09 00 B0 9F 00 00 00 01 B0 9F 00 00 2C 07 16 1B 7E 66 00 00 00 00 00 00 2C 12 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 1B ED 6D 00 00 00 00 00 00 16 04 0B 53Decompiled code after change: simulated function InitializeCivilians(){ // End:0xF7 if(XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).GetDesc().m_iMissionType == 7) { SpawnCivilians(18); UpdateCivilianCounts(); } //return; } Link to comment Share on other sites More sharing options...
johnnylump Posted March 25, 2013 Share Posted March 25, 2013 More than 6 Xcom soldiers in a tactical mission has been done, but not quite by that method! See this thread: http://forums.nexusmods.com/index.php?/topic/804076-rd-to-increase-squad-size/ twinj and Drakous79 had made significant progress, but they seemed to have dropped the project and haven't posted on this forum in quite a while. I think problems remains with 1) getting the troops to show up in the drop zone and not in a random spot, 2) selecting and equipping troops #6 and greater in the board-the-dropship UI. Link to comment Share on other sites More sharing options...
Amineri Posted March 26, 2013 Author Share Posted March 26, 2013 I knew that more soldiers had been put into play, but this method seemed unlikely to be the way it happened. That, and I'm really surprised that it happened. I can't figure what the connection between changing the m_iNumTerrorCivilians variable and spawning double XCOM soldiers is. I'm not planning on following up on adding more soldiers, but I thought there might still be someone out there that was working on it. Might be some sort of way to 'overflow' the SpawnCivilian call to add additional XCOM units or something. Since civilians don't seem to spawn base on predetermined points (they seem to use some sort of random coordinate-type system), perhaps the spawn point could be controlled. Anyhow, it was more of an "this is interesting" than a "I have a usable mod" thing. :D Link to comment Share on other sites More sharing options...
johnnylump Posted March 26, 2013 Share Posted March 26, 2013 (edited) Oh, I thought it likely you'd looked at the prior thread at length -- I figured I'd throw in the link and description of where things stand in case anyone else happens along and wants to take this on :smile: Edited March 26, 2013 by johnnylump Link to comment Share on other sites More sharing options...
Recommended Posts