Jump to content

New Windows 3D Editor


Ishad Nha

Recommended Posts

  • Replies 495
  • Created
  • Last Reply

Top Posters In This Topic

I don't need Niemand's help to customize the Mac shortcuts. smile It's no harder than customizing the Windows shortcuts. As for Mac freeware compilers, the operating system comes with one so it's not a problem. wink

 

I think it would be best to make all the shortcuts customizable without re-compiling. It would mean the switch statement won't work, though – you'd have to replace it with a lot of if statements.

Link to comment
Share on other sites

Programming non-menu related configurable keyboard shortcuts is pretty trivial; you need a UI for entering them, an interface with a backing store to save them, and replacing hard coded switch statements with searching a list to match the keystrokes to shortcuts. Source code for such would be rather unenlightening, as it would be closely tied to the program it came from. I would note that at least on the Mac side making menu shortcuts user configurable is at the least a non-trivial annoyance; I've seen it done but the system libraries aren't geared to make it easy.

Link to comment
Share on other sites

I don't think it would be too annoying, actually – if it's anything like BoE, the game just reads the keystrokes directly, so it would just have to look it up in a map or something to see if there is an associated command. The value of the map could be a function pointer, which you would simply call, or it could be an enum which you could then switch on. Which one really depends on whether it makes sense for all the commands to be called with the same function signature.

 

EDIT: Something like this:

Code:
std::map<char,eCommand> keyMap; // Global declarationswitch(keyMap.find(key)){case CMD_PENCIL:  // ...  break;case CMD_PAINT_SM:  // ...  break;// etc}

or this:

Code:
std::map<char,void(*)()> keyMap; // Global declaration// Alternative declaration:// std::map<char,boost::function<void()> > keyMapkeyMap.find(key)(/*some params if necessary*/);
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
I don't think it would be too annoying, actually – if it's anything like BoE, the game just reads the keystrokes directly, so it would just have to look it up in a map or something to see if there is an associated command.

This is true of the keys used for the editing tools but doesn't work directly for menu items, as a (deprecated) library function is used to do the lookup at the moment. Also, system libraries are handling reading the shortcut mappings from the resource file and set them on the menu items.
Link to comment
Share on other sites

  • 2 weeks later...

Blades of Exile Scenario Editor enables you to create a scenario with a specific number of large, medium and small towns. By contrast, BoA always starts with only one town, always of medium size.

If there was any desire for this feature it could be added easily enough. In the meantime you can create a new BoE scenario with the desired number of towns then port it to BoA using the Import Blades of Exile Scenario function in the Edit menu.

Link to comment
Share on other sites

I think that there isn't a whole lot of need for creating all of the towns by size at the start, although being stuck with the first town always as medium sized is annoying. I hope soon to finish porting the code I wrote for the Mac version which allows it to change the size of a town that is already in the scenario, which would give designers the freedom to make the first town whatever size they want.

Link to comment
Share on other sites

  • 2 weeks later...

I've just checked in changes which should alter the 3D view size to match that used by the game itself. I think I got all of the relevant changes that were need to make this work, but somebody should check me to make sure i didn't overlook something.

 

Glancing over the ToDo list of major changes we have: (struck through items are completed)

  • Add Undo/Redo support
  • Correct 3D view size
  • Rearrange tool buttons in order to...
  • Add eyedropper, floodfill, terrain copy, and terrain paste tools
  • Add creature and item palettes
  • Fix crashing in BoE import feature(*)
  • Replace delete last town feature with delete current town
  • Add change town size command
  • Fix Change Outdoors Size to not scramble data(**)
  • Add list views when selecting town/outdoor section to load and when selecting town/outdoor section to import

* If I understand correctly this is fixed.

** If I understand correctly this is a problem.

 

Am I overlooking anything important?

Link to comment
Share on other sites

  • 1 month later...

Changing the subject:

Town reports can be updated as needed, if they are opened in something like Crimson Editor. Simply choose the new 3D Editor's "Query > Town: Write Data To File" command once again, this will overwrite any previous version of this file found in the scenario's directory.

