Jump to content

Carbonized Windows PC Editor


Ishad Nha

Recommended Posts

I think that I have carbonized the Windows PC Editor, see

http://www.freewebs.com/ishadnha/BoEPCEditor2009.zip

The use of custom items will still require hex-editing the list into the compiled program. I have not yet resolved this problem, I may be able to borrow code from the Scenario Editor.

 

All items given by the I1 thru I10 menus are identified when they are received by the relevant PC. Resources necessary for compiling the source code are also included.

 

There is also a pre-existing issue with the main status (alive, dead, stoned&) of the various pcs being all mixed up together.

 

Edit:

To make the above link actually work, you will need to click it, make the address bar active and then press Enter.

Edit:

If the above link does work when you click on it, you don't need to worry about the instructions above.

Link to comment
Share on other sites

Perhaps I'm mistaken, but I had always understood the meaning of 'carbonize', with regard to software, to mean converting old macintosh application code to use the newer Carbon libraries. Since, to the best of my knowledge, the phrase is meaningless for Windows software, i assume that you have gotten it up and running.

 

Quote:
The use of custom items will still require hex-editing the list into the compiled program.

This sounds familiar, as I routinely make deposits at the bank by circumventing the alarms, drilling into the vault, and putting my money inside. tongue More seriously, I was able to add this feature to the Mac version of the program pretty easily. Looking at load_scen_item_defs() and its usage in ed.fileio.c of the Mac source code should give you the gist of it, although the code itself isn't portable, as it heavily uses the OS X Core Foundation and File Manager APIs.

 

EDIT: As always, I'm baffled by how you get your site to screw up incoming links. Just so you know, I simply instructed my browser to download the file the link points to, and it worked fine. Directing people to do so might me easier than your current, somewhat confusing, instructions.

Link to comment
Share on other sites

I can't really program but I can hex-edit...My approach would only take a minute or two at most. I will have to look at your code at some point.

The altered Itemdata.h was rapidly whipped up using Excel and then Word, the data originally came from bladbase.exs.

 

Links, I am using Internet Explorer, maybe that is it.

 

Other notes:

The Editor now lists all items including items that work differently, like food and money. Clicking on such an item will increase your food and money, it won't add anything to the inventory.

I will need to include an information screen that shows gold, food, day, location and whether the party is in town.

"There is also a pre-existing issue with the main status (alive, dead, stoned&) of the various pcs being all mixed up together." There is a problem with a dead PC messing up the status listings for all PCs,

Solution seemed to be adding “ if (i == current_active_pc) { ” to the start of each case in the switch (adven.main_status). Of course a corresponding } has to be added at the end of each case.

 

Edit:

I thought Carbonize meant customize, anyway...

Link to comment
Share on other sites

Quick fix, hex editing custom items into a Windows Character Editor.

This will have to do until I can get the hang of opening files in the editor, which will take a while because I am working on four or five projects at once.

Open the scenario file in Hexplorer or some such hex editor. Open the Character Editor in another copy of Hexplorer. Make sure the copy of Hexplorer showing the Editor is set to Overwrite not Insert.

In the scenario the item data structures are found at address hex A3D6 = 41,942. It is 26,400 bytes in length. Select this and choose Edit > Copy As > Hex string.

Start of the item data structure in the current version of the editor: 1,9A00 = 104,960. This time choose: Edit > Paste external text > As hex numbers.

If you want to edit the editor so as to spell out which scenario has its items listed, the text displayed in the Title bar is found at: 2,0E00 = 134,656.

Copying is no problem, I delete everything before place 41,942 then go to place 26,399 and choose Shift + Home. After doing the Copy As > Hex string, I do File > Reload to remove all the deletions.

 

Link to comment
Share on other sites

  • 2 weeks later...

Ishad Nha, I've continued your work on the char editor.

Here are the changes i implemented, following your suggestions:

 

  • The editor now display the filename of the scenario you are in.
  • The editor now get the list of items from the scenario you're in. If not in a scenario, bladbase.exs is used. (clicking a item with food (resp. gold) type will give a random (1-20) amount of food (resp. gold).)
  • References to registration and shareware are removed.
  • Status Screen now show Food, Gold and Day.
  • Corrected the garbled status due to a non-alive character (Ishad Nha)
