Home › Forums › Destiny of an Emperor › DoaEd text-editing edition (Alpha 0.04 released 7/07/08)
- This topic has 131 replies, 10 voices, and was last updated 12 years, 7 months ago by sonic.penguin.
-
AuthorPosts
-
April 20, 2008 at 1:06 am #4774NiahakModerator
Write me at ‘webmaster [at] kongming [dot] net’.
I’ll send you my source code and any other notes I have regarding text.
I use regular expressions for all sorts of stuff, so you might see quite a few of them. Or then again, maybe not! Write me if you have any questions.
April 20, 2008 at 1:06 am #34525NiahakModeratorNearly a month after the broken release, it is available at http://www.niahak.org/images/DOAE/DoaTedv004.zip .
This version fixes the broken functionality from v3 and adds officer name processing.
I have tested it on vanilla DoaE and glanced over James' Cao Cao mod and my Gemfire mod which only contains 4-5 plot-relevant renames thus far. Please, before saving anything with this version open up your mod and make sure the names line up properly! I'm still not confident this all works right.
–original text follows
Please do test it with some example text you might use. Save often, and in different files.
There are a lot of control codes and such in here; for example, [OFFICER], [ITEM], etc.
If there is an officer reference, it will use the new name. For example, if you changed Liu Bei to Cao Cao using the original DoaEd, it will use Cao Cao instead of Liu Bei in the text.
I do not recommend changing this section of the text. The text is mostly in order of YT->DZ->YSs etc, and starts a ways down with the initial lines.
If there is a reference such as [OFFICER] in a given block of text, it's not recommended to change it or remove it. I'm not sure what it'll do; it's very possible these lines are somehow "given" a current officer and therefore this could cause some strange things.
If you get a crash, please post about it and any info you might have.
Release notes:
0.03:
-Added alphabetical sorting option
-Reduced textbox sizes because they were stupidly wide; now they're merely somewhat wide
0.02:
-Added 2nd bank of text (d'oh!)
-Now tidies up blank space, as long as it's after [END].
-Re-process All lines button added. This takes all lines and converts them to hex again. This is useful if loading a "normal" DOAE ROM, since it compresses it somewhat.
-Multiple loads now works properly (previously, a "load" simply added the lines to the list.
-Nifty Icon.
0.01:
-Initial release
—-Original dev't post follows
I'm looking at an interface vaguely similar to DoaEd's, but hopefully a bit more friendly (as an aside, I'm hoping to make DoaEd's more friendly once I figure out how to do so in this one).
I'm debating whether to do editing line-by-line or not. Lines that are close together tend to be related, but some are abominably short or irrelevant.
However… it should allow for pointer-changing. Hopefully. So line expansion should be possible once I get this going.
I may end up adding some widgets to insert control stuff like [>] for example… I haven't decided yet how to handle that sort of thing. Also, I need to make sure the input stays within the lines.
Right now it's pretty much read-only. I *should* be able to work some tricks with officer names and other dictionary entries… but I'm not sure how easily I'll be able to dynamically check the length of a string.
Now I'm gonna take a break.
/edit: Before I forget: James, have you figured out what all the events are? I've noticed that they end the previous string, so to some degree I "don't have to" deal with events and their related text… but judging from your table file (which has been a HUGE help thus far) it's F9 where code is a 2-byte code indicating the relevant event.
[CODE] where code is a 2-byte code indicating the relevant event.
April 20, 2008 at 1:12 am #34526thechieftainParticipantDDDUUUUDDDEEE. That would be freaking sweet if it works.
April 20, 2008 at 1:24 am #34527Lord Yuan ShuKeymasterfuckin sweet hehe
Welcome to Lord Yuan Shu Walkthrough Guides ·
Huo Hu's Adventure started Destiny of an Emperor hackingApril 20, 2008 at 1:35 am #34528FalloutParticipantif it works? i remember the destiny of an editor in the beginning stages. niahak’s the man!
April 20, 2008 at 3:20 am #34529thechieftainParticipantNiahak is a pimp, I actually meant "when" is works
April 20, 2008 at 6:23 am #34530Xian Zhu XuandeParticipantNiahak said:
/edit: Before I forget: James, have you figured out what all the events are? I’ve noticed that they end the previous string, so to some degree I "don’t have to" deal with events and their related text… but judging from your table file (which has been a HUGE help thus far) it’s F9 where code is a 2-byte code indicating the relevant event.
Awesome! This would definitely be a whole hell of a lot more convenient than that online tool I made, which still leaves you inserting the actual hexadecimal text into the script. Are you actually planning to alter the index in addition to the text so we can have more space (like you did with the officer entries)? I imagine that would be quite a goal, especially with so many unknown variables involved.
I will help you in any way I can with this. I’ve already sorted out almost every aspect of text editing, even to the point of being able to count characters perfectly. I wish the web-based programming languages I know could be of some help writing a program, but that is a completely different type of fish. Even if you don’t know PHP it isn’t hard, from a programming standpoint, to see what is happening. I would be happy to send you the source code for my online tool if you think it might be helpful. It may at least be somewhat useful to see the array which I use to insert indexed words as optimally as possible?
Yes, events are triggered with the reserved value F9 and defined with XXXX. For example, the pirate quest is triggered by F9FB21, and if I recall correctly it was prompted when the woman asked you to defeat the pirates (in Wu to get the sword). Destiny of an Emperor uses similar event triggers for all sorts of things, and not just in dialogue. There is an event trigger to bring up the save menu, for example. While playing around I was able to make one of the townsfolk prompt you to save the game, though the game locked up when I played around too much. In fact, most of the event triggers assume certain conditions are met, and if those conditions aren’t met, things get messed up. You can do cool stuff with it, though. This is how I made the game end in the Cao Cao mod if you give L[CODE] where code is a 2-byte code indicating the relevant event.
Awesome! This would definitely be a whole hell of a lot more convenient than that online tool I made, which still leaves you inserting the actual hexadecimal text into the script. Are you actually planning to alter the index in addition to the text so we can have more space (like you did with the officer entries)? I imagine that would be quite a goal, especially with so many unknown variables involved.
I will help you in any way I can with this. I’ve already sorted out almost every aspect of text editing, even to the point of being able to count characters perfectly. I wish the web-based programming languages I know could be of some help writing a program, but that is a completely different type of fish. Even if you don’t know PHP it isn’t hard, from a programming standpoint, to see what is happening. I would be happy to send you the source code for my online tool if you think it might be helpful. It may at least be somewhat useful to see the array which I use to insert indexed words as optimally as possible?
Yes, events are triggered with the reserved value F9 and defined with XXXX. For example, the pirate quest is triggered by F9FB21, and if I recall correctly it was prompted when the woman asked you to defeat the pirates (in Wu to get the sword). Destiny of an Emperor uses similar event triggers for all sorts of things, and not just in dialogue. There is an event trigger to bring up the save menu, for example. While playing around I was able to make one of the townsfolk prompt you to save the game, though the game locked up when I played around too much. In fact, most of the event triggers assume certain conditions are met, and if those conditions aren’t met, things get messed up. You can do cool stuff with it, though. This is how I made the game end in the Cao Cao mod if you give L
April 20, 2008 at 6:32 am #34531Xian Zhu XuandeParticipantSpam Edit:
I will gladly help to make this tool work out! It would eliminate most of the time concerns associated with my own DoaE mods (I hope to god it doesn’t choke on the edits I have already made — please try to design it in a tolerant way). It would be awesome to wrap up the Cao Cao mod! And this would let me focus on some really high-quality script, too!
April 20, 2008 at 3:53 pm #34532FalloutParticipanttell me about it! we all move mod’s that we need to change the text on. my wu mod. has liu bei in wu; i gotta be able to explain that.
i know it would help the lord’s and chief’s mod’s….
April 20, 2008 at 4:59 pm #34533NiahakModeratorJames, anything you’ve got on the reg-ex magic you used would be appreciated. I haven’t used regex as much as I like, although I know it’s significantly different in C# (which is what I’m using).
I’m thinking it would be best to use some sort of pattern-matching on both input and output.
Hopefully the pointers can be modified, too, which should yield more space (especially if you, say, made all the villagers say "Hi!" and most generals say "I join now kthx").
OK, if all event codes are F9XXXX then it shouldn’t be too bad. It looks like F9 is only used there and for a specific dictionary entry… so if worse comes to worse, I can just use a really stupid FSM instead of having a whole ton of patterns to match.
April 26, 2008 at 1:17 am #34534Xian Zhu XuandeParticipant*Lights up Torch*
Niahak… won’t you come out to play? :D
How goes progress of this most awesome of projects?
I
April 26, 2008 at 2:20 am #34535NiahakModeratorSorry, not much to show.
I didn’t do much at all up until today; a few hours ago I tried loading the text off of the pointers and it didn’t really work out.
/edit: well, I gave it a second shot and this time it worked out really well! Now I should be able to store the pointers much more easily… and now I know they will load okay too.
There’s still nothing much to show… but this is actually really good. If I’d done this from the start with DoaEditor, pointers would’ve gotten done a lot sooner.
Just like the officers there are some duplicates for no apparent reason. Sort of strange… but as long as I leave them they should be okay.
Haven’t been working much on this because it’s hard to motivate myself to code more after spending the better part of 8 hours doing so. It’s much easier on the weekends, though, so I"m hoping to make progress.
As far as whether it’s compatible with Destiny of Cao Cao…
The pointers are mixed up though… I’m thinking I may merge in some Destiny of an Editor stuff so officers are (*gasp*) dynamically populated.
If I could find some inherent order to the dictionaries, I might consider doing the same for that.
Keep in mind it’s still just a "reader" for now. I haven’t tried putting things back into the ROM.
April 26, 2008 at 6:44 am #34536Xian Zhu XuandeParticipantAwesome! I’m so glad that it is compatible with the work I have already done (so far). How does it display all of the blank space I inserted in those scripts? There was some character — maybe a space, maybe some kind of null character — I used to fill up any unused space after writing a script to serve as a visual aid.
I could easily churn out the Wei Edition if this was finished! :)
April 26, 2008 at 5:43 pm #34537NiahakModeratorIt doesn’t actually seem to show the blank space (I think some should be before the "Where’s Huo Hu?" line).
If I can get writing done with pointer updates, this might actually make it "compress" your script if it works out right…
April 26, 2008 at 6:04 pm #34538Xian Zhu XuandeParticipantAt least you’ve got a test case! :)
If you’re rewriting indexes, though, that will open up whole new realms of possibilities. By having a few officers say "STFU" here and there, you can have others prattle on quite a bit longer about their beloved cat.
-
AuthorPosts
- You must be logged in to reply to this topic.