• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 IDE suggestion: allow expressions in editor fields

csanyk

Member
In any field which I might enter a number, allow me to type an expression, and then automatically replace that with the result.

For example, let's say I'm in the Sprite Editor, and I want to change the size of the Sprite. Currently, I have to type the literal value into the height and width property fields that I want to change to.

But I'm working with a Sprite that I want to turn into a tileset, and I just realized I need to add a new row of tiles to my grid. I don't know how big that is, but I know how big my tiles are: 32. My image is already 128 px tall. So in the height, I could type "160" if I knew that 128 + 32 = 160. Or, what I propose: I could just type in +32 at the end of the current value, hit enter, and the IDE evaluates the expression that I typed in, and updates for me.

It'd be SUPER slick if I could type in expressions containing tokens for constants defined in my game, as long as they're known pre-compile time. For example, say I'd like to be able to set my room width as (TILE_SIZE * 40), where TILE_SIZE is a macro that stores a static value, 32. TILE_SIZE*40 evaluates to 1280. The IDE knows this, and sets the room to 1280 px wide.

Obviously any value that isn't knowable prior to compile time would be inaccessible to the IDE, so wouldn't be usable, so I'm not asking for that. Even just simple arithmetic calculations using literal number values would be helpful tho.

You could even have the project remember the expression, display the result in the field, but when the field has focus for editing, show the expression that generated the result. Then it would be easier to tweak.

This would save me SO MUCH TIME opening up calc.exe and running calculations and then typing the results into my project.
 
Last edited:

Llama_Code

Member
This would actually be pretty cool. I have used design software that does this, its a handy feature, and I know there have been times I have had to pull out the calculator to determine things like that.
 
This would be fantastic. I hate having to yank out my phone or run the calculator program in the middle of coding something. It's very disruptive of my work flow.
 

xot

GMLscripter
GMC Elder
Lightwave3D lets you do basic math in numeric fields. I always loved that feature.
 

GMWolf

aka fel666
I think a great refference is blender 3d. Every input field allows for expressions to be typed it. Increadibly useful!
 
Top