Unrest Orders (turn delay & limitations)

Unrest Orders (turn delay & limitations); support/discussion/questions

Moderator: thunderchero

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

Unrest Orders (turn delay & limitations)

Post by Spocks-cuddly-tribble »

Since I can't remember if this already has been posted somewhere on the forums:

Code: Select all

sub_43A6D4 unrest_order_turn_delay:

0043A706                 mov     eax, 3    // card
0043A70C                 mov     eax, 4   // kling/rom -> shared
0043A712                 mov     eax, 5   // fed/fer -> shared

sub_45FCE0 unrest_order_effect:

0045FD74                 add     eax, edx  // current morale + unrest order edifice.bst output
0045FD76                 xor     edx, edx
0045FD78                 mov     dx, [ebx+2F0h]  // base morale
0045FD7F                 cmp     eax, edx   // if greater than base morale 
0045FD81                 jge     loc_45FE93 // set morale = base morale
...
0045FD9C                 jl      short loc_45FD3C  // continue with order if result still lower than base morale
Reason for posting this are some older requests for buildings resp. a system feature with temporary effect (e.g. increasing research or intel). :idea:

So if anyone wants to mess with this they now know where to look for reference codes. Hacking ordInfo is required, of course (also for the 1 Item per turn limitation).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2071
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Unrest Orders (turn delay & limitations)

Post by Tethys »

Additional info regarding what empire uses which turn delay (useful for changing who shares)

race_turn_delay

Code: Select all

0043A6C0	0x39ac0			dd offset		06 A7 43 00	// Card
0043A6C4	0x39ac4			dd offset		12 A7 43 00	// Fed
0043A6C8	0x39ac8			dd offset		12 A7 43 00	// Ferg
0043A6CC	0x39acc			dd offset		0C A7 43 00	// Kling
0043A6D0	0x39ad0			dd offset		0C A7 43 00	// Rom
Used in conjunction with:

Code: Select all

sub_43A6D4 unrest_order_turn_delay:

0043A706                 mov     eax, 3    // card
0043A70C                 mov     eax, 4   // kling/rom -> shared
0043A712                 mov     eax, 5   // fed/fer -> shared
Furthermore, there *appears* to be 8 free bytes after the 3 race delay mov's, and only 6 bytes are needed to create a race delay entry.. you see where I'm going... ;)


EXPERIMENTAL ! NOT TESTED

Code: Select all

0043A718                 mov     eax, 2   	// tbd

At 0x39b18 replace: 	00 00 00 00 00 00 	with		B8 02 00 00 00 C3
Now you must change one of the race_turn_delay offset locations to match this new location. If you wanted to give Ferengi a value of 2 (stimulus packages for all subjects of the Nagus!), you would navigate:

Code: Select all

At 0x39ac8 replace:	12	with		18
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 873
Joined: Sun Apr 27, 2008 2:00 am

Re: Unrest Orders (turn delay & limitations)

Post by Spocks-cuddly-tribble »

Or you can go to town with custom values :wink:

At 0x39AFF enter:

Code: Select all

0043A6FF   8A0485 C0A64300   MOV AL,BYTE PTR DS:[EAX*4+43A6C0]
0043A706   C3                RETN
0043A707   90                NOP
0043A708   90                NOP
0043A709   90                NOP
0043A70A   90                NOP
And enter custom turn delays at old jump table 43A6C0 i.e. 0x39AC0 (card-rom) four bytes each
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “Unrest Orders (turn delay & limitations)”