FunkyFr3sh Posted May 28, 2015 Share Posted May 28, 2015 Download: http://funkyfr3sh.cncnet.org/files/d2k/MisEditor.zip 1. Extract the files to your game folder2. Take any .mis file you like to edit and rename it to "MisEditor.MIS" then replace it with the example one included in the download3. Open "MisEditor.txt" in a text editor and change the value you like4. Start MisEditor.exe -> it will now read MisEditor.MIS, then it applies all values found in "MisEditor.txt" and save the file back as "MisEditor.mis" I Added a few example values into the MisEditor.txt, you can find a full list here:http://funkyfr3sh.cncnet.org/files/d2k/MissionFileValues.txtI also tried to sort the values, some of them will only work under the [AI] section, some only under the other sections [MISSION] [EVENTS] -> http://funkyfr3sh.cncnet.org/files/d2k/MissionFileValues%20-%20sorted.txt this is how the example file looks:[AI]HarvestersPerRefinery = 5MaxBuildings HEAVY_FACTORY = 5MaxBuildings BARRACKS = 0[END] Allow the AI players to have 5 harvs per refineryit will change the max amount of HEAVY_FACTORY the AI can build to 5it will change the max amount of BARRACKS the AI can build to 0 as you can see, some values take parameter like "HEAVY_FACTORY" or "BARRACKS" or even the side name "ATREIDES"Most of the values are integers, but some are floats (you have to test around)- Note:MisEditor.exe is just a modified dune2000.exe where I enabled the file format converterThe game will start up, convert the files and shut down again 2 Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted May 28, 2015 Author Share Posted May 28, 2015 I started to write down the values of the original _prac.mis file, here are the first values (it's not even the half, there are tons) [AI]FirstAttackBuildingDelay = 12000TimeBetweenBuildingAttacks = 15000AttackBuildingStrength = 40ProtectStrength = 75DefendStrength = 40SpeedWeight NoPurpose = 1.0SpeedWeight Base = 1.0SpeedWeight Guarding = 1.0SpeedWeight Protect = 1.0SpeedWeight Defend = 1.0SpeedWeight AttackBuilding = 1.0SpeedWeight AttackUnit = 1.0SpeedWeight GuardBuilding = 1.0SpeedWeight Harvesters = 1.0SpeedWeight Carryalls = 1.0SpeedWeight Returning = 1.0SpeedWeight Repair = 1.0SpeedWeight TempGuard = 1.0SpeedWeight Deploying = 1.0SpeedWeight Rampaging = 1.0SpeedWeight DefendArea = 1.0HPWeight NoPurpose = 1.0HPWeight Base = 1.0HPWeight Guarding = 1.0HPWeight Protect = 1.0HPWeight Defend = 1.0HPWeight AttackBuilding = 1.0HPWeight AttackUnit = 1.0HPWeight GuardBuilding = 1.0HPWeight Harvesters = 1.0HPWeight Carryalls = 1.0HPWeight Returning = 1.0HPWeight Repair = 1.0HPWeight TempGuard = 1.0HPWeight Deploying = 1.0HPWeight Rampaging = 1.0HPWeight DefendArea = 1.0FirePowerWeight NoPurpose = 1.0FirePowerWeight Base = 1.0FirePowerWeight Guarding = 1.0FirePowerWeight Protect = 1.0FirePowerWeight Defend = 1.0FirePowerWeight AttackBuilding = 1.0FirePowerWeight AttackUnit = 1.0FirePowerWeight GuardBuilding = 1.0FirePowerWeight Harvesters = 1.0FirePowerWeight Carryalls = 1.0FirePowerWeight Returning = 1.0FirePowerWeight Repair = 1.0FirePowerWeight TempGuard = 1.0FirePowerWeight Deploying = 1.0FirePowerWeight Rampaging = 1.0FirePowerWeight DefendArea = 1.0CashStash NoJob = 1800CashStash RepairBuildings = 1800CashStash RepairUnits = 1800CashStash BuildHarvesters = 1800CashStash BuildCarryalls = 1800CashStash BuildBuildings = 2500CashStash BuildUnits = 2575Morale NoPurpose = 100Morale Base = 100Morale Guarding = 100Morale Protect = 100Morale Defend = 100Morale AttackBuilding = 80Morale AttackUnit = 100Morale GuardBuilding = 100Morale Harvesters = 100Morale Carryalls = 100Morale Returning = 100Morale Repair = 100Morale TempGuard = 100Morale Deploying = 100Morale Rampaging = 100Morale DefendArea = 100AttackSidePriority ATREIDES = 0AttackSidePriority HARKONNEN = 0AttackSidePriority ORDOS = 0AttackSidePriority EMPEROR = 0AttackSidePriority FREMEN = 0AttackSidePriority SMUGGLER = 0AttackSidePriority MERCENARY = 0AttackSidePriority OTHER = 0UnitBuildPriority "LIGHT INF" = 3.0UnitBuildPriority TROOPER = 3.0UnitBuildPriority ENGINEER = 0.01UnitBuildPriority THUMPER = 0.0UnitBuildPriority SARDAUKAR = 1.0UnitBuildPriority TRIKE = 1.0UnitBuildPriority RAIDER = 1.0UnitBuildPriority QUAD = 1.0UnitBuildPriority HARVESTER = 0.0UnitBuildPriority "ATREIDES COMBAT TANK" = 1.0UnitBuildPriority "HARKONNEN COMBAT TANK" = 1.0UnitBuildPriority "ORDOS COMBAT TANK" = 1.0UnitBuildPriority MCV = 0.0UnitBuildPriority "MISSILE TANK" = 1.0UnitBuildPriority DEVIATOR = 1.0UnitBuildPriority "SIEGE TANK" = 1.0UnitBuildPriority "SONIC TANK" = 1.0UnitBuildPriority "DEVASTATOR TANK" = 1.0UnitBuildPriority CARRYALL = 0.0UnitBuildPriority CARRYALL2 = 0.0UnitBuildPriority ORNITHOPTER = 3.0UnitBuildPriority FREMEN = 0.0UnitBuildPriority "FR NON STEALTH" = 1.0UnitBuildPriority SABOTEUR = 0.0UnitBuildPriority "DEATH HAND ROCKET" = 0.0UnitBuildPriority SANDWORM = 0.0UnitBuildPriority "CHOAM FRIGATE" = 1.0UnitBuildPriority GRENADIER = 1.0UnitBuildPriority "STEALTH RAIDER" = 1.0UnitBuildPriority "MP SARDAUKAR" = 1.0[END] More values coming soon... 2 Quote Link to comment Share on other sites More sharing options...
D2k Sardaukar Posted May 28, 2015 Share Posted May 28, 2015 Very nice work! Can you also recover information about the possible values (like minimum and maximum)?For example, UnitBuildPriority looks to run from 0.0 to 3.0, which is actually kinda an odd range. Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted May 28, 2015 Author Share Posted May 28, 2015 no idea, but you shouldn't go above 999999.0 Quote Link to comment Share on other sites More sharing options...
Adriano Posted May 29, 2015 Share Posted May 29, 2015 this is how the example file looks:[AI]HarvestersPerRefinery = 5MaxBuildings HEAVY_FACTORY = 5MaxBuildings BARRACKS = 0[END] Allow the AI players to have 5 harvs per refineryit will change the max amount of HEAVY_FACTORY the AI can build to 5it will change the max amount of BARRACKS the AI can build to 0It is interesting to know, how many harvesters per refinery in not changed game? Quote Link to comment Share on other sites More sharing options...
Klofkac Posted May 29, 2015 Share Posted May 29, 2015 004E1890 . 52 45 49 4E 4 ASCII "REINFORCE",0 ; ASCII "REINFORCE"004E18B0 . 41 4C 4C 45 4 ASCII "ALLEGIANCE",0 ; ASCII "ALLEGIANCE"004E18D0 . 4C 45 41 56 4 ASCII "LEAVE",0 ; ASCII "LEAVE"004E18F0 . 42 45 53 45 5 ASCII "BESERK",0 ; ASCII "BESERK"004E1910 . 50 4C 41 59 5 ASCII "PLAYSOUND",0 ; ASCII "PLAYSOUND"004E1930 . 53 45 54 42 5 ASCII "SETBUILDRATE",0 ; ASCII "SETBUILDRATE"004E1950 . 53 45 54 41 5 ASCII "SETATTACKBUILDIN" ; ASCII "SETATTACKBUILDINGRATE"004E1970 . 53 45 54 43 4 ASCII "SETCASH",0 ; ASCII "SETCASH"004E1990 . 53 45 54 54 4 ASCII "SETTECH",0 ; ASCII "SETTECH"004E19B0 . 57494E00 DD 004E4957 ; ASCII "EP2"004E19D0 . 4C 4F 53 45 0 ASCII "LOSE",0 ; ASCII "LOSE"004E19F0 . 42 4C 4F 58 4 ASCII "BLOXFILE",0 ; ASCII "BLOXFILE"004E1A10 . 41 54 54 52 4 ASCII "ATTRIBFILE",0 ; ASCII "ATTRIBFILE"004E1A30 . 52 45 56 45 4 ASCII "REVEAL",0 ; ASCII "REVEAL"004E1A50 . 53 48 4F 57 5 ASCII "SHOWTIMER",0 ; ASCII "SHOWTIMER"004E1A70 . 48 49 44 45 5 ASCII "HIDETIMER",0 ; ASCII "HIDETIMER"004E1A90 . 53 48 4F 57 4 ASCII "SHOWMESSAGE",0 ; ASCII "SHOWMESSAGE"004E1AB0 . 41 44 44 55 4 ASCII "ADDUNITS",0 ; ASCII "ADDUNITS"004E1AD0 . 53 45 54 46 4 ASCII "SETFLAG",0 ; ASCII "SETFLAG"Hmm, that all seems like event types. Some of them are known and supported by Mission editor, but several not (these were actually not used in any mission). For example, the Unknown6 event is actually SETBUILDRATE. What for example means LEAVE or BLOXFILE? Can anyone play around with those uknown/unused event types? They might be really useful in making more possibilities for custom missions and campaigns. Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted May 29, 2015 Author Share Posted May 29, 2015 Adriano:I think 2 KlofkacYou can also add events to the MisEdit.txt, but the format is a bit more complicated (IF THEN ELSE etc)I don't really know how the events are stored in binary form, if some knows it and could explain then might be easier to reverse them All these belong to the [Mission] section which has something to do with the events:DEPLOYREINFORCEALLEGIANCELEAVEBESERKPLAYSOUNDSETBUILDRATESETATTACKBUILDINGRATESETCASHSETTECHEP2LOSEBLOXFILEATTRIBFILEREVEALSHOWTIMERHIDETIMERSHOWMESSAGEADDUNITSSETFLAGNoPurposeThere is also a [Events] sections, not sure if there are some strings for this section, probably this ones:004E1730 . 42 55 49 4C 4 ASCII "BUILDINGEXISTS",0 ; ASCII "BUILDINGEXISTS"004E1750 . 55 4E 49 54 4 ASCII "UNITEXISTS",0 ; ASCII "UNITEXISTS"004E1770 . 49 4E 54 45 5 ASCII "INTERVAL",0 ; ASCII "INTERVAL"004E1790 . 54 49 4D 45 5 ASCII "TIMER",0 ; ASCII "TIMER"004E17B0 . 43 41 53 55 4 ASCII "CASUALTIES",0 ; ASCII "CASUALTIES"004E17D0 . 42 41 53 45 4 ASCII "BASEDESTROYED",0 ; ASCII "BASEDESTROYED"004E17F0 . 55 4E 49 54 5 ASCII "UNITSDESTROYED",0 ; ASCII "UNITSDESTROYED"004E1810 . 52 45 56 45 4 ASCII "REVEALED",0 ; ASCII "REVEALED"004E1830 . 48 41 52 56 4 ASCII "HARVESTED",0 ; ASCII "HARVESTED"004E1850 . 46 4C 41 47 0 ASCII "FLAG",0 ; ASCII "FLAG" Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 7, 2015 Share Posted July 7, 2015 I started to write down the values of the original _prac.mis file, here are the first values (it's not even the half, there are tons) More values coming soon...Could you please add more values? I am playing around with the MisEditor.exe to retrieve the byte positions of the properties in .mis file, I already managed it for all values you posted here, but I'm having problems with the others.Fow example I added this:BuildingRepairValue BARRACKS = 0.5But I got this error:Unknown building [bARRACKS] [ gGameTicks = 0 ]But for MaxBuildings it worked just well. What are the correct parameters? And what about boolean values?It would be also good if you helped with finding the offsets of the properties (like HarvestersPerRefinery = 7428, SpecialWeaponDelay = 7448 etc).Thanks! Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 8, 2015 Author Share Posted July 8, 2015 Those should be all params: ## group types 1 ##NoPurposeBaseGuardingProtectDefendAttackBuildingAttackUnitGuardBuildingHarvestersCarryallsReturningRepairTempGuardDeployingRampagingDefendArea## group types 2 ##NoJobRepairBuildingsRepairUnitsBuildHarvestersBuildCarryallsBuildBuildingsBuildUnits## sides ##ATREIDESHARKONNENORDOSEMPERORFREMENSMUGGLERMERCENARYOTHER## units ##"LIGHT INF"TROOPERENGINEERTHUMPERSARDAUKARTRIKERAIDERQUADHARVESTER"ATREIDES COMBAT TANK""HARKONNEN COMBAT TANK""ORDOS COMBAT TANK"MCV"MISSILE TANK"DEVIATOR"SIEGE TANK""SONIC TANK""DEVASTATOR TANK"CARRYALLCARRYALL2ORNITHOPTERFREMEN"FR NON STEALTH"SABOTEUR"DEATH HAND ROCKET"SANDWORM"CHOAM FRIGATE"GRENADIER"STEALTH RAIDER""MP SARDAUKAR"## buildings ##CONSTRUCTION_YARDCONCRETECONC2WIND_TRAPBARRACKSSIETCHWALLREFINERYMEDIUM_GUN_TURRETOUTPOSTLARGE_GUN_TURRETAT_HIGH_TECH_FACTORYHIGH_TECH_FACTORYLIGHT_FACTORYSILOHEAVY_FACTORYSTAR_PORTREPAIR_PADRESEARCH_CENTREATREIDES_PALACEHARKONNEN_PALACEORDOS_PALACEIMPERIAL_PALACESP_OUTPOST bool:YESTRUENOFALSE Edit:The values for BuildingRepairValue are in Templates.bin starting at 0x0B474 Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 8, 2015 Share Posted July 8, 2015 OK, thanks for reply. I already found out the list of buildings by myself, I discovered that the game probably gets the building names from text.uib (because I did not find strings like CONC2 inside exe).What I am asking is what parameters should I supply for properties like BuildingRepairValue, DefendBuildingPriority, AttackBuildingPriority, TimeBeforeRebuilding etc. These apparently need building type as parameter, but supplying anything what MaxBuildings normally accepts results in error I posted here. Maybe I need to specify also side (like there are three types of each building)?Btw I found out that there are values for 100 buildings and 60 units available, but only about half of them are really used (there are 30 unit types). So each building-related property takes 400 bytes and unit-related property takes 240 bytes (except of ProtectUnit which is boolean and takes 60 bytes). I found it out thanks to DefaultBuildingRepairValue and DefaultUnitRepairValue which set the same value for all buildings/units. That quite helped me. Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 8, 2015 Author Share Posted July 8, 2015 The names in Templates.bin starting at 0x0B474 are different than the other building names (more building types and those have spaces so you probably need to put them in quotes) yes it should always be the same length for each type, maybe even saved in the same order (could save some time) Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 8, 2015 Author Share Posted July 8, 2015 Not sure if it helps, but here is how the game is reading the mission files: 80 bytes - TechLevel array (and maybe something else, not sure)8 bytes - Unknown60864 bytes - Unknown64 bytes - Unknown4608 bytes - Unknown1344 bytes - Unknown200 bytes - TileSet200 bytes - TileData1 byte - Unknown1 byte - Unknown4 bytes - MissionTimerTicks692 bytes - Unkown You probably know what name some of those arrays have, would be nice to know so i can save it in my db Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 8, 2015 Share Posted July 8, 2015 This is your friend: http://d2kplus.com/wiki/index.php?title=Mission_Files Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 8, 2015 Author Share Posted July 8, 2015 Oh nice, last region is related to timers, seems to be used only in places where it draws a text message Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 9, 2015 Share Posted July 9, 2015 Oh nice, last region is related to timers, seems to be used only in places where it draws a text messageAre you talking about the last 692-byte region in .mis files? For me it seems that this region is unused at all. I looked into several .mis files (many, but not all) and it was always full of zeros. Even in missions where time limit is set (A5V1, O6V1, O6V2). Does the game access/use data in that region in any way? And about AI regions. It seems, that the whole first half of AI segment (up to byte around 3800) is unused at all (is filled with zeros), only in the very beginning there are several values (about 40 bytes). Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 9, 2015 Author Share Posted July 9, 2015 The first 8 bytes are used (2x int32) in the last region, not sure about the rest Will take a look into the AI settings too Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 9, 2015 Share Posted July 9, 2015 The first 8 bytes are used (2x int32) in the last region, not sure about the rest Will take a look into the AI settings tooDo you know any .mis file where the 8 bytes are used (are non-zero)? Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 9, 2015 Author Share Posted July 9, 2015 Nope dunno if there is a mission, here is what i found out: int32int32int32 - index for array 1int32 array 1 (length = 5) - duration?int32 array 2 (length = 5)string array (length = 5 - each 128 byte) I think the game can show up to 5 messages at the same time, the first array holds the duration of the message So this is pretty much the text message queue Quote Link to comment Share on other sites More sharing options...
Klofkac Posted July 9, 2015 Share Posted July 9, 2015 Hmm so if it is just all about shownig some messages then the potential use in custom missions is not very significant, so probably we don't need to much investigate it. However if you possibly get it to work you can tell me. Quote Link to comment Share on other sites More sharing options...
FunkyFr3sh Posted July 9, 2015 Author Share Posted July 9, 2015 Yes it is pretty useless, I guess they only needed it for savegames Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.