The 2020 Edition now has movesel, setselpos, getselpos and editinview commands, which allows us to manipulate the selection in different ways, this script puts these commands together and some workarounds with entities to create gotoface and gotoedge, which adjusts the camera automatically and allows you to move it to any orientation of a selection.
Although much slower and verbose than a real implementation, this can still be useful if you don't want to modify the client :P
Each face and edge has an index ranging from 0 to 3 as shown in the image below.
Faces 4 and 5 are not accessible through the gotoface, requiring you to visit a side face and rotate the cube to access them.
Teleports to face F and executes [C]. S is an optional sleep and prevents some sync issues that may occur if there is a nested gotoface.
Teleports to the edge E of the face being looked at and executes [C]. If G is 1, the gridpower will be reduced to the size of the selected edge.
Adds X, Y and Z to the position of the current selection, executing [C] every move.
Returns the face the camera is looking at relative to the world (not the selected face).
Some commands already available in Sauerbraten 2020 Edition that will be useful:
T determines whether the face (0), selection (1) or edge (2) of a cube will be pushed to D, this is the command you will use to push/pull things.
Inverts selected geometry. (you can use it to change the back face in addition to the front face without having to use gotoface twice.)
D determines whether the selection will be moved to x (0), y (1) or z (2) A times.
Rotates once left (-1) or right (1) relative to the selected face, you can use it to change all the edges of the front (and back) face without having to run gotoedge more than once.
Sets the position of the current selection to x y and z or creates a new one.
The proper functioning of editface depends a lot on the camera orientation, gotoface is able to correct the yaw of the camera automatically (using a teleport ent), but the pitch can only be adjusted by respawning the player. To get around this there is the gotoface_fixpitch F [C] command, which is basically the same as gotoface, with the difference that it will respawn the player before continuing.
If you don't want to respawn the player just move the camera closer to the horizon manually (it doesn't have to be perfectly aligned).
There are a few more examples in the cubedeformer_examples.cfg file included in the zip.
How to Install
Just download cubedeformer.zip, extract and place the cubedeformer.cfg file in the Sauerbraten root folder and run /exec cubedeformer.cfg ingame.
If you don't want to extract, just include the command addzip cubedeformer.zip; exec cubedeformer.cfg in your autoexec.cfg file (/notepad autoexec.cfg).
that's it, have fun and feel free to leave any suggestion :)