September 10 2016 build

From Skyscraper
Jump to: navigation, search
This is the article of a development build of Skyscraper Simulator.
It has been confirmed a good-faith contribution to the Skyscraper wiki.

This build has a lot of work put into it, and there's also a number of important bugfixes in it. There was a delay with putting out this build, since I was in the hospital recently (for 2 weeks) which was a fairly scary experience for me since I wasn't allowed to do much at all, and so I'm glad to be back home. I did some planning on features and fixes while there (not much, but some), and the constant-pressure Hoistway Access feature (with the toggle option for it) was one of the things I wrote down. I had forgotten that controls and actions didn't support constant-pressure, so I had to code that yesterday.

The main features/bugfixes:
-Hoistway Access mode has been improved greatly. It now moves the car by itself without needing to use the inspection service mode controls (it was this way before, because I wasn't sure how it worked).
-Hoistway Access mode requires constant pressure to move the elevator, and actions/controls support constant pressure on a per-action basis. This can be turned off with the HoistwayAccessHold parameter.
-The SBS engine can be reset (the same as when you leave the building and enter a new one) by selecting it in the Object Manager and clicking Reset
-a bunch of fixes for multi-car support, including for bugs that were reported
-Call Buttons have been remade, and now use Button Panels (the button panel code was made independent for this). This also means that it uses standard controls, and the controls use actions too, which can be used from scripts. This was a change that I had wanted to do for a long time, and I remember doing the work for this code at my church in the lobby, with my laptop.
-Call Buttons can now be used with verbose mode on, since they don't spam the console anymore - they check the elevators every second instead of every frame. This involved and included changes to object callbacks, and lots of cleanups and revamps were done to make the C++ code much nicer.
-in the C++ code, each object can optionally have it's own OnClick and OnUnclick function, in order to run code when it's clicked, or the mouse button is released (the release is used for the constant-pressure switches). The C++ code is getting much nicer to work with and much more powerful.
-the back of the Button Panel can be hidden by leaving the "texture" parameter blank, so there's no need to use the separate parameter to show the back. This is used by call buttons.
-a serious bug was fixed in the GetObjectRange function (used in scripts when specifying ranges), that broke the "Stairwells" range.
-CheckScript mode has been added an can be run from the command line (run Skyscraper with the "-k" parameter for this). This runs a building script faster on startup (without running the real processing functions) and then immediately exits it, and is used to quickly check scripts for issues.
-in the "Elevator:Car" script parameter, when just the elevator is specified, it'll find the car that services the floor and use that, instead of just using the first car every time.

More info on recent changes can be found in the previous build post:

Reply to this post for more information on features and other things, if you need.

Most of the work in the changelog is to the C++ code, and refer to functions in that.

-fixes for reported issues with multi-car support
-for the "Elevator:Car" script parameter, if just the elevator is specified, the code should find the car that services the floor, instead of just using the first car
-added INI file and script "HoistwayAccessHold" option
-added object OnUnclick function, which is called when a mouse button is released on an object
-Hoistway Access mode now uses constant pressure on the switches to work, which can be turned off
-actions can now have a "hold" state, which requires that a control have constant pressure to prevent it from reverting to (normally) an "off" position. Used for Hoistway Access mode
-fixes for ShowMenu behavior and command line "no-menu" option
-added CheckScript mode, which allows scripts to be quickly checked for errors, instead of fully loading them
-fix for the "Stairwells" string match in the GetObjectRange function
-cleanups, found via cppcheck
-memory leak fix for Dynamic Mesh system - the mVertexElements array needs to be deleted on return
-(Scripts) added a check to ensure that a floor's altitude is properly set at the end of a Floor section
-(Scripts) move end-of-section code into per-section functions
-brought back ComputeNormal function, which was removed in revision 4679, due to precision issues causing certain walls to display improperly. The issue appears to be due to Ogre's Plane function calculating in double-precision mode, with the ComputeNormal calculating in single-precision, so a workaround has to be found for Ogre.
-character controller should remove itself from Bullet world on delete
-call buttons should not store pointers to control objects; this fix now allows for the call button's controls to be deleted
-call button actions can now be used from scripts, and details have been added to the guide
-add note about how leaving the "texture" parameter blank for the button panel, will hide the back
-revamped Call Button objects:
--action system now supports Call Button actions
--made Button Panel code generic (removed dependency on Elevator Cars), so that it can be used with multiple types of parents
--switched Call Button object to use a Button Panel as it's button canvas
-objects need to unregister their dynamic runloops on deletion
-added virtual OnClick function for objects
-shut down resource manager on exit
-have character controller properly clean up objects when deleted
-call button timer should quickly fire on the first shot, before waiting a longer interval for future processing
-added support for dynamic runloops, which should help reduce per-frame loop overhead. This functionality allows objects to optionally register themselves with their parents to activate/deactivate their runloops, and then the parent calls a LoopChildren() function to run all registered child loops
-door movement now uses a standard parent runloop method, instead of a main simulator callback
-have call buttons use a Timer object for processing the call loop (frequency set to 1 second), instead of using a callback entry in the simulator root
-fixed a loop issue in the ProcessGotoFloor function that was causing some elevator cars to be skipped
-fixed problem in FinishMove function, where the call button arrival notification was only checking the arrival direction of the primary floor call, not ones for other cars
-when adding an elevator route, the car number should be reported if the elevator has more than 1 car
-when enabling Hoistway Access, require shaft doors to be open on the specified floor
-Hoistway Access switch should cause elevator to move, instead of separately using inspection service controls
-add profiling to ElevatorCar loop
-moved Camera loop code and timing code into standard Loop function
-renamed SBS MainLoop to standard object "Loop", and moved camera loop call to end of SBS loop
-have ResetBuilding function be used as the standard object's ResetState function, and have it also reset the camera state if the camera's active. This allows the SBS engine root to be reset, to reset the building state.

See Also