Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Zajoman

Numerical Constants

Recommended Posts

My suggestion is to add an option to define numerical constants and use them in linedef actions (I mean in 2D editor, not ACS). When the map is compiled, Doom Builder would put integers in place of the constants.

The point is to have just a few constants defined for a project and so have speeds, delays and any other numeric related stuff standardized. This way, you don't need to remember what numbers you use throughout the project and you can change behavior once for all things.

Example:
- The user defines a few constants: DOOR_SPEED_SLOW = 8, DOOR_SPEED_FAST = 64, DOOR_DELAY_SHORT = 8, DOOR_DELAY_LONG = 32, PLAT_SPEED_FAST, PLAT_SPEED_SLOW, PLAT_DELAY_SHORT, etc.
- When defining an H Door Generic (202) action for a linedef, the user puts DOOR_SPEED_FAST instead of number in the Movement Speed entry.
- When the map is compiled, the program puts 64 in the entry.

It does not need its own user interface, it can be done via *.cfg or new separate file (constants.cfg). The only problem there might be is that the numerical fields (entries) would have to be changed (likely).

Share this post


Link to post

Not such a bad idea, but I really wonder if it would be usefull. Also when the map is loaded, how can you tell which constants to use? You might have 2 the same constants such as "DOOR_SPEED_SLOW = 5" and "SPAWN_FIVE_MONSTERS = 5" so which one will be shown when the map is loaded in the entries where a 5 is used? nah, isn't going to work.

Share this post


Link to post

You can store the information in a *.dbs file, I believe. Usefulness is in what variables/constants in programming languages are good for. I cannot provide a better argument.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×