April 19 2023 build
The build is mostly a large update for both Destination Dispatch and Standard Modes for dispatch controllers, and features new call button functionality.
This build has most of the call button functionality (which waits for elevators to become available, and dispatches elevators) moved into the Dispatch Controller, this is a very big change, so testing is needed because call buttons now use newly-written code. Instead of being independent controllers, call buttons are now simple panel and button objects that request calls from the associated dispatch controller.
This was made possible due to the addition of Standard Mode to routes in the dispatch controller, and is much more realistic and advanced than the previous method of operating call buttons. In the future I'm going to see if I can eliminate the call button objects altogether and use Call Stations instead, this will require some work though to get it working, mainly button lights.
Elevators now drop routes by default in destination dispatch mode if they become unavailable, unless the Reprocess controller parameter is specified. For standard mode, routes are always reprocessed.
A floor parameter called NumberID has been added, which is used by destination keypads to identify which floor number they are.
The InvalidInput callstation parameter has been added, which disallows certain keypad inputs.
Xteal contributed C++ code that automatically finds the direction of the elevators (left/right/opposite), and I removed the ElevatorLeft and ElevatorRight parameters for this.
A number of Mac changes were made, some fixed long-standing issues, and another one supports a Skyscraper folder in Application Support.
Controllers now work with DD mode or standard mode on a per-route basis, which should support hybrid configurations (but this needs to be tested).
I moved the elevator Recheck code from the Callbutton to the Dispatch Controller, which in standard mode, keeps checking to see if a closer elevator becomes available, and automatically switches to that if it can.
Elevators can now be on multiple controllers, this fixes some issues in buildings in standard mode. This needs testing though to find any bugs.
Xteal contributed code to limit inputs on callstation keypads, and do more error checking.
You can now enter and exit freelook mode by using the scroll wheel on the mouse.
For the callstation indicators that show the "??" and "XX" values, for the sounds, instead of trying to load files such as "sound??.wav" (which work on Mac and Linux, but not Windows), I expanded the names so that they now load "soundinvalid.wav" and "sounderror.wav" instead, when something like "sound*.wav" is specified in the script.
Changelog (this is a lot haha):
- Simplify call station name
- (Simple DD building) The Fire mode switches should use the CallStation instead of Elevator for operation
- Updated documentation for callstation actions
- Report and reprocess route if active elevator becomes unavailable during dispatch
- Removed Recheck code from FindClosestElevator() function
- Added support for standard mode in dispatch controllers
- Added standard mode Up and Down actions to Call Station
- Added a callstation test building
- Added ID parameter to elevator editor
- Added NumberID floor parameter, used as the floor ID number mainly for Destination Dispatch keypads
- Added InvalidInput callstation parameter, used to disallow certain floor inputs
- added the Reprocess parameter to controllers, which determines if the controller should reprocess routes if an elevator becomes unavailable or if it should drop the routes
- Make Reprocess only affect Destination Dispatch mode. For standard mode, always reprocess.
- xteal contribued code to automate the car direction indicators (Indicate whether the allocated car is opposite (#28))
- Removed ElevatorsLeft and ElevatorsRight parameters (due to xteal contribution)
- Added code to find Application Support folder on Mac
- On Mac, use Application Support folder if a "Skyscraper" subfolder exists, instead of Application's resources folder
- cat1554 contributed a change to the script guide, "AddTextRange example said "AddText", corrected to "AddTextRange"
- Ensure subfolders exist on Mac when using Application Support folder
- Handle elevator assignments in standard mode
- Call button fix, the new DD exception to AvailableForCall() caused problems with multiple hall call buttons pressed
- Reworked dispatch controller code so that it applies destination dispatch on a per-route basis instead of globally, this should allow hybrid configurations
- Have call buttons use Dispatch Controllers
- Call buttons should report and exit calls if no controller is found
- GetElevator should exit if no elevators have been specified
- Made a CheckArrivals() function for the arrival code, and moved it from the Process() function
- integrated elevator recheck code from callbutton object to dispatch controller
- Allow elevators to be on multiple controllers, this fixes callbutton breakage in some buildings.
- Added support for assigning multiple controllers to an elevator
- xteal contribution: "Cap inputs and do more error checking (#30)"
- Enter or exit freelook mode using mouse scroll wheel
- SetCursor fix for Mac, the old function wasn't properly setting the cross cursor for Freelook mode on Mac
- For the "??" and "XX" call station indicator errors, expand out the names for the sound loading, so that "sound*.wav" loads "soundinvalid.wav" or "sounderror.wav" for those. This is to mainly get around question marks being invalid in filenames on Windows.
- Added code to work with the Metal renderer on Mac, if enabled (even though it doesn't really work yet)
- Fixed the Mac main window hang issue, and made the top-level rendering option default
- Reset turn and strafe values when switching in and out of freelook, to prevent movement from getting stuck