Then use the File > Reload function found in Crimson Editor, this will reload the file showing the latest version of it. Thus you can continually update the report as you work on the given town.

Ditto any other type of report generated by the Editor.

Link to comment
Share on other sites

Town reports have been altered to print the names of items and creatures.

Terrain scripts used to have a default name of "Blank", then I changed that to "door". I might change that to "specobj" because most door scripts would be automatically placed with a door terrain type. I imagine that when a script is placed manually, most of the time most designers would place some other script.

I might also create a Full Town Report that lists memory cells too, this will enable the tracking of memory cell 3 for creatures.

Link to comment
Share on other sites

Originally Posted By: Ishad Nha

Terrain scripts used to have a default name of "Blank", then I changed that to "door". I might change that to "specobj" because most door scripts would be automatically placed with a door terrain type.
Yes, making "door" the default is as useful as having "Blank" as the default, whereas having "specobj" as the default could actually be useful sometimes... it is included in every scenario by default, right?
Link to comment
Share on other sites

Yes, at the end of the function create_basic_scenario you find the list of the default scripts:

trap.txt

door.txt

specobj.txt

basicnpc.txt

guard.txt

 

Full town report function was created, it lists the memory cell contents for terrain scripts and creatures. It is included in my version of the 3D Editor:

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

 

Next thing that needs fixing is that change outdoor size function.

Link to comment
Share on other sites

Change Outdoor Size function is the one clear problem remaining.

I changed a scenario so that it had one extra column of outdoor sections, W*H = 5*5 became 6*5. Outdoor section that was open at the time lost all its terrain, town entrances. Coordinates of area rectangles were reversed, ditto any other Short number. It was only this one outdoor zone. (I detected this by use of the Full Outdoor Write Up: All Zones function.)

Now I am trying to understand the function, so I am reading townout.cpp. In Blscened.rc the relevant dialog is number 991. I copied it into Word, changed all the commas and quotation marks to tabs and then pasted it into an Excel spreadsheet. This will enable me to understand the code. I made a screen capture of the dialog box concerned. Then in Excel I sorted dialog 991 by the y coordinates of each entry then by the x. Comparing the screen capture with the contents of dialog 991 makes it easy to see what part of the screen is created by each line of the dialog.

 

 

Link to comment
Share on other sites

The problem has nothing to do with the dialog that lets the user select the changes to make, it's in the function do_save_change_to_outdoor_size() in Bl A Fileio.cpp. Your statement that 'Coordinates of area rectangles were reversed' could be an important clue though, as it may mean the only actual problem is one extra port() call or one call too few. If I get time tonight I'll take another look at it in light of this information.

Link to comment
Share on other sites

My point is that the dialog, and its associated functions (change_outdoor_size() and change_outdoor_size_event_filter()) merely take the user's requests; they do none of the actual work. If you want to understand them that's fine and a useful thing to do in and of itself, I just wanted to make sure you didn't get your time wasted by being sidetracked to the wrong area of the code.

Link to comment
Share on other sites

My hunch is that all shorts were flipped. In the case of -1 this won't show because it is written FF FF when it is Short. This is not a big deal because you can always import the relevant section from the backup.

Change Outdoor Size is not a very involved function, all you are doing is adding blank outdoor zones or deleting existing ones.

Edit:

I just tried adding a new column of zones to my A1 Template, nothing happened, the program reported error 61.

Link to comment
Share on other sites

Brought into line with my variant, hence an outdoor zone report and so on. See the upload notes.

Edit

New features:

[*] Both town reports show sign and area rectangle texts.

[*] New full town write up that shows all memory cells for creatures and terrain scripts: 'Full Town Report.txt'.

[*] New current outdoor zone write up report: 'Current Outdoor Zone Write Up.txt'.

[*] All outdoor zone write up for special states and town entrances: 'Outdoor Zones Write Up.txt'.

[*] Updated dimming out of Query entries, except for first two.

[*] Changed version date.

 

 

 

Link to comment
Share on other sites

