Sauerworld Forum

selectface command

Salatiel

  • **
  • 82
  • +19/-0
    • Cube Br
selectface command
« on: January 04, 2018, 02:51:44 pm »
I really miss a command that selects the faces of a previously selected cube
/selectface N (N is the face number)

 Why would it be useful?
 -You could bind a key to select a back face of a cube, without having to move there to select
- It would be possible to create loop of cubes in different positions instantly using something like:
draw = [
    sleep 10 [selectface 1 ; loop i 6 [universaldelta -1]]
    sleep 20 [selectface 2 ; loop i 6 [universaldelta -1]]
]

^ Then imagining that 1 is the front face of the cube, and 2 the left side, this would result in a curve with 10 cubes...  :o



Maybe if it could depend on the position of the player's camera would be better

Here is a gif, colors are just to exemplify:


(if this command already exists, ignore this suggestion and please tell me what it is  :P)
« Last Edit: January 04, 2018, 03:00:47 pm by Salatiel »

Salatiel

  • **
  • 82
  • +19/-0
    • Cube Br
Re: selectface command
« Reply #1 on: November 07, 2018, 03:58:24 pm »
After a while trying to do this on my own, I came up with a reasonable result:

Code: [Select]
void pushface(int *dir, int *pface)
{
    if(noedit(moving!=0)) return;
    int s = *dir;
    sel.o[*pface] += s*sel.grid;
}
COMMAND(pushface, "ii");

Is a variation/modification of the Pushsel command, and should be added in src/engine/octaedit.cpp
This does not select the face, but moves the selection to the chosen direction.

arg1: -1 || 1 (add or subtract arg2)
arg2: 0 = X || 1 = Y || 2 = Z
« Last Edit: November 07, 2018, 04:00:20 pm by Salatiel »