The code can be found in the openexile repository on Google Code (sorry about the two blank revisions, but i was trying a GUI and it automatically committed the changes. Nothing like the command line, hey wink ) since i think this part of the code is pretty complete (ressources files should be cleaned though, lots of useless dialogs i think).

 

Note that the editor tries to find the scenario files under your scenario folder (the joke of changing the current directory has been fixed here too) and bladbase.exs under your blade of exile directory (this is where it should be, right ?).

 

Hope it helps,

Chokboyz

Link to comment
Share on other sites

I was looking into what would be necessary to add Chokboyz's improvements to the Windows Character editor to the Mac version that I had been maintaining, but from my examination of the code in your repository, it looks like you've already subsumed my code. If that's the case, I'll take down my page and let you guys handle things. I was never really interested in being in the BoE business anyway, I just got the character editor up and running because there had been so much whining about it.

Link to comment
Share on other sites

Quote:
I was looking into what would be necessary to add Chokboyz's improvements to the Windows Character editor to the Mac version that I had been maintaining, but from my examination of the code in your repository, it looks like you've already subsumed my code.

I couldn't find the BoE editor on your website, thus i don't know what changes you've made. The only change i could find was in the news : you added a save as option (i won't add it for now : save should always be save as, as the Win32 char editor is still beta).
I will gladly add to the Win32 Char Editor any further addition you've made and provide pieces of code missing from the Mac version (unfortunately, changes are mainly graphical, thus non-portable.).

Quote:
If that's the case, I'll take down my page and let you guys handle things. I was never really interested in being in the BoE business anyway, I just got the character editor up and running because there had been so much whining about it.

Celtic Minstrel is the one maintaining/upgrading the Mac version of BoE, so he may have already merged your code...
Oh, and you may safely go back to the BoA 3D Editor (or AScript project, or whatever you're working on), we will try to handle the (potential) whining wink

Chokboyz
Link to comment
Share on other sites

So it sounds like the answer is yes, you do already have my alterations. So, I shall consider the problem turned over to you.

 

Also: This means you get to deal with Bain's crazy bug. Ha! (That is, of course, if the bug still exists in your version.) If you want, I can send to you the small amount of information I had gathered on it.

Link to comment
Share on other sites

I have no idea if the bug still exists, but there's currently a bug that prevents you from ever opening a file, so I kind of need to fix that first... though I suspect it may be fairly simple.

 

Also, what kind of thing would cause them to quit immediately when launching from the Finder but not when launching from Xcode? I think all three of them currently do that, which is another thing that needs fixing.

Link to comment
Share on other sites

Sure, if you like. All the changes are now in the repository. When you select "Open" from the File menu, the PC editor displays an error message about the save file not being valid – without even prompting you for a file first.

 

EDIT: I think I've solved the "can't open any file" problem – for some reason I think sys_7_avail was false, so it was skipping the chunk of code that displayed the nav file dialog.

 

EDIT2: At least it lets you pick a file now; however, it still fails to load.

Link to comment
Share on other sites

New version of the char editor code is uploaded. I found several bugs that needed to be fixed and made some additions.

 

Changelog :

 

- Corrected the edit day option so that it sets the day to the one specified and not to the day after.

Not a crucial one, but fixed anyway (original bug).

 

- Fixed the saving function : now changes can be saved outdoors (that was crashing at save stored_items making give_map non functional). That also fixes the stored items arrays being filled with items from current town.

Major bug that was present in the original (Ormus) code. The current_town_item_list was used to fill the stored_item array, resulting in :

  • The stored array being filled by the items in current town if in town. When loading a new scenario, the game would propose the player to get these items.
  • The saving function returning before ending with outdoor, not saving the maps. The give map options were then useless.
- If in a scenario, the editor nows display the name of the town the party is in or if they are outdoor.

(even while in a Mac made scenario)

 

- Giving PC items from a Mac made scenario doesn't crash the game anymore (overall Mac scenario support added)

Big/little endian adjustment. If giving items from a scenario made on mac, the game would crash when using them, getting info on them, etc ...

 

- Cleaned the ressource file. The executable is now smaller.

But more can be done with the code i'm sure wink

 

- On give items : the editor now tries to load the bladbase.exs file if the scenario file is not found. If can't locate the bladbase, the items menus are grayed.

Thus preventing clicking on unallocated items.

 

The Character Editor should now be fully operational.

 

Chokboyz

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...