npruehs / tome-editor

Tome is a generic data editor for games supporting arbitrary input and output formats.
GNU Lesser General Public License v3.0
35 stars 7 forks source link

Field Value Conversions #41

Open npruehs opened 9 years ago

npruehs commented 9 years ago

The user can add, edit and remove custom field value conversions. These conversion are specified in RPN. When adding or editing a field definition, the user can specify a conversion for that field. The conversion is applied when exporting the field values.

pgrimsehl commented 7 years ago

I'm not familiar with the term RPN - does ist stand for Reverse Polish Notation? Can you give an example of how such a definition would look like?

For example if i wanted to export a string type to be always enclosed by " ", what would it look like? Or if I want to export a color value as 0xAARRGGBB hexadecimal value.

npruehs commented 7 years ago

The original idea was to support common value conversions. We've encountered designers to be much more familiar with angles in degrees, while most game engines need angles in radians, for instance. This feature was originally planned for supporting this use case.

You're right: RPN stands for Reverse Polish Notation. The advantage of such a notation is that parsing these is a solved problem. An example would be

$VALUE$ 0.01745329 *

However, you questions suggests that we need to think in a much broader context here :) I haven't imagined that you could something like this for formatting string or color values.

npruehs commented 7 years ago

I'm curious: How badly do you need this? Is this something we should add to the next release?