Unknown ship stats pop-up bug (fix)

Unknown ship stats pop-up bug (fix); support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Unknown ship stats pop-up bug (fix)

Post by DCER » Wed Oct 22, 2008 6:58 pm

Ok, I'm posting a fix here and later two screenshots showing the difference.

The solution is a bit complicated as I had to add code that checks whether the ship is unknown or not. The downside is that to get space I had to disable and overwrite 3 error checks. These are: Shipbox != Null, Widget != Null and ShipclassMem Is Null

Ok, here's the fix. The assembly instructions are from IDA 5 Pro, they are there for double checking.

before -> after

Code: Select all

1.Remove ShipBox error message

At 0x17FC28 fill with 15x 0x00

2.Disable error message at 0x13D208
	
	75 1C  -> EB 1C

	jnz short loc_53DE26 -> jmp short loc_53DE26
	
3.Change code flow at 0xEC14A

	0F 84 14 01 00 00 -> E9 BB 10 05 00 90

	jz loc_4ECE64  -> jmp loc_53DE0A, nop

4.Overwrite error message at 0x13D20A

	BB 24 7A 58 00 BA 47 00 00 00 B8 34 7A 58 00 E8 92 A3 FC FF 85 
	C0 74 04 85 C9 74 E4

	->

	89 2D 28 1E 58 00 0F 84 4E F0 FA FF E9 35 EF FA FF B8 71 05 00 
	00 E8 BB D4 F4 FF C3

	mov     ebx, offset aWidgetNull
	mov     edx, 47h
	mov     eax, offset aWidget_c
	call    sub_5081B0
	test    eax, eax
	jz      short loc_53DE26
	test    ecx, ecx
	jz      short loc_53DE0A

	->
	
	mov offsetShipboxNull, ebp 	; stores whether this ship is unknown for later use
	jz loc_4ECE64		; if 0 load normal image else load ufo image
	jmp loc_4ECD50
	mov eax, 571
	call sub_48B2E0
	retn
	

5.Disable error message at 0x6EDD0

	75 A1 -> EB 1A

	jnz short loc_46F9EC -> jmp short loc_46F9EC

6.Overwrite error message at 0x6EDD2

	BE 2C AD 57 00 BB EC AD 57 00 BA 2D 01 00 00 89 F0 E8 C8 87 09 00 85 C0 75 EB

	->

	E8 44 E4 0C 00 50 8D 44 24 04 50 E8 B7 43 0A 00 83 C4 08 E9 36 B9 07 00 90 90

	mov     esi, offset a____SourceG_22 
	mov     ebx, offset aShipclassmemIs
	mov     edx, 12Dh
	mov     eax, esi
	call    sub_5081B0
	test    eax, eax
	jnz     short loc_46F9D7

	->

	call sub_53DE1B
	push eax
	lea eax, [esp + 04h]
	push eax
	call sprintf_
	add esp, 8
	jmp loc_4EB320
	2x nop

7.Disable error message at 0xEC043

	75 1C -> EB 1C

	jnz short loc_4ECC61 -> jmp short loc_4ECC61

8.Overwrite error message at 0xEC045

	BB 28 1E 58 00 BA 2B 03 00 00 B8 AC 1D 58 00 E8 57 B5 01 00 85 C0 74 04 85 F6 74 E4
	
	->

	83 3D 28 1E 58 00 00 0F 85 80 2D F8 FF 8B 94 24 A8 02 00 00 E9 14 E6 FF FF 90 90 90

	mov ebx, ds:aShipboxNull
	mov edx, 32Bh
	mov eax, offset a____SourceU_71
	call sub_5081B0
	test eax, eax
	jz short loc_4ECC61

	->

	cmp ds:aShipboxNull, 0
	jnz loc_46F9D2
	mov edx, [esp + 2A8h]
	jmp loc_4EB272
	3x nop

9.Change code flow at 0xEA66B

	8B 94 24 A8 02 00 00 -> E9 D5 19 00 00 90 90

	mov     edx, [esp + 2A8h]

	->

	jmp loc_4ECC45
	2x nop
Last edited by DCER on Thu Oct 23, 2008 3:39 am, edited 1 time in total.

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER » Wed Oct 22, 2008 7:09 pm

Screenshot before:



Screenshot after:

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2538
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke » Thu Oct 23, 2008 4:13 pm

Cool, great work DCER! :D
Spocks-cuddly-tribble wrote:Unfortunately klingon/ferengi controle is still shown by the deviating experience stars.
Well, the experience images could just be changed to a single version, if there's no other solution.

stardust
Rear-Admiral
Rear-Admiral
Posts: 1381
Joined: Sat Apr 26, 2008 2:00 am
Location: good ole Blighty

Post by stardust » Thu Oct 23, 2008 4:47 pm

Flocke wrote: Well, the experience images could just be changed to a single version, if there's no other solution.
Id'd make more sense doing this as you wouldn't know what the crew exp is if you don't even know what race built the ship at the time.
Computers! [Expletive deleted]

My 4shared folder

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER » Sat Oct 25, 2008 4:25 am

This will disable the experience bar for ships that you don't own.

Code: Select all

10.Replace owner check with one checking for player empire at 0xEC1CB

	66 83 FA 05 0F 83 08 01 00 00 31 C0

	->

	3A 15 2A 2B 5A 00 0F 85 44 00 00 00

	cmp     dx, 5
	jnb     loc_4ECEDD
	xor     eax, eax

	->

	cmp     dl, ds:byte_5A2B2A
	jnz     loc_4ECE1B
If there's demand I can look into disabling the pop-up info for ships you don't own as well not just the unknown ones.

EDIT: I can also look into the experience bar be disabled only for unknown ships

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 721
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble » Sat Oct 25, 2008 4:26 pm

Bitten with enthusiasm again.:)
DCER wrote:If there's demand I can look into disabling the pop-up info for ships you don't own as well not just the unknown ones.
That's not much important to me and would only hide the damage status, wich is still shown by the bar below the pic.
DCER wrote:EDIT: I can also look into the experience bar be disabled only for unknown ships
I think it's already great as you did it. Since it's unrealistic to read crew experience via long range sensor.


Unknown Outpost/Starbase (or monster) disabling on F1 map would be great. But I don't belief in that's possible.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER » Sat Oct 25, 2008 6:44 pm

nothing's impossible ;) but probably much harder to do :(

User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Unknown ship stats pop-up bug (fix)

Post by EnPhreg » Sat Jan 12, 2019 10:11 am

a little bug from vanilla that's still active:
if you met unknown minor ships, the f1 map task force counter pop-up (if you hover over the small unknown icon in a sector on f1 map) has two lines (instead of normal one line) and shows:
minor ship name
1 unknown unit

if you know the minor race already, it only shows the ship name without the task force counter.

Post Reply

Return to “Unknown ship stats pop-up bug (fix)”

Who is online

Users browsing this forum: No registered users