TECHN0M4NCER Posted August 26, 2018 Share Posted August 26, 2018 (edited) I'm using this mod in order to spawn steam vents in desired places and mirror spawning pre-build facilities. The mod also slightly changes terrain generation. I want this 2 changes (Restore top visible level left of access lift to non-excavated state randomly (32 = 50%, default is 75% & Tiles randomly assigned as caves (19 = 25%, default is 20%) reverted to vanilla numbers. Please help, I know that it is likely embarrassingly simple, but I'm just crashing the mod with my clueless tinkering. What do I need to change in the code to make it happen? MOD_NAME=Modified Base Generation AUTHOR=Rockslide DESCRIPTION=Modifies base generation in the following ways: -Number of steam vents is now static based on DGC.INI -Steam vent location is explicitly specified -OTS and Satellite Uplink relocated to right of access lift -Random excavation on first visible level reversed in relation to access lift -Random cave chance increased very slightly Notes: -I created this mod to accommodate my own personal preferences, not as a public release. If there others who can make use of this mod they are welcome to. -Additional comments are included below to highlight changes from default XGBase.GenerateTiles function allowing for changes as desired. -If NUM_STARTING_STEAM_VENTS is larger than 3 there might be undesirable results. At minimum, only the number of .arrDeepRockTiles locations specified below will become steam vents. Should more be desired, specify additional .arrDeepRockTiles locations. -Tested with XCom EW patch 3 v1.0.0.9040; likely will work with any version. -Thanks to Wasteland Ghost for his work that made this possible. UPK_FILE = XComStrategyGame.upk OBJECT = XGBase.GenerateTiles : AUTO [REPLACEMENT_CODE] // Number of steam vents is now exactly what is specified in DefaultGameCore.ini 0F 00 <.iNumSteamVents> 12 20 <XComGame.XGTacticalGameCore> [@] <XComGame.XGTacticalGameCoreNativeBase.NUM_STARTING_STEAM_VENTS> 00 ( 02 <XComGame.XGTacticalGameCoreNativeBase.NUM_STARTING_STEAM_VENTS> ) 54 01 <@m_arrTiles> 90 2C 05 2C 07 16 16 54 01 <@m_arrFacilities> 90 2C 05 2C 07 16 16 0F 00 <.Y> 25 [#label_0x005A] 07 [@label_0x0333] 96 00 <.Y> 2C 05 16 0F 00 <.X> 25 [#label_0x0075] 07 [@label_0x0325] 96 00 <.X> 2C 07 16 07 [@label_0x00D3] 9A 00 <.Y> 25 16 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 2C 03 06 [@label_0x0291] [#label_0x00D3] 07 [@label_0x0181] 9A 00 <.Y> 26 16 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 2C 03 // Restore top visible level left of access lift to non-excavated state randomly (32 = 50%, default is 75%) 07 [@label_0x017E] 82 96 00 <.X> 2C 03 16 18 [@] ( 1B <Roll> 2C 32 16 16 ) 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 25 [#label_0x017E] 06 [@label_0x0291] [#label_0x0181] 07 [@label_0x01DF] 1B <IsAccessLocation> 00 <.X> 00 <.Y> 16 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 2C 03 06 [@label_0x0291] [#label_0x01DF] // Tiles randomly assigned as caves (19 = 25%, default is 20%) 07 [@label_0x022D] 1B <Roll> 2C 19 16 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 2C 02 06 [@label_0x0291] [#label_0x022D] 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 25 // Object reference .arrDeepRockTiles.AddItem moved below tile generation loop [#label_0x0291] 0F 35 <XGBase.TTerrainTile.X> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 00 <.X> 0F 35 <XGBase.TTerrainTile.Y> <@TTerrainTile> 00 01 10 1B <TileIndex> 00 <.X> 00 <.Y> 16 01 <@m_arrTiles> 00 <.Y> A5 00 <.X> 16 06 [@label_0x0075] [#label_0x0325] A5 00 <.Y> 16 06 [@label_0x005A] [#label_0x0333] 0F 00 <.I> 25 // Specify .arrDeepRockTiles locations and consequently steam vent locations (2, 2) (5, 4) (1, 4) 55 00 <.arrDeepRockTiles> [@] ( 1B <TileIndex> 2C 02 2C 02 16 16 ) 55 00 <.arrDeepRockTiles> [@] ( 1B <TileIndex> 2C 05 2C 04 16 16 ) 55 00 <.arrDeepRockTiles> [@] ( 1B <TileIndex> 2C 01 2C 04 16 16 ) [#label_0x033E] 07 [@label_0x03E0] 96 00 <.I> 00 <.iNumSteamVents> 16 0F 00 <.iTile> A7 36 00 <.arrDeepRockTiles> 16 0F 35 <XGBase.TTerrainTile.iType> <@TTerrainTile> 00 01 10 10 00 <.iTile> 00 <.arrDeepRockTiles> 01 <@m_arrTiles> 26 55 01 <@m_arrSteamTiles> [@] ( 10 00 <.iTile> 00 <.arrDeepRockTiles> 16 ) 40 00 <.arrDeepRockTiles> 00 <.iTile> 26 16 A5 00 <.I> 16 06 [@label_0x033E] [#label_0x03E0] 1B <SetFacility> 26 25 25 16 1B <SetFacility> 2C 03 2C 02 25 16 1B <SetFacility> 2C 02 2C 04 25 16 1B <SetFacility> 2C 04 2C 06 25 16 1B <SetFacility> 2C 06 2C 03 26 16 0F 35 <XGBase.TTerrainTile.iTileState> <@TTerrainTile> 00 01 10 1B <TileIndex> 2C 03 26 16 01 <@m_arrTiles> 26 // Relocate Satellite Uplink (5, 1) 1B <SetFacility> 2C 09 2C 05 26 16 07 [@label_0x04BC] 98 19 1B <Game> 16 [@] <XGStrategy.GetDifficulty.ReturnValue> 00 ( 1B <GetDifficulty> 16 ) 26 16 // Relocate Officer Training School (4, 1) 1B <SetFacility> 2C 0C 2C 04 26 16 0F 10 2C 0C 19 1B <Game> 16 [@] <XGStrategy.m_arrFacilityUnlocks> 00 ( 01 <XGStrategy.m_arrFacilityUnlocks> ) 26 [#label_0x04BC] 1B <UpdateTiles> 16 04 0B 53 Edited August 26, 2018 by Mraecor Link to comment Share on other sites More sharing options...
Shabdez Posted August 27, 2018 Share Posted August 27, 2018 Replace the values with the corresponding hex values (4b = 75, 14 = 20). The two lines in question should look like this after you revert back to vanilla: // Restore top visible level left of access lift to non-excavated state randomly (32 = 50%, default is 75%)07 [@label_0x017E] 82 96 00 <.X> 2C 03 16 18 [@] ( 1B <Roll> 2C 4B 16 16 ) // Tiles randomly assigned as caves (19 = 25%, default is 20%)07 [@label_0x022D] 1B <Roll> 2C 14 16 Link to comment Share on other sites More sharing options...
TECHN0M4NCER Posted August 27, 2018 Author Share Posted August 27, 2018 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts