Jump to content

jordos

Fremen
  • Posts

    40
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • Location
    westmeerbeek
  1. Also try changing the keyboard layout in the DOSbox config if you haven't yet.
  2. jordos

    OpenDune

    I'm so hardcore I grew up with windows and later switched to DOS 8)
  3. Here you go :) (in the structurebuildlistcreate function) seg010:1C74 loc_1C0A4: ; Check House seg010:1C74 26 80 7F 08 00 cmp es:[bx+_buildingGame.houseID], 0 seg010:1C79 74 08 jz short loc_1C0B3 ; Jump if house=harkonnen seg010:1C7B seg010:1C7B loc_1C0AB: ; Check building type seg010:1C7B 83 FE 03 cmp si, 3 seg010:1C7E 75 03 jnz short loc_1C0B3 ; Jump if building is not light factory seg010:1C80 seg010:1C80 loc_1C0B0: seg010:1C80 BF 02 00 mov di, 2 ; Change tech level to 2 Pretty much exactly what Daelin suggested.
  4. It probably doesn't help that the alignment is messy even inside the code tags :) edit: Ok, I've looked into the problem with the sardaukar quad (it was late when I posted yesterday), looks like the problem is that it still checks the tech prerequisite after replacing the unit in the build list. So an unupgraded light factory with a trike replaced by a quad will just get that unbuildable carryal instead. I'll have to find another solution for the sardaukar quad :( Anyway, I found no problems using the settings in nyer's program to give the raider trike to house ordos, so if you have another idea for this exception, here is the hex string you need to search for: 0D 75 0F C4 5E 06 26 83 7F 47 02 75 05 C7 46 EE 0E 0D: the trike unit ID. I suppose you could change it to 0F to replace the quad instead. Edit2: or any unit really, looks like there is no 'factory check' beforehand! 02: house id, 0=harkonnen, 1= atreides, 2=ordos, 3=fremen, 4=sardaukar, 5 = mercenary (not sure about those last three) 0E: unit ID to replace it with (to get the number, count the unit list in nyer's editor, thopter is 0, carryall is 1 etc etc... Then convert to hex). Just make sure the unit 'upgrades needed' setting matches the unit you're replacing.
  5. Luckily Segra also found this exception, it's in the StructureBuildListCreate function seg010:1D5D loc_1C18D: ; CODE XREF: structureBuildListCreate:loc_1C188j seg010:1D5D 83 7E EE 0D cmp word ptr [bp+buildingDataPtr2+2], 0Dh ; constructOptN seg010:1D61 75 0F jnz short loc_1C1A2 ; Jump if Not Zero (ZF=0) seg010:1D63 seg010:1D63 loc_1C193: ; Load Full Pointer to ES:xx seg010:1D63 C4 5E 06 les bx, [bp+buildingGamePtr] seg010:1D66 26 83 7F 47 02 cmp word ptr es:[bx+47h], 2 ; Compare Two Operands seg010:1D6B 75 05 jnz short loc_1C1A2 ; if(constructOpt == trike) seg010:1D6B ; constructOpt = raidertrike; seg010:1D6D C7 46 EE 0E 00 mov word ptr [bp+buildingDataPtr2+2], 0Eh If the item is a trike (0D) and house is ordos (02) then use the raider trike (0E) instead. I'm going to replace this one with a sardaukar quad, and use nyer's editor to add the raider trike for house ordos instead. Will let you know if anything weird happens when playing house ordos. edit: well guess I'm doing something wrong. I change the 2 (house ID) to 3 and 0E (unit ID) to 0F, but nothing happens against an AI sardaukar and if I set the sardaukar as Human instead of CPU in the scenario the game crashes.
  6. You're right :) Actually why did they turn the raider trike into a code exception? It's easy enough to do with the existing parameters in Nyerguds editor, no?
  7. Sure, I'll post the IDA code as well so someone with some experience can tell me if I've done something stupid :) I (or rather, segra) found a check for the trooper squad and infantry squad in the UnitTakeDamage function. seg031:0D66 loc_290C6: ; CODE XREF: unitTakeDamage+1DAj seg031:0D66 C4 5E 06 les bx, [bp+unitGamePtr] ; Load Full Pointer to ES:xx seg031:0D69 26 80 7F 02 05 cmp byte ptr es:[bx+2], 5 ; troopers seg031:0D6E 74 0A jz short TrooperInfantry ; Jump if Zero (ZF=1) seg031:0D70 C4 5E 06 les bx, [bp+6] ; Load Full Pointer to ES:xx seg031:0D73 26 80 7F 02 04 cmp byte ptr es:[bx+2], 4 ; infantry seg031:0D78 75 79 jnz short loc_29153 ; Jump if Not Zero (ZF=0) if true it does some misc stuff I can't figure out but just assumed was the soldier spawning code (I saw some references to the hit points :) ). I just skip it by patching in a jump to the code that follows it, which I guessed was the retreat check since it compares against the house weakness which segra told us is also used for that. g031:0D7A TrooperInfantry: ; CODE XREF: unitTakeDamage+1F6j seg031:0D7A EB 46 jmp short loc_29122 ; Jump seg031:0D7A ; --------------------------------------------------------------------------- seg031:0D7C 06 db 6 seg031:0D7D ; --------------------------------------------------------------------------- seg031:0D7D 26 8A 47 02 mov al, es:[bx+2] seg031:0D81 04 02 add al, 2 ; Add seg031:0D83 C4 5E 06 les bx, [bp+unitGamePtr] ; Load Full Pointer to ES:xx seg031:0D86 26 88 47 02 mov es:[bx+_unitGame.typeIndex], al seg031:0D8A C4 5E 06 les bx, [bp+unitGamePtr] ; Load Full Pointer to ES:xx seg031:0D8D 26 8A 47 02 mov al, es:[bx+_unitGame.typeIndex] seg031:0D91 98 cbw ; AL -> AX (with sign) seg031:0D92 BA 5A 00 mov dx, size _unitData seg031:0D95 F7 EA imul dx ; Signed Multiply seg031:0D97 05 00 00 add ax, 0 ; Add seg031:0D9A C7 46 FE 0B 3B mov word ptr [bp+unitDataPtr+2], seg seg130 seg031:0D9F 89 46 FC mov word ptr [bp+unitDataPtr], ax seg031:0DA2 C4 5E FC les bx, [bp+unitDataPtr] ; Load Full Pointer to ES:xx seg031:0DA5 26 8B 47 10 mov ax, es:[bx+_unitData.HitPoints] seg031:0DA9 C4 5E 06 les bx, [bp+unitGamePtr] ; Load Full Pointer to ES:xx seg031:0DAC 26 89 47 0E mov es:[bx+_unitGame.HitPoints], ax seg031:0DB0 FF 76 08 push word ptr [bp+unitGamePtr+2] seg031:0DB3 FF 76 06 push word ptr [bp+unitGamePtr] ; unitGamePtr seg031:0DB6 B8 02 00 mov ax, 2 seg031:0DB9 50 push ax ; funcPtrIndex seg031:0DBA 9A 8E 00 D0 42 call j_sub_566CF ; Call Procedure seg031:0DBF 83 C4 06 add sp, 6 ; Add The retreat code it jumps to: g031:0DC2 loc_29122: ; CODE XREF: unitTakeDamage:TrooperInfantryj seg031:0DC2 9A 0E 00 B8 39 call mapSeedRandomGet ; Call Procedure seg031:0DC7 25 FF 00 and ax, 0FFh ; Logical AND seg031:0DCA seg031:0DCA loc_2912A: ; Load Full Pointer to ES:xx seg031:0DCA C4 5E 06 les bx, [bp+unitGamePtr] seg031:0DCD seg031:0DCD loc_2912D: seg031:0DCD 50 push ax seg031:0DCE seg031:0DCE loc_2912E: seg031:0DCE 26 8A 47 08 mov al, es:[bx+_unitGame.houseID] seg031:0DD2 seg031:0DD2 loc_29132: ; AL -> AX (with sign) seg031:0DD2 98 cbw seg031:0DD3 seg031:0DD3 loc_29133: seg031:0DD3 BA 1E 00 mov dx, size _houseData seg031:0DD6 seg031:0DD6 loc_29136: ; Signed Multiply seg031:0DD6 F7 EA imul dx seg031:0DD8 seg031:0DD8 loc_29138: seg031:0DD8 8B D8 mov bx, ax seg031:0DDA seg031:0DDA loc_2913A: seg031:0DDA 58 pop ax seg031:0DDB 3B 87 F0 37 cmp ax, houseData.Weakness[bx] ; Compare Two Operands seg031:0DDF 73 12 jnb short loc_29153 ; Jump if Not Below (CF=0) seg031:0DE1 B8 02 00 mov ax, 2 seg031:0DE4 50 push ax ; action seg031:0DE5 FF 76 08 push word ptr [bp+unitGamePtr+2] seg031:0DE8 FF 76 06 push word ptr [bp+unitGamePtr] ; unitGamePtr seg031:0DEB 9A 05 00 6F 25 call unitActionstart ; Call Procedure seg031:0DF0 83 C4 06 add sp, 6 ; Add To patch it, search the exe for 02 75 79 C4 5E 06 26 8A and change it to 04 75 79 EB 46 06 26 8A (I hope that's right) About the sardaukar light factory, most likely I'll have to replace another exception for that. (house of WOR springs to mind, tech level 5? Come on ::) ) unless there's some kind of mathematical formula that can check both the Harkonnen and Sardaukar house ID in one line.
  8. Thanks Nyerguds, I actually have some extremely basic knowledge of assembly and managed it myself. I also successfully removed the code that turned squads into single soldiers at 50% hp (I replaced the single soldiers with the Fremen&Sardaukar troopers :) ), keeping the retreat check. I was quite proud of that one. :D But trying to answer Flibble's post I realize I actually don't have a clear idea of what changes I'd like to do yet. For now I wanted to make the Sardaukar light factory start upgraded just like the Harkonnen (and also keep the harkonnen upgraded light factory). With or without trike doesn't matter. But the other tech tree stuff in that post seems to be aimed at not displaying the upgrade button if certain conditions are met (that's just a guess, I really can't make much of assembly code) I'll probably have to replace one of the other exceptions but I'm sure I'll find one suitable for that.
  9. Ah brilliant, many thanks! I thought I had checked all of segra's posts but guess I wasn't very thorough. edit: still don't understand how those exceptions work though :) the ordos heavy factory and harkonnen light factory ones are obvious but the others...
  10. Segra, where in your Dune2 IDA database are those house specific techtree exceptions? I think I've found a few in the structurebuildlistcreate function but I don't really understand how they work. Also, you posted some information on the worms disappearing after three swallows but would you mind telling me what to change exactly to disable it? Many thanks!
  11. Looking at Segra's IDA database I found this after a switch jump based on weapon type, in the ScriptunitAttack function. (just before this it does the distance check for troopers but all that happens there is that the weapon type is set to 16h (minirockets) if greater than 200h MiniRocket: ; case 0x16 mov ax, [bp+weaponDamage] mov cl, 2 sar ax, cl ; Shift Arithmetic Right loc_26ECD: ; Integer Subtraction sub [bp+weaponDamage], ax I don't know what that bitshift does in effect but that substraction seems to suggest the rockets do less damage. After this it jumps to the rocket weapon type where lots of other things happen though, so I'll have to wait for someone with proper asm skills to be sure. :) Unrelated question: I can't seem to place any walls with duneedit, I'm fairly sure this was posted somewhere in this, or in the dune editing forum but I'm having problems finding it. An explanation of the various unit commands (ambush etc) would be helpful too!
  12. Hey all, I was wondering if anyone knew if the long-range rockets the troopers use actually do more damage than the short range machinegun? Or is the difference purely graphical? Also, WTF is house of WOR? :)
  13. Just a minor remark, but have you found the score requirements for the ranks yet? Looks like you'll attain the highest possible rank after playing just a few missions with these kind of large scale battles :)
  14. I believe (though I haven't done any extensive testing) that Unknown 44 in the Units section of Nyerguds' editor is the (in)accuracy (in tiles?) of the missile tank&deviator. It is set to 11 on the Death Hand 'unit', but it is quite possible it has a different function for the 'weapon units'.
×
×
  • Create New...