Jump to content

EXE editing & programming issues


MrFlibble

Recommended Posts

BTW, speaking of the Atreides/Fremen alliance. In the original game, you can make a script for reinforcements that will bring units of two or more AI factions (sometimes this is used in the 8th mission for some of the Houses). This apparently works for everyone except the Atreides/Fremen combo - IIRC if you script a drop of Atreides and Fremen troops it won't work at all. No idea why exactly but it must be somehow connected to the alliance thing.

Link to comment
Share on other sites

I tried this as SCENF001:

[bASIC]

LosePicture=LOSTBILD.WSA

WinPicture=WIN2.WSA

BriefPicture=SARDUKAR.WSA

TimeOut=0

MapScale=0

CursorPos=3422

TacticalPos=3160

LoseFlags=1

WinFlags=3

[MAP]

Bloom=1112,1195,3318,3409

Field=83,130,156,381,567,1734,3636,2492,1381,1207

Seed=392

[Harkonnen]

Quota=0

Credits=1000

Brain=CPU

MaxUnit=25

[Atreides]

Quota=0

Credits=1000

Brain=CPU

MaxUnit=25

[Ordos]

Quota=0

Credits=2500

Brain=CPU

MaxUnit=18

[sardaukar]

Quota=0

Credits=1000

Brain=CPU

MaxUnit=25

[Fremen]

Quota=0

Credits=1500

Brain=Human

MaxUnit=25

[Mercenary]

Quota=0

Credits=2500

Brain=CPU

MaxUnit=18

[CHOAM]

[TEAMS]

[uNITS]

ID001=Atreides,Sonic Tank,256,3297,64,Area Guard

ID002=Fremen,Sonic Tank,256,3356,64,Guard

ID003=Fremen,Sonic Tank,256,3680,64,Guard

[sTRUCTURES]

ID001=Fremen,Const Yard,256,3422

ID002=Harkonnen,Const Yard,256,945

[REINFORCEMENTS]

1=Atreides,Troopers,HomeBase,0

2=Fremen,Infantry,HomeBase,0

3=Ordos,Troopers,EnemyBase,1

4=Harkonnen,Troopers,EnemyBase,1

5=Sardaukar,Raider Trike,EnemyBase,1

and it works.

Can you give me your scenario file? So I can do some tests. ;)

P.S. I'll give you my email by pm, so read them.

Link to comment
Share on other sites

Sorry I don't undestand what is the problem.

I also try this scenario type:

[bASIC]

LosePicture=LOSTBILD.WSA

WinPicture=WIN2.WSA

BriefPicture=SARDUKAR.WSA

TimeOut=0

MapScale=0

CursorPos=3422

TacticalPos=3160

LoseFlags=1

WinFlags=3

[MAP]

Bloom=1112,1195,3318,3409

Field=83,130,156,381,567,1734,3636,2492,1381,1207

Seed=392

[Harkonnen]

Quota=0

Credits=1000

Brain=Human

MaxUnit=25

[Atreides]

Quota=0

Credits=1000

Brain=CPU

MaxUnit=25

[Ordos]

Quota=0

Credits=2500

Brain=CPU

MaxUnit=18

[sardaukar]

Quota=0

Credits=1000

Brain=CPU

MaxUnit=25

[Fremen]

Quota=0

Credits=1500

Brain=CPU

MaxUnit=25

[Mercenary]

Quota=0

Credits=2500

Brain=CPU

MaxUnit=18

[CHOAM]

[TEAMS]

[uNITS]

ID001=Harkonnen,Sonic Tank,256,3297,64,Area Guard

ID002=Harkonnen,Sonic Tank,256,3356,64,Guard

ID003=Harkonnen,Sonic Tank,256,3680,64,Guard

[sTRUCTURES]

ID001=Harkonnen,Const Yard,256,3422

ID002=Fremen,Const Yard,256,945

ID003=Atreides,Const Yard,256,845

[REINFORCEMENTS]

1=Atreides,Troopers,EnemyBase,0

2=Fremen,Infantry,EnemyBase,0

3=Ordos,Troopers,HomeBase,1

4=Harkonnen,Troopers,HomeBase,1

5=Sardaukar,Raider Trike,EnemyBase,1

And it works too. An Atreides CarryAll brings Atreides Troopers and Fremen Warrios.