I added a scenario report that lists introductory text, variable town entries and item placement shortcuts. (I don't think anyone ever uses the item shortcuts in practice.)

The report will enable designers to check the length of each paragraph to make sure that the limit of 255 characters is not exceeded. Might be handy if there was some way to paste text into the dialog box window, that way you could write it in Crimson Editor, check its length and then paste it right in.

Link to comment
Share on other sites

Yes, a quick check shows that it will paste from Crimson Editor, the relevant text was given a plain text format.

Edit:

The problem is that assigning the relevant shortcut keys, (Ctrl + C, Ctrl + V and Ctrl + X) to selected objects means they are not available in dialog boxes. Once this assignment is removed in Blscened.rc the shortcut keys work as they normally do.

Link to comment
Share on other sites

Deletion of objects has been revised:

Backspace now deletes any selected object, then it reverts to select object mode.

Thus you can select objects and delete any you don't want. Just the thing for cycling through a list of items.

Ctrl + C, Ctrl + V and Ctrl + X shortcuts have been removed because they stop the use of the copy, paste and cut functions when editing text.

As I am not too sure how popular these changes will be they are made to the alternate version of the editor:

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

Edit:

I have altered the Basic Scenario Details dialog in the Scenario menu so that the Description has more space for its display. Idea is to mimic the amount of space available in the Enter Scenario part of the BoA game. I had to guess the size of the space available in BoA. Font used seems to be different in size. I will need to check this before committing it.

Link to comment
Share on other sites

Originally Posted By: Ishad Nha
Ctrl + C, Ctrl + V and Ctrl + X shortcuts have been removed because they stop the use of the copy, paste and cut functions when editing text.
Can't you just temporarily remove them while a dialog box is onscreen, then reinstate them when it's closed? Because by doing this you've created the exact same problem all over again, except for objects rather than text.
Link to comment
Share on other sites

We already have three shortcuts: ",","." and "/". My programming knowledge is pretty basic. I tried that idea of course, but I don't know how to encode "if a dialog box is onscreen cut,copy and paste text".

Edit:

Actually, there are a few Ctrl + Letter shortcuts still free. So I could work out a replacement triple.

Basic shortcuts:

O, S, N, Q, Z, Y, D, L, R, T

Shortcuts I want freed up:

X, C, V

Left overs:

A, B, E, F, G, H, I, J, K, M, P, U, W

 

I will be concentrating on these:

A, B, E, F, M, P, U, W

 

Link to comment
Share on other sites

Um, what are you talking about? Cut, copy, and paste must be Ctrl-X, Ctrl-C, and Ctrl-V respectively, unless you want everyone to be utterly confused.

 

I'd suggest trying to figure out how to do it properly, rather than creating workarounds for your lack of programming knowledge.

Link to comment
Share on other sites

See if Niemand has any answers. It will take ages for me to figure out how to do it. I lack basic knowledge and resources.

Edit:

I can create two versions, one with the shortcuts and one without. It will take a while for me to get the hang of using the three shortcuts for two separate things, time that could be better spent elsewhere.

Link to comment
Share on other sites

The first thing I have to say is please, for the love of all good things, don't mix up all of the keyboard shortcuts.

 

I'm not sure what exactly would be entailed in allowing the standard cut, copy, and paste shortcuts to work normally on text when a dialog is showing, but the basic method would not be to check whether a dialog is showing so much as to switch behaviors when you show a dialog and switch them back when you take a dialog down, I think.

Link to comment
Share on other sites

Okay, the official version has the usual shortcuts. Certain changes have been made to it:

Certain query files now have the scenario name in their title.

Basic Scenario Details dialog box has been increased in size, hopefully the description box will be roughly what the BoA game shows.

Some dialog boxes tidied up to look better.

Intro Text dialog boxes have a note at the bottom:

"Cut, Copy and Paste Functions: " "Can only be accessed by right-clicking the text box and choosing them from the context menu."

They have also been widened a bit to try and make sure all the text shows.

 

I will introduce a "most recently used query function" which can be activated by a simple Ctrl + I. Then the scenario file will print the lengths of the paragraphs.

Edit:

I have been experimenting with using the arrow keys to change the currently selected floor or terrain. It is roughly working, with a few glitches in steering when you change keys.

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...