techtree.tec - TalShiar operatives report successful mission
Moderator: thunderchero
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
There is error in above code, when breakthrough next tech level, CTD no crash log... Will update when changes made correctly
EDIT: Further analysis suggests that the display value is located at 4D6378, subsequently this causes a crash when Tech breakthrough is achieved (i also tried editing every other 0B to 0C same results), however this could be due to lexicon (although no crash log suggests this, only speculation)
Perhaps I should try to nop the whole code? :/
EDIT2: Im leaving this for a later time, my mind needs time to regenerate *goes to alcove*
EDIT: Further analysis suggests that the display value is located at 4D6378, subsequently this causes a crash when Tech breakthrough is achieved (i also tried editing every other 0B to 0C same results), however this could be due to lexicon (although no crash log suggests this, only speculation)
Perhaps I should try to nop the whole code? :/
EDIT2: Im leaving this for a later time, my mind needs time to regenerate *goes to alcove*
- AlexMcpherson79
- Commander
- Posts: 332
- Joined: Thu Sep 04, 2008 2:00 am
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Just did another test and the replacement of 80 FB 0B with 80 FB 0C at 0xd5778 causes a crash no matter what level you are when you increase your tech level.
EDIT: hmm ok crash seems unrelated now to the change since i changed it back to test something... I will start from scratch with clean trek.exe, give me a while
EDIT: hmm ok crash seems unrelated now to the change since i changed it back to test something... I will start from scratch with clean trek.exe, give me a while
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
*begins to dance uncontrollably*
Ok, here we go, just disregard all past Code changes... focus on these 2 only (this is assuming that you have correctly placed your new Tech 11 correctly in the techtree.tec file)
(asm 452C2A) 0x5202A
with
AND
(asm 4D6378) 0xd5778
with
The first code allows ship of Tech 11 to be built in Shipbuilding screen without the need to restart the game; Second code will allow (for now) only 1 future tech to be displayed in Tech Field Database windows (all windows i believe, tho this is not fully tested), however the drawback is that the first Tech level of the following Tech field will be visible.
EDIT: First code was duplicate, fixed
Ok, here we go, just disregard all past Code changes... focus on these 2 only (this is assuming that you have correctly placed your new Tech 11 correctly in the techtree.tec file)
(asm 452C2A) 0x5202A
Code: Select all
66 83 FE 0B
Code: Select all
66 83 FE 0C
AND
(asm 4D6378) 0xd5778
Code: Select all
80 FB 0B
Code: Select all
80 FB 0C
EDIT: First code was duplicate, fixed
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Interestingly, as a test I decided to create 1 extra Tech for each field, here is the result:
As you can see, as you move down the list (through the other tech fields) the new Tech pushes the following Tech, despite correctly naming/labeling them in techtree.tec file... so i assume that another one of those values that SCT posted last page has something to do with how many physical instances of Techs (in this case 12) will be displayed per Field, so this would mean that each time you added a new Tech, you would have to do so for every other Tech Field AND set the value to exactly how many Techs are supposed to be physically allowed in that particular category - this is speculation and needs testing, but Im too tired to do it now, so good night
EDIT: Hi Flocke I see ur online... hope u have some ideas, also take a look in my 4shared folder if you would like to play around with the Techs/see what u can come up with
http://www.4shared.com/file/BBmiE8Ld/Techs.html
As you can see, as you move down the list (through the other tech fields) the new Tech pushes the following Tech, despite correctly naming/labeling them in techtree.tec file... so i assume that another one of those values that SCT posted last page has something to do with how many physical instances of Techs (in this case 12) will be displayed per Field, so this would mean that each time you added a new Tech, you would have to do so for every other Tech Field AND set the value to exactly how many Techs are supposed to be physically allowed in that particular category - this is speculation and needs testing, but Im too tired to do it now, so good night
EDIT: Hi Flocke I see ur online... hope u have some ideas, also take a look in my 4shared folder if you would like to play around with the Techs/see what u can come up with
http://www.4shared.com/file/BBmiE8Ld/Techs.html
- Flocke
- BORG Trouble Maker
- Posts: 3246
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
I think you're on a good way, I'm watching the progress, but have to go on building the garden shed outdoor on this sunny day.Tethys wrote:EDIT: Hi Flocke I see ur online... hope u have some ideas, also take a look in my 4shared folder if you would like to play around with the Techs/see what u can come up with
cheers
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Well I tried messing with SCTs values... no luck. But I am almost certain that somewhere in the exe it calls to the specific locations within techtree.tec (fe. Basic Biotech location at 0x28, Basic Computer at 0x340, Basic Construction at 0x658)
I do not believe that trek.exe would call to the beginning of the name, but to its locator in techtree
Hellllppp meeeee Flocke i know u keep checking lol! <- back to bed for now...
I do not believe that trek.exe would call to the beginning of the name, but to its locator in techtree
Hellllppp meeeee Flocke i know u keep checking lol! <- back to bed for now...
- Flocke
- BORG Trouble Maker
- Posts: 3246
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Just had a short look at your files.
Beside you've forgotten to adjust the reference (label) number of biogenics, there must be a fixed pointer in trek.exe for the start entry of each technology. That would aquire too much of my time to search for currently. But I'm sure, when SCT finds some free time (He's more into it - and knows more about anyway ) he'll find them. (havn't checked his discoveries on the subject yet either - he might have already found it, I dunno )
If you wanna try search yourself, the offset between those pointers should be 11*[entry size]. Alternatively it's the entry size again that gets multiplicated with current technology (bio: 1, comp: 2,...) to determine the start offset pointer. I'd normally expect the 2nd solution, so searching for the entry size value in trek.exe should bring up something.
Beside you've forgotten to adjust the reference (label) number of biogenics, there must be a fixed pointer in trek.exe for the start entry of each technology. That would aquire too much of my time to search for currently. But I'm sure, when SCT finds some free time (He's more into it - and knows more about anyway ) he'll find them. (havn't checked his discoveries on the subject yet either - he might have already found it, I dunno )
If you wanna try search yourself, the offset between those pointers should be 11*[entry size]. Alternatively it's the entry size again that gets multiplicated with current technology (bio: 1, comp: 2,...) to determine the start offset pointer. I'd normally expect the 2nd solution, so searching for the entry size value in trek.exe should bring up something.
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Did I?Flocke wrote:Beside you've forgotten to adjust the reference (label) number of biogenics...
Just so I understand this, either the 11 (which would be 0B) or the [entry size], but not both, must be changed according to how many physical Techs there are, and it seems it would be easier to change the 11 and not the [however many bytes this is]? (This might also allow an Add Tech Level function in UE) I suppose I will take another look at this when I (re)awaken later on today
- Spocks-cuddly-tribble
- Code Master
- Posts: 1926
- Joined: Sun Apr 27, 2008 2:00 am
Try this:
Remove:
Use instead:
movzx eax, al // al=tech level
imul eax, X // X = number of standard techs (i.e. default 0xB / 0-10)
another missed value for the list (not related to this issue)
Remove:
Code: Select all
4540AC mov dl, al
4540AE lea eax, ds:0[edx*4]
4540B5 sub eax, edx
4540B7 shl eax, 2
4540BA sub eax, edx
4540BC xor edx, edx
movzx eax, al // al=tech level
imul eax, X // X = number of standard techs (i.e. default 0xB / 0-10)
Code: Select all
004540AC 0FB6C0 MOVZX EAX, AL
004540AF 6BC0 XX IMUL EAX,EAX, XX
004540B2 90 NOP
004540B3 90 NOP
004540B4 90 NOP
004540B5 90 NOP
004540B6 90 NOP
004540B7 90 NOP
004540B8 90 NOP
004540B9 90 NOP
004540BA 90 NOP
004540BB 90 NOP
another missed value for the list (not related to this issue)
Code: Select all
4D2A46 BA 0A 00 00 00 mov edx, 0Ah
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2403
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Thanks SCT I will go test this out now and report my findings... <3 ;D
EDIT: I have to say this works almost flawlessly... techs show up properly, ship is buildable and techs for ship are correct, however (a very minor issue) is that when breakthrough is researched, no notification of new advancements for those techs are given in summary, nor does it show notification of new ship allowed to build... this is minor things and it would be nice to have them *line up* with the other techs, but as I said a very minor issue, I think I can live with this fix...
EXCELLENT work once again... Now to see if DCER can put an add tech level button into UE
So in conclusion, the codes needed to successfully add working Techs to your Mod are as follows:
(asm 452C2A) 0x5202A
with
AND
(asm 4D6378) 0xd5778
with
AND
(asm 4540AC) 0x534AC
with
AND lastly, VERY important for having Techs over 12!
(asm ?) 0x530A3
with
the previously stated hex bytes XX refers to the case of how many Techs you plan on having total in your tech tree (default is 11 or in hex 0B)
EDIT: I have to say this works almost flawlessly... techs show up properly, ship is buildable and techs for ship are correct, however (a very minor issue) is that when breakthrough is researched, no notification of new advancements for those techs are given in summary, nor does it show notification of new ship allowed to build... this is minor things and it would be nice to have them *line up* with the other techs, but as I said a very minor issue, I think I can live with this fix...
EXCELLENT work once again... Now to see if DCER can put an add tech level button into UE
So in conclusion, the codes needed to successfully add working Techs to your Mod are as follows:
(asm 452C2A) 0x5202A
Code: Select all
66 83 FE 0B
Code: Select all
66 83 FE XX
AND
(asm 4D6378) 0xd5778
Code: Select all
80 FB 0B
Code: Select all
80 FB XX
AND
(asm 4540AC) 0x534AC
Code: Select all
88 C2 8D 04 95 00 00 00 00 29 D0 C1 E0 02 29 D0
Code: Select all
0F B6 C0 6B C0 XX 90 90 90 90 90 90 90 90 90 90
AND lastly, VERY important for having Techs over 12!
(asm ?) 0x530A3
Code: Select all
4D
Code: Select all
71
Last edited by Tethys on Wed May 12, 2010 2:02 am, edited 3 times in total.