Maybe it's better if you write me by pm or by email (I write it by pm, drnovice[at]virgilio[dot]it) to resolve problem and post only solution. Ok? ;)

Link to comment
Share on other sites

There is no problem here, I just mentioned what I have observed sometime ago. Maybe I'm wrong here, or messed something up when I had been testing that.

BTW, I've never really used 0 as the arrival time for reinforcements, as it is never used in the original game files.

Link to comment
Share on other sites

You know, I tested this myself in v1.07 (fixed version), and the Fremen/Atreides combo drops work, just like in your case. I also put the Atreides first (and so it's the Atreides carryall that drops units). Maybe it doesn't in 1.0, maybe my memory is playing tricks on me ^_^

Anyway, it's not a very important issue all in all.

Link to comment
Share on other sites

You know, I tested this myself in v1.07 (fixed version), and the Fremen/Atreides combo drops work, just like in your case. I also put the Atreides first (and so it's the Atreides carryall that drops units). Maybe it doesn't in 1.0, maybe my memory is playing tricks on me ^_^

Anyway, it's not a very important issue all in all.

I will second this. It also works with enemy factions. I.E. Ordos vs Harkonnen (AI) You can set reinforcements to drop Harkonnen and Sardukar units at the same time and they will deliver within the same carry-all, but like MrFibble said, not so much an issue but more of an easter egg.

Link to comment
Share on other sites

I noticed about this: if time value is the same, but faction is different, CarryAll will be of the faction that you have specified first.

But the important is that CarryAll (whatever is the faction) drops all units that you have specified and time is respected.

Link to comment
Share on other sites

Now talking about Threat value, it can modify AI behavior regard the priority to target human structures.

We all know that original game AI has priority to target Heavy Factory and Repair Facility (equally), then Palace and Const.Yard, then all others structures.

MrFibble has improved considerably this behavior increasing Threat value of Turrets, because effectively it would be the first target of human player when managed an attack against AI. The reason about this is obvious.

But what else does the human player do to counter the AI strategy (apart destroy AI Const.Yard)??

Simple: he attacks AI harvesters to stop increase of AI credits. He attacks also opponent's Refinery and Silos to remove AI credits.

All this first trying to destroy other units factories, because:

1) no spice = no credits

2) no Refinery & Silos = no credits

So I believe that also AI should "think" so about offensive strategy.

Therefore I test some levels applying these ideas.

I set Refinery & Spice Silos Threat value higher than Const.Yard, Palace and other Factories, but lower then Turrets so the latter will be first priority of AI (as MrFibble has done).

The results are positive, in my tests the AI once destroyed Turrets defenses, it began to destroy Refinery or Silos (same Threat value) and for every of these structure destroyed, the human player lost immediately the credits storaged in that structure, and last of these structures destroyed makes to lose also Const.Yard credits that you have at the beginning!

I also noticed that MrFibble has increasing Threat level of Harvester, if you set the same value of Turrets, you could see AI that attack sometimes also this unit, so if human player isn't carefully he'll lose some load of spice! ;)

Then I try to increase Power provided to Windtrap (-150 of Power consumed value) instead of decrease consumed of all others structures and you can see in game to entry "OUTPUT": 150.

Link to comment
Share on other sites

But what else does the human player do to counter the AI strategy (apart destroy AI Const.Yard)??

Simple: he attacks AI harvesters to stop increase of AI credits. He attacks also opponent's Refinery and Silos to remove AI credits.

BTW, it's also possible to set threat/priority levels for units as well. Not suer if they work though, as I didn't test this.

Therefore I test some levels applying these ideas.

I set Refinery & Spice Silos Threat value higher than Const.Yard, Palace and other Factories, but lower then Turrets so the latter will be first priority of AI (as MrFibble has done).

The results are positive, in my tests the AI once destroyed Turrets defenses, it began to destroy Refinery or Silos (same Threat value) and for every of these structure destroyed, the human player lost immediately the credits storaged in that structure, and last of these structures destroyed makes to lose also Const.Yard credits that you have at the beginning!

That's very nice. I was under the impression that losing credits due to insufficient spice storage capacity occurs randomly because of how the game works, as pointed out by TrueBrain:

