Page 1 of 1

Unlocking Empire Borders for all Treaties

Posted: Mon Aug 29, 2011 7:04 pm
by Spocks-cuddly-tribble
Tethys wrote:could you find a way to keep empire borders unlocked after signing a non aggression treaty?
That's easy via empsInfo or sector.lst. Code locations are known from ferengi trade route code & territorial claims -projects.

This should work for non aggression & friendship:

Code: Select all

45F031                 jnz     45F103 // remove this

Re: Standard Trek.exe IDA Database

Posted: Tue Aug 30, 2011 12:07 am
by Tethys
Thank you SCT this seems to allow entry regardless of treaty status. Interestingly enough the AI does not send any messages regarding my intrusion, but the sympathy toward me does go down 1 bar per 2 turns my ship is in their territory. :D

Re: Standard Trek.exe IDA Database

Posted: Tue Aug 30, 2011 12:31 pm
by thunderchero
Spocks-cuddly-tribble wrote:

Code: Select all

45F031                 jnz     45F103 // remove this
he is suggesting this

at 0x5e431

0F 85 CC 00 00 00

to

90 90 90 90 90 90

thunderchero

Unlocking Empire Borders Options

Posted: Tue Mar 20, 2012 3:53 pm
by Peter1981

Code: Select all

In trek.exe:
0045F02D                 cmp     dword ptr [esi+64h], 2   // compare treaty type
0045F031                 jnz     loc_45F103                     // jump if not affiliation

:roll: Sorry to ask what I'm sure is a very noobish (pakled) asm question but here goes:

:arrow: AFAICT this is the test for treaty type that has locked boarders, in this case both non-aggression and friendship have locked boarders.

Am I correct in assuming that:
  • 00 = Non-Aggresion
    01 = Friendship
    02 = Affiliation
EDIT:
  • 03 = Alliance (?)
So as i understand it changing 02 to 00 would lock the boarders for friendship and affiliation trieties.
changing the jnz (0F 85) to a jz (0F 84) and would make the locked boarders only for affiliation trieaties I think.

Further: I'd like to include a race id test for 02 ferengi (TOS MOD Tholians) so that affiliation treaties with this race would have locked boarders. ie 02 territory is locked but 02 ships can enter affiliate's territory -- this would certainly be more in character for the tholians in the TOS MOD. Sadly there seems to be very little space to put the code in; so i'm guessing mor of a re-write job and that where i fall down as i'm not competent to make that kind of change.

Re: Unlocking Empire Borders for all Treaties

Posted: Tue Mar 20, 2012 4:23 pm
by Tethys
I would also like to report that if you are bombing a system you are at war with and sign a non agression, your ships co0ntinue to bomb the system and also it DOES kill population. Goes without saying that the ships do not return to friendly space once treeaty is signed.

Re: Unlocking Empire Borders for all Treaties

Posted: Tue Mar 20, 2012 5:46 pm
by Peter1981
interesting -> has anyone ever managed to test being at war and then getting an affiliation treaty in vanilla; is this even posible?

Re: Unlocking Empire Borders Options

Posted: Thu Mar 22, 2012 3:16 pm
by Spocks-cuddly-tribble
Peter1981 wrote:I'd like to include a race id test for 02 ferengi (TOS MOD Tholians) so that affiliation treaties with this race would have locked boarders. ie 02 territory is locked but 02 ships can enter affiliate's territory
Most of your assumptions are correct. Sub_45EF70 is for treaty label 3 i.e. not for Alliance. There is no info on the "treaty" savegame file, but looking at the code 1=Friendship and 2=Affiliation should be right.

See ->BotF Wiki -> savegame files -> empsInfo
Offset 0x0110 to 0x0123 (5empires * 4bytes) = treaty label: 0=Neutral, 1=War, 2=Alliance, 3=Peace
Offset 0x0124 to 0x0137 (5empires * 4bytes) = territory accessible: 0=No, 1=Yes
Offset 0x0138 to 0x014B (5empires * 4bytes) = trade allowed: 0=No, 1=Yes

For the Tholian special feature you could try this: (Note: Disables the ferengi free trade to majors for non-aggression!)

Code: Select all

0045F14B     75 73                       JNZ SHORT 0045F1C0
0045F14D     90                          NOP
0045F14E     90                          NOP
0045F14F     90                          NOP
0045F150     90                          NOP

0045F15E     C78483 24010000 01000000    MOV DWORD PTR DS:[EBX+EAX*4+124],1

0045F16F     C78481 24010000 00000000    MOV DWORD PTR DS:[ECX+EAX*4+124],0

0045F181    ^E9 DFFEFFFF                 JMP 0045F065

0045F18E    ^75 F1                       JNZ SHORT 0045F181

0045F195     C78483 24010000 00000000    MOV DWORD PTR DS:[EBX+EAX*4+124],0

0045F1A6     C78481 24010000 01000000    MOV DWORD PTR DS:[ECX+EAX*4+124],1

0045F1BB    ^E9 A5FEFFFF                 JMP 0045F065

Race ID:
0045F151                 cmp     word ptr [esi+34h], 2
0045F18A                 cmp     di, 2
EDIT: Corrected mistake [empsInfo+110h -> +124h]

Re: Unlocking Empire Borders for all Treaties

Posted: Tue Apr 24, 2012 2:47 pm
by Peter1981
thanks SCT This is going in the TOS MOD :D

P.S. saw the post in the AI topic literally my jaw droped to the floor so many thing to test :)

Re: Unlocking Empire Borders for all Treaties

Posted: Fri Jun 17, 2016 1:06 pm
by Dewbacca
I am looking at this and wondering... is there a BOTF patcher script for this?

Re: Unlocking Empire Borders for all Treaties

Posted: Fri Jun 17, 2016 1:54 pm
by thunderchero
Dewbacca wrote:I am looking at this and wondering... is there a BOTF patcher script for this?
it is a simple one that I already had for UDM

just copy code below to a notepad and save as "Unlocking_Borders .patch" then add file to patch folder of BOTF patcher

Code: Select all

NAME: Unlocking Empire Borders for all Treaties
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?f=123&t=2200
TAG: fix
 
>> 0x0005e431  0F 85 CC 00 00 00
<< 0x0005e431  90 90 90 90 90 90

Re: Unlocking Empire Borders for all Treaties

Posted: Fri Jun 17, 2016 2:40 pm
by Dewbacca
Thank you sir.

Re: Unlocking Empire Borders for all Treaties

Posted: Tue Jul 19, 2016 4:29 pm
by EnPhreg
is it also possible to prevent that signing a non-aggression pact shows the whole empire territory?
searched forum, found nothing, only this unlocking borders thread.

Re: Unlocking Empire Borders for all Treaties

Posted: Tue Jul 19, 2016 6:53 pm
by thunderchero
I don't know of any posted code change like that.

but this change might cause problems since it displays those systems so trade routes can be established.

Re: Unlocking Empire Borders for all Treaties

Posted: Thu Jul 21, 2016 11:49 am
by EnPhreg
simple non-aggression pacts didn't show the star names, only the whole territory. so maybe this won't be a potential conflict.
only ferengi getting the system names with the simple non-aggression pact, but this code has already discovered.