Home › Forums › Destiny of an Emperor › Destiny of an Editor (permanent beta test mode active)
Tagged: Destiny of an Editor, Destiny of an Emperor, Huo Hu, Niahak, ROM Hacking, Xian Zhu Xuande, Zhuge Liang
- This topic has 1,129 replies, 26 voices, and was last updated 10 years, 12 months ago by
MiDKnighT.
-
AuthorPosts
-
June 20, 2013 at 3:30 pm #27582
MiDKnighT
ModeratorAnd in case it's not an expanded ROM:
if (!IsRomExpanded)
{
ldrText.Enabled = false;
vitText.Enabled = false;
polText.Enabled = false;
}
June 20, 2013 at 3:39 pm #27583MiDKnighT
ModeratorNow to get fancy… When loading the ROM I'll try to make it display a derived value for LDR, VIT, POL if it is zero in the ROM.
I'd also like the profile list to read from the ROM but that might be too difficult for me at this stage. Maybe I'll just use a table text file for now.
If I get all this working I'd like Niahak to "approve" my changes before publishing. It's still his baby.
June 20, 2013 at 6:37 pm #27584MiDKnighT
ModeratorAhh, my first DoaEditor update.
LDR, VIT, POL, and assigning profiles is working:

What it does…
-
– Loads LDR, VIT, POL from the ROM
– If those values are 0, it will derive a value the same way the attributes enhancement does
– Loads profile from the ROM
– Default profile is "Officer"
– Profile names are hardcoded in profiletable.tbl for now but that may change later
– If the ROM is not expanded, LDR, VIT, POL, and profile boxes are grayed out.
I have imported the changes to http://www.dev.niahak.org/DoaEditor/ – waiting for Niahak to review and publish.
Since the profile names are hardcoded, you will want to copy in the names via hex to the ROM:
0xE9A00:
1E35353832342D0A0A0AFF4142400A0A
21643B342D0A0A0A0A0AFF4142430A0A
123E3C3C303D33342D0AFF4142430A0A
112D3836303338342D0AFF4142430A0A
103365382E3E2D0A0A0AFF56400A0A0A
222F2D302F3436382E2FFF5640400A0A
1734303B342D0A0A0A0AFF56400A0A0A
26302D2D383E2D0A0A0AFF4244464845
25303D3664302D330A0AFF490A0A0A0A
1664302D3338303D0A0AFF4A0A0A0A0A
19643636342D3D30642FFF46480A0A0A
1C302E2F342D0A0A0A0AFF564A0A0A0A
1237303C3F383E3D0A0AFF4244464845
102D3237342D0A0A0A0AFF490A0A0A0A
22343D2F383D343B0A0AFF40490A0A0A
12303B65303B2D680A0AFF4144490A0A
10333C382D303B0A0A0AFF43490A0A0A
1F3E3B382F383238303DFF400A0A0A0A
123865383B0A0A0A0A0AFF400A0A0A0A
143D36383D34342D0A0AFF470A0A0A0A
1F682D3E0A0A0A0A0A0AFF4142400A0A
23373834350A0A0A0A0AFF43400A0A0A
1F373E343D38670A0A0AFF560A0A0A0A
233836342D0A0A0A0A0AFF4142434445
132D30363E3D0A0A0A0AFF4142434445
183D35303D2F2D680A0AFF4044470A0A
11302D31302D38303D0AFF46480A0A0A
1F34302E303D2F0A0A0AFF400A0A0A0A
Main new code:
In list_SelectedIndexChanged() (only if ROM is expanded):
int ldrlocation = 0x7aa00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int vitlocation = 0x7ab00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int pollocation = 0x7ac00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int leadership = (Convert.ToByte((entireRom[ldrlocation])));
int strength = o.STR;
int intelligence = o.INT;
int agility = o.AGI;
int vitality = (Convert.ToByte((entireRom[vitlocation])));
int political = (Convert.ToByte((entireRom[pollocation])));
if (leadership == 0)
{
int lintelligence = (intelligence >> 1);
int lstrength = (strength >> 2);
int lagility = (agility >> 2);
leadership = (lintelligence + lstrength + lagility);
}
if (vitality == 0)
{
int vstrength = (strength >> 1);
int vintelligence = (intelligence >> 2);
int vagility = (agility >> 2);
vitality = (vintelligence + vstrength + vagility);
}
if ( political == 0)
{
int pintelligence = (intelligence >> 1);
int pintelligence2 = (intelligence >> 2);
int pagility = (agility >> 2);
political = (pintelligence + pintelligence2 + pagility);
}
this.ldrText.Text = leadership.ToString();
this.vitText.Text = vitality.ToString();
this.polText.Text = political.ToString();
int profilelocation = 0xe8f00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
profile.SelectedIndex = (Convert.ToByte((entireRom[profilelocation])));
}
if (!IsRomExpanded)
{
ldrText.Enabled = false;
vitText.Enabled = false;
polText.Enabled = false;
profile.Enabled = false;
}
In savebtn_Click() (only if ROM is expanded):
int ldrlocation = 0x7aa00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int vitlocation = 0x7ab00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int pollocation = 0x7ac00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
int profilelocation = 0xe8f00 + (byte.Parse(o.HexPointerValue, System.Globalization.NumberStyles.HexNumber));
entireRom[ldrlocation] = Convert.ToByte(int.Parse(this.ldrText.Text));
entireRom[vitlocation] = Convert.ToByte(int.Parse(this.vitText.Text));
entireRom[pollocation] = Convert.ToByte(int.Parse(this.polText.Text));
entireRom[profilelocation] = Convert.ToByte(profile.SelectedIndex);
June 20, 2013 at 11:53 pm #27585MiDKnighT
ModeratorNiahak,
Some questions for you if I may…
My next DoaEditor thing would be a "Tactics" tab/page. I created a file called MainForm.Tactics.cs but I can't seem to get MainForm.cs to recognize anything in that file. How do you get MainForm.cs to recognize functions in another .cs file?
In the "Tactics" page I'd have a "Collection" called tacticList which would be similar to offList, mapRegionList, lineList, and battleList. I guess I'd need to create an array to read the names from the ROM starting at 0xF8220 then populate tacticsList with something like "tacticList.Items.AddRange(Tactics.ToArray());" ? Maybe if you could just describe how you did it for the others that would help give me some direction.
June 21, 2013 at 8:50 pm #27586Niahak
ModeratorHi MiDKnighT,
I've made a few changes, tested that they're working, and checked back in based on your previous changes. Here's a set of code review comments:
–Removed a couple event handlers that got created accidentally.
–Moved the enabling/disabling of the text boxes up to the "LoadRomData" method (line 392-395). This makes it so they're only enabled once (vs. once for each officer when loading) and consolidates the logic for this stuff. I also changed the default to "not enabled" to keep consistent with other behavior.
–Removed some other files mistakenly added (obj/*). You might want to put an exclusion in SVN for that stuff, since anything in the obj directory is compiled.
–Reduced the size of the text boxes for STR/INT/AGI etc. so there isn't overlap with their respective labels.
Everything else looks pretty good.
The reason that you can't get the "Tactics" stuff to be recognized is that all those Mainform.*.cs items are a "partial class". If you look at the topmost definition all of them say:
Code:public partial class Mainform
{If you change your topmost declaration to that, and make sure it has the declaration
Code:namespace DoaEditorat the top, it should work.
As far as the tacticList goes, you're on the right track. I would suggest adding a new method for loading in the names and calling it from LoadRomData in MainForm. Look at parseTextPointers in MainForm.Lines for a pretty decent example of it – of course, you'd just be loading in a single bank of data, but the concept in ParseLinesFromTextBank is a good starting point for what you need to do – might consider making a Tactic class to hold that data, that knows how to transmute itself back into bytes.
Let me know if you need any other assistance. This is really good stuff so far :)
June 21, 2013 at 8:54 pm #27587Niahak
ModeratorAlso, published release:
http://www.niahak.org/images/DOAE/DoaEdv098p.zip
Will update the original post as well.
June 21, 2013 at 9:01 pm #27588MiDKnighT
ModeratorGreat Niahak thanks. I'll read through your update a few times to digest it.
I'm also going to change the check where it decides if the new boxes (LDR, VIT, etc…) are active or not. Instead of checking if the ROM is expanded I'll have it check to see if IPS patch 1.3 or > is applied (adding an IPS version stamp to the patch).
That ensures that you can only set those stats if your ROM can actually use them.
June 21, 2013 at 10:50 pm #27589DragonAtma
ModeratorGood work! Now all midknight needs to do is take the plunger off of Cao Cao's head. :Þ
June 29, 2013 at 4:07 am #27590MiDKnighT
ModeratorSneak preview of what I'm working on now…

Still working on it… Niahak has bailed me out a few times when I got stuck but things are progressing now (when I get time).
June 30, 2013 at 9:04 pm #27591MiDKnighT
ModeratorNiahak's help in the beginning + more and more practice with this has allowed me to take off on the Tactics page:

Still a few more items to add…
July 1, 2013 at 5:42 pm #27592MiDKnighT
ModeratorTactics Page is pretty much done. Submitted to Niahak to review and publish:
If you have IPS 1.3 applied the page will look like this:

For < IPS 1.3 it will look like this. Note that you can't edit the tactic name if < IPS 1.3 since moving pointers around would be a lot of work so just edit the names in the ROM:
July 1, 2013 at 10:48 pm #27593sonic.penguin
ModeratorAwesome! Will make editing tactics so much easier…
July 2, 2013 at 3:37 am #27594MiDKnighT
ModeratorWhile I was waiting for Niahak to review the tactic stuff I dove into the Profile page:

It's a busy page for sure but it'll be very functional.
Niahak gave me feedback on the tactic stuff so I've got more to work on there too…
July 2, 2013 at 4:33 pm #27595MiDKnighT
ModeratorAny feedback on the profile page layout? Should I have less levels per page?
Basically want to be able to edit profile name, the 5 icons, 60 tactic levels, and 16 "what are they likely to do" entries at the bottom. Ya that's a lot of stuff on one little page. I expect the combo box at the top right to load 30 new level boxes (31-60). Should I break it up into 3 groups? (1-20, 21-40, 41-60) ? Do you think I need to give more room for the icon text and the probabilities at the bottom?
Barring any unforeseen setbacks the new Tactics page should be released tonight.
July 2, 2013 at 7:48 pm #27596MiDKnighT
ModeratorBarring any unforeseen setbacks the new Tactics page should be released tonight.
-
AuthorPosts
- You must be logged in to reply to this topic.