Another bug is cutting your credits short. We all know that when you exceed your silo storage, you shouldn't be receive any more credits. But as you all most likely have noticed, this is not really working correctly in 1.07eu. For a long time you can just keep on collecting money, but then all of a sudden you lose most of it, up to the storage capacity. This is because the essential check for this is put outside a loop which loops all the houses. Instead, it picks a random house (depending on certain conditions of the last actions of the other GameLoops), and only cuts credits for it.

As for the initial credits, TrueBrain has an answer for that too:

(..)

BTW, when playing Super Dune 2, where you get literally lots of starting credits (30,000+) in later missions, I got the impression that the initial sum the player is given at the beginning defines how much the player can store without additional silos. Apparently, these excess credits never get "lost", even if actual spice storage capacity is way below that figure. Is this true? or is it some other mechanic in action I do not know about?

As long as your silo capacity is below your initial capacity, you can store up to that amount of credits. Once your silo storage is above that value, your silo storage counts, even if it later on drops below that value.

I also noticed that MrFibble has increasing Threat level of Harvester, if you set the same value of Turrets, you could see AI that attack sometimes also this unit, so if human player isn't carefully he'll lose some load of spice! ;)

Oh, I actually did that? Talk about being forgetful :D

Then I try to increase Power provided to Windtrap (-150 of Power consumed value) instead of decrease consumed of all others structures and you can see in game to entry "OUTPUT": 150.

Well, there's a good side to doing it the other way round, namely the one hundred as the default power output for a Windtrap can be perceived not as 100 units of power, but also as 100 percent, giving you the idea about the power use to power output ratio. Perhaps that's a rather aesthetic choice, but if you're changing this aspect of the game anyway why not use the full potential? Editing individual power consumption values of structures gives a greater control over the process.

BTW, what is the ultimate goal of increasing Windtrap power production in your view? This will certainly simplify base construction and maintenance for the player, especially on later missions, but then again, SD2 and DuneX basically aim for being harder.

Link to comment
Share on other sites

Simply it's an issue of space on rock. I'd like to try new seed terrains for new campaigns, maybe they'll have less rock.

Then I believe that repetitive production of buildings is more an annoyance that a difficulty in game, especially for expert players who want to focus on other things.

BTW, it's also possible to set threat/priority levels for units as well. Not suer if they work though, as I didn't test this.

In the original game, Saboteur has a 700 Threat value, and I clearly remember that sometimes AI produced units targed him instead of structures.

Link to comment
Share on other sites

That's very nice. I was under the impression that losing credits due to insufficient spice storage capacity occurs randomly because of how the game works, as pointed out by TrueBrain:

I once made the Dune II missions into C&C-style, with an MCV instead of a CY, and noticed that deploying it immediately drained my money. This could only be fixed by putting a player building on the map.

Link to comment
Share on other sites

I once made the Dune II missions into C&C-style, with an MCV instead of a CY, and noticed that deploying it immediately drained my money. This could only be fixed by putting a player building on the map.

Yeah, I had a similar experience some time ago :) I think there was some talk - either here or in the OpenDUNE forums - about how this could be remedied, but I'm not sure.

The more annoying thing is when you save and then load a game before you have built your first refinery - chances are you'll lose all your credits that way. BTW, I think that one was fixed in OpenDUNE but I doubt it can be equally easily hacked into the original EXE.

Link to comment
Share on other sites

  • 5 months later...
What exactly do you want to edit? Nyerguds' unit/structure editor is listed above. For everything else, you gotta use a HEX editor.

EDIT: I'm sorry for this very short reply, I forgot we were talking about the MENTAT#.ENG replacement. Here's how you do it:

Later Westwood RTS games like Command & Conquer look for the necessary game files in their root directories and then (if files are not found) browse through the available MIX files for them (there are certain limitations to this, e.g. in RA, but they are not very strict). Dune II, however, has a specific list of contents for each PAK archive, and if you put extra files into any PAK file, the game will ignore them, since it doesn't know they are there. Therefore, since you can't enlarge the PAK contents list, you've got to replace some files.

