Well-Actually War Trall Ishad Nha Posted February 25, 2009 Posted February 25, 2009 I have just succeeded in compiling Ormus's source code for the BoE Scenario Editor. Problems overcome: Lack of resources, cursors and sounds were not included with the source and resources. Neatening up the start to Blscened.rc as follows: #include <windows.h> #define Exile 1 #define MENU_1 1 #define MENU_2 2 #define ACCELERATORS_1 1 #define DIALOG_1 1 #define DIALOG_2 2 #define DIALOG_3 3 #define WAVE 100 #define CURSOR_1 1 #define CURSOR_2 2 #define CURSOR_3 3 #define CURSOR_4 4 #define CURSOR_5 5 #define CURSOR_6 6 #define CURSOR_7 7 #define CURSOR_8 8 #define ICON_1 1 The resources were obtained easily enough by opening Ormus's last version in the Reshack program then choosing the Action > Save All Resources option. Next I had to alter the name of the cursors, "Cursor_1.cur" became "1.cur"&. Sound files need to be renamed as per the file Blscened.rc, ditto the icon. So far I have not done anything except change the title bar a bit. Ormus is planning a fantastic new version but it won't be appearing soon. Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted February 25, 2009 Posted February 25, 2009 So this is the original, unmodified (except for fixing the resources, neatening things that don't affect how the program runs (if I understand correctly) and changing the title bar) Windows scenario editor? Could you upload this somewhere? Ormus's editor currently has fatal bugs, and an unmodified editor would be swell, as it often runs on Vista. I don't suppose you could compile the main program too? Or are there more complicated problems in that program? Quote
Well-Actually War Trall Ishad Nha Posted February 25, 2009 Author Posted February 25, 2009 I just managed to compile it an hour ago, there has been no time for real change. This of course uses Ormus's code, it will have all of the bugs of his editor until they are identified and fixed. It is found at: http://www.freewebs.com/ishadnha/2009BoEScenarioEditor.zip This download includes the missing resources too. If you want to have a crack at the editor yourself, you must neaten the start of BlScened.rc or the code may not compile. I am using Bloodshed Dev-Cpp 4.9.9.2, mercifully this is freeware. (You may need to make your address bar active before the download will work.) As for the program itself that would require more time than I have now. It would also require knowledge of programming that I don't have. Edit: I have now included hot keys for all the buttons on the Editing Buttons palette, except for the rarely used town entrance ones. Next, I hope to include BoA style keys for load a different town& Editor bears today's date in its title bar because I expect daily revisions of it. Edit: The BoA style hot keys, Ctrl + L, Ctrl + D and Ctrl + R have been implemented. Quote
Well-Actually War Trall Ishad Nha Posted February 26, 2009 Author Posted February 26, 2009 As far as I can tell I have successfully removed the restrictions on editing the first 91 terrain slots. I have added hotkeys to enable you to switch to edit terrain, monster or item modes. Meanwhile more ambitious rewrites have not worked out. Edit: I have added numbers to the lists of items and monsters. Edit: The zoom out view now uses 7*7 editor icon from mixed.bmp for all terrain, including the varieties with custom graphics. Next step is to allow for the use of custom editor icons on their own sheet. Quote
Well-Actually War Trall Ishad Nha Posted February 28, 2009 Author Posted February 28, 2009 I fixed up the monster list to make it 4 tabs of 64 monsters, thus the last monster is now displayed. I modified the scendata.txt function so that it now prints out a list of all towns and outdoor zones with their names. The BoA port-a-BoE-scenario function can be adapted to print out lists of what each node is doing. Quote
Understated Ur-Drakon Celtic Minstrel Posted February 28, 2009 Posted February 28, 2009 Originally Posted By: Ishad Nha I fixed up the monster list to make it 4 tabs of 64 monsters, thus the last monster is now displayed. ...what are you talking about? Quote
Well-Actually War Trall Ishad Nha Posted February 28, 2009 Author Posted February 28, 2009 Currently you have five tabs of 51 monsters each, 5*51 = 255, hence the last monster cannot be displayed. You don't realize this because the listings are not numbered in the BoA style. Quote
Understated Ur-Drakon Celtic Minstrel Posted February 28, 2009 Posted February 28, 2009 What's this about "tabs"? There are no tabs. Also, is there a Monster 0? Quote
Well-Actually War Trall Ishad Nha Posted March 1, 2009 Author Posted March 1, 2009 By "tabs" I mean the M1 through M5 menus or whatever you want to call them. Monster 0 is listed in the tabs too but not in the Edit Monsters screen. Quote
Easygoing Eyebeast keira Posted March 1, 2009 Posted March 1, 2009 tabs as in menus. M1, M2, etc. Quote
Understated Ur-Drakon Celtic Minstrel Posted March 1, 2009 Posted March 1, 2009 Oh. Well, a better goal would be to get rid of those menus altogether, like Niemand did in the BoA editor. (Okay, he didn't actually remove the menus, but he added something better.) Quote
Easygoing Eyebeast keira Posted March 1, 2009 Posted March 1, 2009 That's on the Suggestion list, I think. Quote
Well-Actually War Trall Ishad Nha Posted March 1, 2009 Author Posted March 1, 2009 Ormus's editor has terrain - style screens for items and monsters, it should be good when it comes out. Managed to resolve problems with one string running into another in special node and dialog editing screens: trim the strings down to 39 characters or less. That took most of the day to figure out, I thought it was something more exotic. Quote
Well-Actually War Trall Ishad Nha Posted March 9, 2009 Author Posted March 9, 2009 I just found out that the Scenario Editor crashes when any attempt is made to save an exs file, I don't know what the cause is. Error numbers are 102 and 103 Edit: the problem has been fixed, I just pasted in save_scenario() from the original source code. I don't know where the problem came from, I had not altered the relevant function. a few quick fixes on the way: Editor now supports the last six boats and horses. After creating Scendata.txt, the editor loads the outdoor zone last edited and the town last edited. (It opens every zone and town to retrieve the names.) Set outdoor start location is now moved to the Scenario menu. Scenario file names can now be anything that Windows permits. Quote
Well-Actually War Trall Ishad Nha Posted March 18, 2009 Author Posted March 18, 2009 Scenario names can now be up to 28 characters long. A lot of redundant text was cleaned out of gamedlog.rc too. Quote
Understated Ur-Drakon Celtic Minstrel Posted March 18, 2009 Posted March 18, 2009 Do you mean the filename, or the long name? Quote
Well-Actually War Trall Ishad Nha Posted March 18, 2009 Author Posted March 18, 2009 I am referring to the filename, I have created and played a scenario called Dragonquest2. Have not found the screening code for the long name, scenario name. Screening for the filename is found in scenario.cpp at line 2421 in the unaltered source code. Edit: In the next function there is a simple "title[30] = 0;", that looks like the screen for the scenario name. Not that you would want such a long name anyway, it has to fit into the Quote
Understated Ur-Drakon Celtic Minstrel Posted March 19, 2009 Posted March 19, 2009 I thought it was already possible to have scenario filenames longer than 8.3 – just rename it in the Finder/Explorer. Quote
Well-Actually War Trall Ishad Nha Posted March 19, 2009 Author Posted March 19, 2009 I have not tried that yet so I don't know, all the names that I have seen are eight letters or less. Quote
Kyshakk Koan Mistb0rn Posted March 20, 2009 Posted March 20, 2009 That's because only a few of us actually used it. It makes the last part of the name show up as other symbols in the Scenario Editor load screen, but there aren't any problems that I know of. Quote
Understated Ur-Drakon Celtic Minstrel Posted March 20, 2009 Posted March 20, 2009 I don't think he actually enforced the 8.3 limit (except maybe in the scenario creation dialog) – it was just there because Windows enforced it and he wanted to ensure compatibility. Quote
Well-Actually War Trall Ishad Nha Posted March 30, 2009 Author Posted March 30, 2009 I have altered the editor so that it shows the information about which town or outdoor zone is currently loaded, when the town/zone is actually being edited. You can load one town after another slide-show fashion. (I had to remove the message about click to scroll view.) There is also a slideshow for the outdoors. Edit: Next on the agenda is a set of query functions. One is meant to produce a list of outdoor stores and produces gibberish instead. Quote
Well-Actually War Trall Ishad Nha Posted April 5, 2009 Author Posted April 5, 2009 I was trying to include a list of outdoors town entrances in the Scendata.txt and all I got was gibberish. I was using "which_out" for the name of the outdoor record type, then I replaced that with "current_terrain" and the problem went away. Quote
Rotghroth Rhapsody Chokboyz Posted April 5, 2009 Posted April 5, 2009 Concerning the zoom-out problem : (Using latest Ormus' Scenario Editor Code) In file GRAPHICS.cpp, find the function draw_one_tiny_terrain_spot() (line 879) and do the following changes : Remove the lines 890 and 891 : if (picture_wanted >= 1000) picture_wanted = 74; (it's a check to print a black box if the graphic is custom) Replace the lines 917 and 918 : from_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0); by : SelectObject(hdc,store_bmp); from_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0); store_bmp = (HBITMAP)SelectObject(hdc,ter_draw_gworld); (store_bmp wasn't correctly selected in hdc ; last line is done to preserve compatibility with the rest of the function) The function rect_draw_some_item() in GRAPHUTL.cpp might needs some tweaking too, as if the custom graphics are not the exact same size then the base ones, gibberish may occurs. It's an hypothesis though, and i've not encountered anything like this in my tests ... Hope it helps, Chokboyz Quote
Well-Actually War Trall Ishad Nha Posted April 6, 2009 Author Posted April 6, 2009 Brilliant, I think it is working, I am currently checking a few scenarios with a lot of known custom terrain. I can use the BoE Zoom Editor to check what should be there with what the Scenario Editor is showing me. Zoom Editor is explained in this post: http://www.ironycentral.com/forum/ubbthreads.php?ubb=showflat&Number=155725#Post155725 I have uploaded a copy of the new editor. I have also uploaded a copy of the source code that I am using: http://www.freewebs.com/ishadnha/2009BoESESource.zip Quote
Understated Ur-Drakon Celtic Minstrel Posted April 13, 2009 Posted April 13, 2009 Originally Posted By: Ishad Nha a few quick fixes on the way: Editor now supports the last six boats and horses. After creating Scendata.txt, the editor loads the outdoor zone last edited and the town last edited. (It opens every zone and town to retrieve the names.) Set outdoor start location is now moved to the Scenario menu. Scenario file names can now be anything that Windows permits. What did you do to fix these? Originally Posted By: Ishad Nha Scenario names can now be up to 28 characters long. A lot of redundant text was cleaned out of gamedlog.rc too. Where did you fix this? (As in which function?) I can probably find it myself, but if you happen to remember, please tell. Originally Posted By: Ishad Nha I have altered the editor so that it shows the information about which town or outdoor zone is currently loaded, when the town/zone is actually being edited. You can load one town after another slide-show fashion. (I had to remove the message about click to scroll view.) There is also a slideshow for the outdoors. Can you elaborate on these two features? Does the slide-show for outdoors allow both up/down and left/right scrolling? Originally Posted By: Chokboyz Concerning the zoom-out problem : (Using latest Ormus' Scenario Editor Code) In file GRAPHICS.cpp, find the function draw_one_tiny_terrain_spot() (line 879) and do the following changes : Remove the lines 890 and 891 :if (picture_wanted >= 1000) picture_wanted = 74; (it's a check to print a black box if the graphic is custom) Replace the lines 917 and 918 :from_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0); by :SelectObject(hdc,store_bmp);from_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0); store_bmp = (HBITMAP)SelectObject(hdc,ter_draw_gworld); (store_bmp wasn't correctly selected in hdc ; last line is done to preserve compatibility with the rest of the function) The function rect_draw_some_item() in GRAPHUTL.cpp might needs some tweaking too, as if the custom graphics are not the exact same size then the base ones, gibberish may occurs. It's an hypothesis though, and i've not encountered anything like this in my tests ... Hope it helps, Chokboyz I'm slightly confused – what exactly have you done here? Quote
Rotghroth Rhapsody Chokboyz Posted April 13, 2009 Posted April 13, 2009 Quote: I'm slightly confused – what exactly have you done here? The function draw_one_tiny_terrain_spot() wasn't handling correctly custom graphics correctly so we : first, remove the safety fix that were printing black box instead of custom ones : Remove the lines 890 and 891 : then correct the lines handling custom graphics in the function :if( ... > 1000){SelectObject(hdc,store_bmp); <= add this linefrom_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0);store_bmp = (HBITMAP)SelectObject(hdc,ter_draw_gworld); <= add this line} Hope it's clearer, Chokboyz Quote
Well-Actually War Trall Ishad Nha Posted April 13, 2009 Author Posted April 13, 2009 A few quick answers… Big picture: download the source, that will show you exactly what has been done. http://www.freewebs.com/ishadnha/2009BoESESource.zip Boats, line 2,116 of Scenario.cpp, (Ormus’s original unaltered code) void edit_boats_event_filter (short item_hit): if (store_boat_page < 0) store_boat_page = 3; if (store_boat_page > 3) store_boat_page = 0; in both lines the “3” was changed to a “4”. Horses, see line 2,041. Menus are found in the start of file Blscened.rc, quite straightforward. Scendata.txt changes, see line 1,214 of Tfileio.cpp (my very much altered code): void start_data_dump() Scenario file names, see line 2,416 of my Scenario.cpp: void edit_make_scen_1_event_filter (short item_hit) “I have altered the editor so that it shows the information about which town or outdoor zone is currently loaded, when the town/zone is actually being edited.”, see my Tactions.cpp around line 3,277: void start_town_edit(). Ditto for the outdoor editing, look at line 3,308. Line 716 of my Blscened.cpp, currently the slide show goes backwards and forwards only, but it could be easily altered to go up/down too. Edit: Compare my source code with the unaltered version by Ormus, that will show the changes and what I have done. You will a few things in my code that did not work out. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 13, 2009 Posted April 13, 2009 Originally Posted By: Chokboyz Quote: I'm slightly confused – what exactly have you done here? The function draw_one_tiny_terrain_spot() wasn't handling correctly custom graphics correctly so we : first, remove the safety fix that were printing black box instead of custom ones : Remove the lines 890 and 891 : then correct the lines handling custom graphics in the function :if( ... > 1000){SelectObject(hdc,store_bmp); <= add this linefrom_rect = get_custom_rect(picture_wanted % 1000); rect_draw_some_item(spec_scen_g, from_rect, ter_draw_gworld, dest_rect, 0, 0);store_bmp = (HBITMAP)SelectObject(hdc,ter_draw_gworld); <= add this line} Hope it's clearer, Chokboyz I'll see if I can do this. Obviously SelectObject is platform-dependent though. EDIT: It may have been fixed already. I'll set it aside for now. Originally Posted By: Ishad Nha Boats, line 2,113 of Scenario.cpp, (Ormus’s original unaltered code) void edit_boats_event_filter (short item_hit): if (store_boat_page < 0) store_boat_page = 3; if (store_boat_page > 3) store_boat_page = 0; in both lines the “3” was changed to a “4”. Horses, see line 2,041. Okay, I made this change both to horses and to boats. Obviously we should change the text in that dialog that says there are 24 boat slots when in fact there are now 30... Originally Posted By: Ishad Nha Scendata.txt changes, see line 1,214 of Tfileio.cpp (my very much altered code): void start_data_dump() ...I don't see what you mean, but I'll take a look at your code and see if it helps. EDIT: Eek, it would appear that the text and data dump features don't even work. I'll have to do something about that. EDIT: In handle_scenario_menu(), case 19 was missing a break; and case 20 had an unnecessary check for if(change_made == TRUE). EDIT: Is there any reason not to rewrite these two functions to use ofstream instead of FSWrite? Because that would be so much easier... Originally Posted By: Ishad Nha Scenario file names, see line 2,416 of my Scenario.cpp: void edit_make_scen_1_event_filter (short item_hit) Okay, my only question then is, why did you make 28 the new limit? I'm more inclined to set it to 50 or something. Originally Posted By: Ishad Nha “I have altered the editor so that it shows the information about which town or outdoor zone is currently loaded, when the town/zone is actually being edited.”, see my Tactions.cpp around line 3,277: void start_town_edit(). Ditto for the outdoor editing, look at line 3,308. Okay, I'll look there as well. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 13, 2009 Posted April 13, 2009 Originally Posted By: Celtic Minstrel EDIT: Is there any reason not to rewrite these two functions to use ofstream instead of FSWrite? Because that would be so much easier... I commented out the old versions of the two functions and replaced them with the following: Code: void start_data_dump(){ short i; char* scen_name = data_store->scen_strs[0]; std::ofstream fout("Scenario Data.txt"); fout << "Scenario data for " << scen_name << ':' << endl << endl; fout << "Terrain types for " << scen_name << ':' << endl; for(i = 0; i < 256; i++) fout << " Terrain type " << i << ": " << data_store->scen_item_list.ter_names[i] << endl; fout << endl << "Monster types for " << scen_name << ':' << endl; for(i = 0; i < 256; i++) fout << " Monster type " << i << ": " << data_store->scen_item_list.monst_names[i] << endl; fout << endl << "Item types for " << scen_name << ':' << endl; for(i = 0; i < 400; i++) fout << " Item type " << i << ": " << data_store->scen_item_list.scen_items[i].full_name << endl; fout.close();}void scen_text_dump(){ short i; location out_sec; std::ofstream fout("Scenario Text.txt"); fout << "Scenario text for " << data_store->scen_strs[0] << ':' << endl << endl; fout << "Scenario Text:" << endl; for(i = 1; i < 260; i++) if(data_store->scen_strs[i][0] != '*') fout << " Message " << i << ": " << data_store->scen_strs[i] << endl; fout << endl << "Outdoor Sections Text:" << endl << endl; for (out_sec.x = 0; out_sec.x < scenario.out_width ; out_sec.x++) { for (out_sec.y = 0; out_sec.y < scenario.out_height ; out_sec.y++) { fout << " Section (x = " << (short)out_sec.x << ", y = " << (short)out_sec.y << "):" << endl; load_outdoors(out_sec,0); for (i = 0; i < 108; i++) if (data_store->out_strs[i][0] != '*') fout << " Message " << i << ": " << data_store->out_strs[i] << endl; fout << endl; } } augment_terrain(out_sec); fout << "Town Text:" << endl << endl; for (short j = 0; j < scenario.num_towns; j++) { fout << " Town " << j << ':' << endl; load_town(j); for (i = 0; i < 135; i++) if (data_store->town_strs[i][0] != '*') fout << " Message " << i << ": " << data_store->town_strs[i] << endl; fout << endl; for (i = 0; i < 10; i++) { fout << " Personality " << i << " (" << data_store->talk_strs[i] << "): " << endl; fout << " look: " << data_store->talk_strs[i + 10] << endl; fout << " name: " << data_store->talk_strs[i + 20] << endl; fout << " job: " << data_store->talk_strs[i + 30] << endl; fout << " confused: " << data_store->talk_strs[i + 160] << endl; } for (i = 40; i < 160; i++) if (strlen((char *) (data_store->talk_strs[i])) > 0) fout << " Node " << i << ": " << data_store->talk_strs[i] << endl; fout << endl; } fout.close();} The above code should run equally well on Windows as on the Mac, if anyone feels like using it. I didn't incorporate Ishad's changes to the Data Dump, though, mainly because it seemed like a lot of them were already covered by the Scenario Text Dump. I may incorporate some of them later.For the above code to work, the following two lines must be added near the top of the tfileio.c(pp): Code: #include <fstream>using std::endl; (I'm pretty sure C++ rules state that the second line is unnecessary, so your compiler may not need it.)The code doesn't check to see if the file already exists. If it does, it will be overwritten. If not, it will be automatically created. Quote
Well-Actually War Trall Ishad Nha Posted April 14, 2009 Author Posted April 14, 2009 Here I have included the original question by Celtic Minstrel in bold Okay, I made this change both to horses and to boats. Obviously we should change the text in that dialog that says there are 24 boat slots when in fact there are now 30... Oh yes, Gamedlog.rc dialogs 808 and 809. Originally Posted By: Ishad Nha Scendata.txt changes, see line 1,214 of Tfileio.cpp (my very much altered code): void start_data_dump() ...I don't see what you mean, but I'll take a look at your code and see if it helps. ((Here I am replying to your query below: Originally Posted By: Ishad Nha a few quick fixes on the way: Editor now supports the last six boats and horses. After creating Scendata.txt, the editor loads the outdoor zone last edited and the town last edited. (It opens every zone and town to retrieve the names.) Set outdoor start location is now moved to the Scenario menu. Scenario file names can now be anything that Windows permits. What did you do to fix these? )) EDIT: Eek, it would appear that the text and data dump features don't even work. I'll have to do something about that. They both work on Windows, unlike the shopping data dump, there I have to use the Zoom Editor. EDIT: In handle_scenario_menu(), case 19 was missing a break; and case 20 had an unnecessary check for if(change_made == TRUE). Case 119 was missing a final break? Case 120, the if clause you will find in the unaltered Ormus source code. EDIT: Is there any reason not to rewrite these two functions to use ofstream instead of FSWrite? Because that would be so much easier... If you want to alter it, feel free. Originally Posted By: Ishad Nha Scenario file names, see line 2,416 of my Scenario.cpp: void edit_make_scen_1_event_filter (short item_hit) Okay, my only question then is, why did you make 28 the new limit? I'm more inclined to set it to 50 or something. 28 was a random choice Quote
Understated Ur-Drakon Celtic Minstrel Posted April 14, 2009 Posted April 14, 2009 Originally Posted By: Ishad Nha Here I have included the original question by Celtic Minstrel in boldOkay, I made this change both to horses and to boats. Obviously we should change the text in that dialog that says there are 24 boat slots when in fact there are now 30... Oh yes, Gamedlog.rc dialogs 808 and 809. Thanks, but I'm afraid the Mac resources use a completely different format. Originally Posted By: Ishad Nha EDIT: Eek, it would appear that the text and data dump features don't even work. I'll have to do something about that. They both work on Windows, unlike the shopping data dump, there I have to use the Zoom Editor. See my previous post just above – I fixed the problem by pretty much rewriting the functions from scratch using a more intuitive (to me) library. I didn't incorporate your changes, but the code I used is platform independent. Originally Posted By: Ishad Nha EDIT: In handle_scenario_menu(), case 19 was missing a break; and case 20 had an unnecessary check for if(change_made == TRUE). Case 119 was missing a final break? Case 120, the if clause you will find in the unaltered Ormus source code. Case 19 was for the "Write Scenario Data" menuitem, and case 20 was for the "Dump Scenario Text" menuitem. I don't know why the constants would have 100 added to them on Windows, since they're just the index of the menuitem in the Scenario menu. Originally Posted By: Ishad Nha EDIT: Is there any reason not to rewrite these two functions to use ofstream instead of FSWrite? Because that would be so much easier... If you want to alter it, feel free. I already did, see my previous post. Originally Posted By: Ishad Nha Originally Posted By: Ishad Nha Scenario file names, see line 2,416 of my Scenario.cpp: void edit_make_scen_1_event_filter (short item_hit)Okay, my only question then is, why did you make 28 the new limit? I'm more inclined to set it to 50 or something. 28 was a random choice Okay, well I randomly chose 50 instead. If Niemand is reading: Do you think it would be possible to get the game to use a .nib file for menus and dialogs? Quote
Understated Ur-Drakon Celtic Minstrel Posted April 15, 2009 Posted April 15, 2009 Whoosh, I just finished a significant alteration to the dialog code. Now it's possible to add graphics to the default sheets, and even add new sheets, and have the Scenario Editor notice their presence. It's too complicated to describe here, but you could check out the detail for revision 16 at the Google Code site. (The first two, Blades of Exile Base and Blades of Exile Graphics, are irrelevant to the change.) I actually added about a sheet and a half's worth of terrain graphics from Exiles 1 through 3 that were not included in BoE. I'll post what the sheets look like soon. If I forget, remind me. Quote
Well-Actually War Trall Ishad Nha Posted April 15, 2009 Author Posted April 15, 2009 That code is only good for Mac is it not? What about the boats being shown in town code for the Scenario Editor? Quote
Well-Actually War Trall Niemand Posted April 15, 2009 Posted April 15, 2009 At a glance Minstrel's code looks like it doesn't use anything platform specific, aside from alteration of the resource files themselves. Any code necessary to load multiple bitmaps, to parallel the loading of multiple PICT resources, could likely be scavenged from the Windows BoA editor. (This is if I understand the situation correctly; I admit that I've only been glancing cursorily at the development work you guys are doing here.) Quote
Understated Ur-Drakon Celtic Minstrel Posted April 15, 2009 Posted April 15, 2009 Apart from the change to load an additional bitmap, it should be portable. It turns out I overlooked some of the consequences of those changes, such that preset dialogs would no longer display their icons. Revision 17, once committed, will fix those problems. (Currently, they're mostly fixed; however I'm still having problems with the animated terrain graphics.) While the change introduced bugs, it's not a breaking change. It just means the flavour graphics won't show up in dialogs. The only other thing you would need to use the code from revision 16 (and 17, once committed) is a copy of the altered bitmaps. I intend to post them here at some point, but unless the Windows version is using the Mac graphics rather than the Windows graphics, it would clash (the Windows graphics are significantly brighter). The affected files so far are ter6.bmp, ter7.bmp (new), and teranim.bmp. I may or may not add a few item graphics as well, and I intend to add a few monster graphics (such as Garzahd). As for the boat-drawing code, I'll look around for it sometime soon. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 15, 2009 Posted April 15, 2009 The bugs are fixed in revision 17. It turns out that the failure to see the added animated terrain graphics was due to the fact that, for preset animated graphics, the game counts down first, then across. The other problem was simply forgetting to deduct 400 from the graphic number. As promised, I have uploaded the graphics sheets that I changed. They are GIF images, so you will have to either convert them to BMP or construct them yourself by grabbing the images from the Windows version of the Exiles. (Remember that the original Window graphics are brighter than their Mac equivalents, so you probably shouldn't mix Mac and Windows graphics. ter6.bmp ter7.bmp (new) teranim.bmp dlogpics.bmp One problem is that the map graphics do not display for the added graphics. That will require some code changes as well as altering the map sheet. It appears that Windows stores the map graphics in mixed.bmp – if you could alter the code to search a new file, say termap.bmp, it would probably help. That file would look something like this. Finally, boat drawing code. In tGraphics.c, in the function draw_terrain(), I have the following code: Code: if (editing_town == TRUE) { for (i = 0; i < 30; i++) { if ((scenario.scen_boats[i].which_town == cur_town) && (scenario.scen_boats[i].boat_loc.x == cen_x + q - 4) && (scenario.scen_boats[i].boat_loc.y == cen_y + r - 4)) Draw_Some_Item(mixed_gworld,boat_rect[0],ter_draw_gworld,where_draw,1,0); } for (i = 0; i < 30; i++) { source_rect = boat_rect[0]; OffsetRect(&source_rect,0,74); OffsetRect(&source_rect,56,36); if ((scenario.scen_horses[i].which_town == cur_town) && (scenario.scen_horses[i].horse_loc.x == cen_x + q - 4) && (scenario.scen_horses[i].horse_loc.y == cen_y + r - 4)) Draw_Some_Item(mixed_gworld,source_rect,ter_draw_gworld,where_draw,1,0); } This appears to be the code for drawing boats and horses. You may have to change the parameters to Draw_Some_Item or swap the numeric parameters to OffsetRect. Now... question. There is a duplicated item graphic (mushrooms) and a duplicated monster graphic (cockroach). I'd like to get rid of this redundancy by replacing one of the duplicates with a different graphic, but obviously that would break compatibility. Should this simply be ignored? Or should it perhaps be put off until a scenario format rewrite (the redundant graphic could be automatically substituted with its duplicate when converting a scenario to the new format)? By the way... Originally Posted By: Alcritas * The 100 Town Bug — Blades Of Exile says it can support 200 towns, but leaving any town numbered higher than 99 will cause the game to crash. (Theoretically, you could use towns 100 and up for end of scenario towns that can’t be left for any reason other than to end the scenario, which would provide a little more room, but I’ve never tried this) Does that bug still exist? I think it was a Windows-only bug. Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted April 15, 2009 Posted April 15, 2009 I have a question. Why do we need to actually add the old graphics to the built-in graphic sheets, when we can just put them in the custom graphics sheet for the scenario? With the altered defaults method, we take a few seconds off the creation of the scenario, at the cost of incompatibility with older versions of BoE. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 15, 2009 Posted April 15, 2009 New scenarios that use the graphics would not work under an old version of the game, yes, but then we're planning to rewrite the scenario format anyway, so I don't think that's an issue. Backwards compatibility is good, but forwards compatibility is too limiting. You're right, we don't need to add the old graphics to the built-in sheets. On the other hand, I can't think of any other argument against it, and it's already been done. And as a bonus, the changes I made to do it will help when trying to get the editor to display custom graphics in dialogs. Before doing that, though, I should probably make sure the changes have been applied to all three versions of the dialog code... EDIT: Actually, the "additional default graphics" part could even be reversed without giving up the benefits of what I went through to implement them, simply by changing a few constants. Quote
Hatchling Cockatrice Lilith Posted April 15, 2009 Posted April 15, 2009 Originally Posted By: Celtic Minstrel Originally Posted By: Alcritas * The 100 Town Bug — Blades Of Exile says it can support 200 towns, but leaving any town numbered higher than 99 will cause the game to crash. (Theoretically, you could use towns 100 and up for end of scenario towns that can’t be left for any reason other than to end the scenario, which would provide a little more room, but I’ve never tried this) Does that bug still exist? I think it was a Windows-only bug. I thought it existed on both platforms, but I'm not 100% sure. In any case, further research discovered that it only affects towns numbered between 100 and 127. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 15, 2009 Posted April 15, 2009 Why did I ask that question in this thread...? By the way, I've temporarily disabled the extra graphics. Since, as ADoS says, it breaks forward compatibility, we might as well wait until we actually implement a new scenario format version so that if anyone tries to play a scenario using those graphics they'll at least get a "created with a later version" error rather than not seeing the graphics (or worse, crashing). I did this simply by changing the constants that specify how many graphics of each type exist, so changing the constants back will instantly re-enable the extra graphics. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 17, 2009 Posted April 17, 2009 Ishad, just wondering... did you incorporate those code changes to dlogtool? Quote
Well-Actually War Trall Ishad Nha Posted April 18, 2009 Author Posted April 18, 2009 I last altered the dlogtool file on the 9th. What changes are you referring to? The source code has been updated today at http://www.freewebs.com/ishadnha/2009BoESESource.zip Quote
Understated Ur-Drakon Celtic Minstrel Posted April 18, 2009 Posted April 18, 2009 I was referring to the changes I made to my version of that file in revisions 16 and 17 (go back one page). Quote
Well-Actually War Trall Ishad Nha Posted April 21, 2009 Author Posted April 21, 2009 The snag here is that I will be comparing a Mac file to a Windows file as well as comparing a new Mac file to an old Mac file. I am looking at both files with WinMerge, there are an awful lot of differences. It is hard to tell whether something is a purely Mac bug fix or whether it applies to Windows too. Quote
Understated Ur-Drakon Celtic Minstrel Posted April 27, 2009 Posted April 27, 2009 I made several changes to the editing palette of the scenario editor, mainly to make room for adding additional buttons at some point. They can be seen in revision 37 (which also includes edits to make use of my new scenario editor mode constants). If you want to incorporate the changes I've made, you'll need to replace edbtns.bmp with this image. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.