With the MENTAT#.ENG files, the obvious course is to replace the MENTAT#.GER inside GERMAN.PAK (given that you use the patched Dune II US 1.07 version, or any other 1.07 version if you don't care about the other languages). This is fairly easy: open DUNE2.EXE in any HEX editor, and search for the file names MENTATA.GER, MENTATH.GER etc. Replace GER with ENG and, just to be sure, look for the original MENTAT#.ENG filenames above and change them to MENTAT#.GER. Now the game will look for MENTAT#.ENG in GERMAN.PAK instead of ENGLISH.PAK. Create GERMAN.PAK with any PAK tool you like, and put the modified MENTAT#.ENG files there. You can rename GERMAN.PAK into something else if you like (e.g. EXPAND.PAK), but in this case you need to write this new name in the EXE as well - search for GERMAN.PAK in the DUNE2.EXE and replace it with any other name you like (make sure the filename length is the same, or shorter - in the latter case, put a zero byte in the end).

Hope this helps (and isn't too messy ;)).

 

Sometimes They Come Back. ;)

I noticed in Dunex Mod the EXPAND.PAK file that contains first scenarios levels (SCENA001.INI, SCENO001.INI, SCENH001.INI) and other compressed files.

When Player start a new campaign by the Choice of Faction, Dunex.exe reads these files (SCENA001.INI, SCENO001.INI, SCENH001.INI) right?

But when player does "Restart Scenario" then Dunex.exe reads first levels about CONQUEST.PAK (SCENM001.INI, SCENF001.INI, SCENS001.INI) right?

How I undestand, the reason for this is that "since you can't enlarge the PAK contents list" as MrFibble said.

But I tried to modify CONQUEST.PAK, unpacked *.INI files and adding some SCENA*.INI files (in addition to all those already existing) and repacking the archive it works too.

So can't you enlarge only any types of PAK?

Link to comment
Share on other sites

Uhh, I'm sorry, I just noticed your post! haven't checked the entire Dune Editing section is quite a while O_o

I noticed in Dunex Mod the EXPAND.PAK file that contains first scenarios levels (SCENA001.INI, SCENO001.INI, SCENH001.INI) and other compressed files.

When Player start a new campaign by the Choice of Faction, Dunex.exe reads these files (SCENA001.INI, SCENO001.INI, SCENH001.INI) right?

But when player does "Restart Scenario" then Dunex.exe reads first levels about CONQUEST.PAK (SCENM001.INI, SCENF001.INI, SCENS001.INI) right?

Yes, that is absolutely correct. The trick here (it's the same as in the original Super Dune 2) is that when you click on a herald on the House selection screen, the game opens the corresponding files (scenario, Mentat face, mission briefing) with the prefix that is defined by the House data (changeable with Nyer's editor). However, once it opens the scenario file, it will load the House that is designated as the human player inside the scenario file, regardless of previous choices. That's how you can access non-playable Houses/factions. You still need a duplicate of the first mission for each new faction, otherwise the game will crash with a file not found error if you try to restart the first mission.
How I undestand, the reason for this is that "since you can't enlarge the PAK contents list" as MrFibble said.

But I tried to modify CONQUEST.PAK, unpacked *.INI files and adding some SCENA*.INI files (in addition to all those already existing) and repacking the archive it works too.

So can't you enlarge only any types of PAK?

Yes, you can add files to the PAK archive. However, those will not be recognized by the game because it uses internal PAK lists in the EXE to identify PAK contents. (On a side note, this logic doesn't seem to apply to VOC files in INTROVOC.PAK but I don't know the details.) Adding too many unrecognised files to a PAK, or, vice versa, deleting files that should be inside from a PAK, may lead to memory issues and crash the game.
Link to comment
Share on other sites

  • 3 weeks later...

From [Dune 2] New campaigns (in progress) Topic:

[...]
2. Unfortunately, the VOC.PAK file is different in the US release and the three-language releases: the unit speech files had been added a "Z" prefix in the three-language version (e.g. REPORT1.VOC -> ZREPORT1.VOC) to allow unit speech in other languages. If you get a wrong version of VOC.PAK, the game will crash soon after you start a mission if digitized speech is enabled*. This is why I had to supply the correct version of VOC.PAK with both SD2Classic and DuneX (renamed into SFX.PAK to avoid replacing the normal Dune II VOC.PAK file).
[...]

I looked about between original Dune2.exe v1.07-EU and your Dunex.exe internal PAK lists.
I don't undestand if SFX.PAK is someway or somewhere still used, because I don't find it in downloaded file lists of Dune2 eXtended (v1.27).
Maybe considering that there aren't any otherside Factions declaring .voc files as regular House declaring .voc files (MATRE.VOC, MHARK.VOC & MORDOS.VOC), does it only need to fill this space in list?

I notice that it isn't very important the order about file list, or not?
But I don't undestand this: there are two CHOAM.CPS files (one in DUNE.PAK that is the original file and one in EXPAND.PAK that is your modified file with new Heralds, both PAKs listed in Dunex.exe); how does the game "understand" that it must take that one in EXPAND.PAK and not in DUNE.PAK, if both PAKs are listed in .exe but CHOAM.CPS is listed once?!?

The same thing about FAME.CPS and MAPMACH.CPS.

 

EDITED: solved by Nyerguds' Editor -> http://forum.dune2k.com/topic/19114-dune-2-dune-ii-editor-with-107-support/page-31

Link to comment
Share on other sites

But I don't undestand this: there are two CHOAM.CPS files (one in DUNE.PAK that is the original file and one in EXPAND.PAK that is your modified file with new Heralds, both PAKs listed in Dunex.exe); how does the game "understand" that it must take that one in EXPAND.PAK and not in DUNE.PAK, if both PAKs are listed in .exe but CHOAM.CPS is listed once?!?

The same thing about FAME.CPS and MAPMACH.CPS.

 

EDITED: solved by Nyerguds' Editor -> http://forum.dune2k.com/topic/19114-dune-2-dune-ii-editor-with-107-support/page-31

Hi, sorry for a late reply yet again. I'm glad you figured it out on your own, but jusn in case someone else has trouble with this, the answer is that by using Nyer's editor you can specify where each of the game's data files is located (e.g. in which PAK file). That way, the game will ignore the old version of a file if the modified EXE says it is located elsewhere.

For an example, if you want to replace the palette file, IBM.PAL, which is normally located inside DUNE.PAK, but you don't want to edit DUNE.PAK itself, you can put your version of IBM.PAL into whatever PAK you want (e.g. INTROVOC.PAK), and then open the EXE of your mode in Nyerguds' editor, located IBM.PAL under the Files section, and change its "parent" PAK file from DUNE.PAK to INTROVOC.PAK. That way, the game will no longer look for IBM.PAL in DUNE.PAK, but in INTROVOC.PAK instead.

I do want to stress that this feature of Nyer's editor really helped a lot to optimize the modified data files of DuneX and SD2Classic, so thanks Nyer for your immeasurable input and help! ^_^

Link to comment
Share on other sites

Totally agree! You mates are wondeful :laugh:

 

Now I'm looking for enable/remove Houses announcement in side selection screen (by 3 Heralds to choose).

I noticed that DuneX have no longer announced MATRE.VOC, MHARK.VOC & MORDOS.VOC files.

MrFlibble, how did you do that?

 

 

UPDATE: Ok, I figured out how to do.

ovr206:1186                   loc_60B46:ovr206:1186 B8 0F 00                          mov     ax, 0Fhovr206:1189 50                                push    axovr206:118A 16                                push    ssovr206:118B 8D 86 EC FC                       lea     ax, [bp+s]                          ; Load Effective Addressovr206:118F 50                                push    axovr206:1190 9A 00 00 A3 33                    call    screenFadeOut                       ; Call Procedureovr206:1195 83 C4 06                          add     sp, 6                               ; Addovr206:1198 E9 11 03                          jmp     mentatShow                          ; Jumpovr206:119B                   ; ---------------------------------------------------------------------------ovr206:119Bovr206:119B                   loc_60B5B:                                                  ; CODE XREF: selectTeam+1D4jovr206:119B 83 3E 1B 6E 00                    cmp     soundEnabled?, 0                    ; Compare Two Operandsovr206:11A0 74 17                             jz      short loc_60B79                     ; Jump if Zero (ZF=1)ovr206:11A2 8B C6                             mov     ax, siovr206:11A4 05 3E 00                          add     ax, 3Eh ; '>'                       ; Addovr206:11A7 50                                push    axovr206:11A8ovr206:11A8                   loc_60B68:                                                  ; Call Procedureovr206:11A8 9A 2A 00 86 42                    call    j_soundTableLoadovr206:11AD 59                                pop     cxovr206:11AEovr206:11AE                   loc_60B6E:                                                  ; Jumpovr206:11AE EB 00                             jmp     short 2ovr206:11B0

Just set EB (jmp) instead 74 (jz) in ovr206:11A0; so bypass check about don't reproduce sound if variable is disabled.

 

 

 

Another question:

Your Dunex.exe file is a v1.07-EU (Battle for Arrakis), right?

I tried Dune 2 v1.07-EU, Dune 2 v1.07-US & Dune 2 v1.07-HS, all these versions have own Mentat alerts that says: "ENEMY unit..." or "ENEMY construction ..." for factions different than your own; in Dunex.exe Mentat alerts says  %c[HOUSE].VOC  instead of "ENEMY.VOC": %c means the letter of House (A, O or H) and [HOUSE] should be ATRE, HARK, ORDOS, FREMEN, MERC, SARD... so also refering for other different factions that your own, House name is always declared.

What about to set it?

  • Upvote 1
Link to comment
Share on other sites

UPDATE: Ok, I figured out how to do.
ovr206:1186                   loc_60B46:ovr206:1186 B8 0F 00                          mov     ax, 0Fhovr206:1189 50                                push    axovr206:118A 16                                push    ssovr206:118B 8D 86 EC FC                       lea     ax, [bp+s]                          ; Load Effective Addressovr206:118F 50                                push    axovr206:1190 9A 00 00 A3 33                    call    screenFadeOut                       ; Call Procedureovr206:1195 83 C4 06                          add     sp, 6                               ; Addovr206:1198 E9 11 03                          jmp     mentatShow                          ; Jumpovr206:119B                   ; ---------------------------------------------------------------------------ovr206:119Bovr206:119B                   loc_60B5B:                                                  ; CODE XREF: selectTeam+1D4jovr206:119B 83 3E 1B 6E 00                    cmp     soundEnabled?, 0                    ; Compare Two Operandsovr206:11A0 74 17                             jz      short loc_60B79                     ; Jump if Zero (ZF=1)ovr206:11A2 8B C6                             mov     ax, siovr206:11A4 05 3E 00                          add     ax, 3Eh ; '>'                       ; Addovr206:11A7 50                                push    axovr206:11A8ovr206:11A8                   loc_60B68:                                                  ; Call Procedureovr206:11A8 9A 2A 00 86 42                    call    j_soundTableLoadovr206:11AD 59                                pop     cxovr206:11AEovr206:11AE                   loc_60B6E:                                                  ; Jumpovr206:11AE EB 00                             jmp     short 2ovr206:11B0
Just set EB (jmp) instead 74 (jz) in ovr206:11A0; so bypass check about don't reproduce sound if variable is disabled.

You might also be interested in the following code chunks. The first one loads the voices from MERC.PAK into memory when the House selection screen appears:

ovr189:2151                   loc_55111:                                                  ; filebuf::terminate(void)ovr189:2151 26 FF 1E F4 66                    call    es:off_49B14ovr189:2156ovr189:2156                   loc_55116:                                                  ; Addovr189:2156 83 C4 0A                          add     sp, 0Ahovr189:2159ovr189:2159                   loc_55119:                                                  ; Compare Two Operandsovr189:2159 83 7E FE 00                       cmp     [bp+var_2], 0ovr189:215Dovr189:215D                   loc_5511D:                                                  ; Jump if Not Zero (ZF=0)ovr189:215D 75 0A                             jnz     short loc_55129ovr189:215Fovr189:215F                   loc_5511F:ovr189:215F B8 05 00                          mov     ax, 5ovr189:2162ovr189:2162                   loc_55122:ovr189:2162 50                                push    axovr189:2163
In Super Dune 2, this becomes a problem since the Mercenaries get a full-scale set of speech, which takes up a lot of memory.

And this one tells the game that it should load Mercenary voices in the first place (so that by editing this, you can change it to some other House's voice):

ovr206:0FB1                   loc_60971:ovr206:0FB1 8B EC                             mov     bp, spovr206:0FB3 81 EC 14 03                       sub     sp, 314h                            ; Integer Subtractionovr206:0FB7 56                                push    siovr206:0FB8 57                                push    diovr206:0FB9 BE 05 00                          mov     si, 5ovr206:0FBCovr206:0FBC                   loc_6097C:ovr206:0FBC C7 46 FC 00 00                    mov     word ptr [bp+var_6+2], 0ovr206:0FC1ovr206:0FC1                   loc_60981:ovr206:0FC1 C7 46 FA 00 00                    mov     word ptr [bp+var_6], 0ovr206:0FC6 B8 00 03                          mov     ax, 300hovr206:0FC9 50                                push    ax                                  ; novr206:0FCA 33 C0                             xor     ax, ax                              ; Logical Exclusive ORovr206:0FCC 50                                push    ax                                  ; covr206:0FCD 16                                push    ssovr206:0FCEovr206:0FCE                   loc_6098E:                                                  ; Load Effective Addressovr206:0FCE 8D 86 EC FC                       lea     ax, [bp+s]ovr206:0FD2ovr206:0FD2                   loc_60992:                                                  ; sovr206:0FD2 50                                push    axovr206:0FD3ovr206:0FD3                   loc_60993:                                                  ; Call Procedureovr206:0FD3 9A 47 29 00 10                    call    _memsetovr206:0FD8ovr206:0FD8                   loc_60998:                                                  ; Addovr206:0FD8 83 C4 08                          add     sp, 8ovr206:0FDB 33 C0                             xor     ax, ax                              ; Logical Exclusive ORovr206:0FDDovr206:0FDD                   loc_6099D:                                                  ; Logical Exclusive ORovr206:0FDD 33 D2                             xor     dx, dxovr206:0FDF 50                                push    axovr206:0FE0ovr206:0FE0                   loc_609A0:ovr206:0FE0 52                                push    dxovr206:0FE1ovr206:0FE1                   loc_609A1:                                                  ; Call Procedureovr206:0FE1 9A 25 02 DA 2B                    call    sub_2BFC5ovr206:0FE6 59                                pop     cxovr206:0FE7 59                                pop     cxovr206:0FE8 B8 05 00                          mov     ax, 5ovr206:0FEB 50                                push    axovr206:0FEC 9A 34 00 86 42                    call    sub_42894                           ; Call Procedureovr206:0FF1 59                                pop     cx
In both cases, you need to change the variable that is set to 5 to get another House (0 - Harkonnen, 1 - Atreides, 2 - Ordos, 3 - Fremen, 4 - Sardaukar).
Another question:

Your Dunex.exe file is a v1.07-EU (Battle for Arrakis), right?

I tried Dune 2 v1.07-EU, Dune 2 v1.07-US & Dune 2 v1.07-HS, all these versions have own Mentat alerts that says: "ENEMY unit..." or "ENEMY construction ..." for factions different than your own; in Dunex.exe Mentat alerts says  %c[HOUSE].VOC  instead of "ENEMY.VOC": %c means the letter of House (A, O or H) and [HOUSE] should be ATRE, HARK, ORDOS, FREMEN, MERC, SARD... so also refering for other different factions that your own, House name is always declared.

What about to set it?

I edited the EXE to get this working. The game plays the ENEMY.VOC files in the first two missions, so there's a code exception that handles this behaviour. IIRC it's this one:

seg031:0C86                   loc_28FE6:                                                  ; Call Procedureseg031:0C86 E8 A1 29                          call    near ptr unitGameHouseIDGetseg031:0C89 59                                pop     cxseg031:0C8A 59                                pop     cxseg031:0C8B 3B 06 2C 3A                       cmp     ax, houseHumanID                    ; Compare Two Operandsseg031:0C8F 74 07                             jz      short notHuman                      ; Jump if Zero (ZF=1)seg031:0C91 83 3E A6 38 03                    cmp     missionNumberPrevious, 3            ; Compare Two Operandsseg031:0C96 7E 12                             jle     short loc_2900A                     ; Jump if Less or Equal (ZF=1 | SF!=OF)seg031:0C98seg031:0C98                   notHuman:                                                   ; CODE XREF: unitTakeDamage+117jseg031:0C98 FF 76 08                          push    word ptr [bp+unitGamePtr+2]seg031:0C9B FF 76 06                          push    word ptr [bp+unitGamePtr]           ; unitGamePtrseg031:0C9E 90                                nop                                         ; No Operationseg031:0C9F 0E                                push    csseg031:0CA0 E8 87 29                          call    near ptr unitGameHouseIDGet         ; Call Procedureseg031:0CA3 59                                pop     cxseg031:0CA4 59                                pop     cxseg031:0CA5 05 0E 00                          add     ax, 0Eh                             ; Addseg031:0CA8 EB 03                             jmp     short soundPlay                     ; Jump
To make the game use enemy House names in every mission, just disable the jump that is tied to the missionNumberPrevious parameter.
Link to comment
Share on other sites

Many thanks!

I never imagined that there was an exception about Mentat alerts on previous missions.

I should start again playing seriously in Dune 2 campaigns. :)

Only a note: missionNumberPrevious means number of reference scenario, right?

Otherwise I can't explain why jle condition should be include only first two missions and not first three ones.

 

 

Moreover I thought a crazy idea: if I change 05 HouseID to a greater number (06 or more) to define on game another letter about in starting side selection heralds screen, can I set this ID to a real letter to use in MERC.PAK voc files with this letter?

 

i.e. if I set 06 HouseID to refer K letter, can I set KATRE.VOC, KHARK.VOC & KORDOS.VOC into MERC.PAK to be read in starting side selection screen?

Link to comment
Share on other sites

Only a note: missionNumberPrevious means number of reference scenario, right?

Otherwise I can't explain why jle condition should be include only first two missions and not first three ones.

Actually, I don't remember if the missionNumberPrevious variable name is 100% correct in this case.
Moreover I thought a crazy idea: if I change 05 HouseID to a greater number (06 or more) to define on game another letter about in starting side selection heralds screen, can I set this ID to a real letter to use in MERC.PAK voc files with this letter?

 

i.e. if I set 06 HouseID to refer K letter, can I set KATRE.VOC, KHARK.VOC & KORDOS.VOC into MERC.PAK to be read in starting side selection screen?

The question is, how are you going to setup houses with IDs above 5? I don't even know if there are sections in the EXE for that.

For the regular Houses, the starting letter of the speech files is determined in the section which is editable via Nyer's editor (in the "Houses" section). However, the starting letters for languages other than English (F for french and G for German) are determined elsewhere.

Link to comment
Share on other sites

I believe that House announcement (i.e. "House Atreides" female voice) it's a pointing device that calls the masks %cHARK.VOC for right herald position, %cATRE.VOC for left herald position, %cORDOS.VOC for central herald position.

I noticed it because of changing Mercenary letter M to O: the announcements belonged to House alerts VOCs into ORDOS.PAK.

I would like to find a way to define a new position about these announcements to point no more on actual masks, but somewhere else in .EXE file hex editing. So I could define even new file names about these VOCs.

Link to comment
Share on other sites

I'm not sure I fully understand your intention. If you wish to replace the MATRE.VOC etc. files with something else, you could just edit the MERC.PAK contents.

There are actually traces of separate sound files in the EXE that were apparently intended to play during House selection - they are right after House name strings, and visible via Nyer's editor IIRC. But to the best of my knowledge, those are never used in the game.

Anyway, I imagine that you wish to restore proper House announcements in the case when the Mercenaries already use the Ordos (or other) speech pack. If that is the case, you can simply switch the announcer to another, currently unused House. I think this is how I did that in SD2Classic. I've posted the relevant piece of code above (the first chunk), so you just edit this segment:

ovr189:215F                   loc_5511F:
ovr189:215F B8 05 00 mov ax, 5

Change 05 to whatever other House ID you want, and the game will use the sounds of that House for the House selection screen.

Link to comment
Share on other sites

Yes it's a possibility.

But if you imagined to use all 6 factions (starting with original Houses: A, O, H) into Scenarios campaigns (i.e. use Mercenary Brain=Human in a certain SCENO###.INI), if you set a faction to use MERC.PAK, in-game Mercenary Mentat alerts are no longer available since they are only inside ATRE.PAK, ORDOS.PAK & HARK.PAK.

 

Now we know that changing this 05 HouseID you can "say" to game to take letter specified in another HouseID setting, but I thought to use this MERC.PAK files in a different way to preserve A, O, H alerts Mentat VOCs ingame for all 6 factions potentially usable.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.