Graphics.AddingAReconfig - lordmundi/wikidoctest GitHub Wiki

Adding a Reconfig

« Adding a Tcl Script | EDGE User’s Guide | Advanced Lighting Effects »

Simple directions

  1. Make sure $USERDATA/user.cfg is defining RECONFIG_FILE to $USERDATA/reconfigs/input.USER
  2. Edit $USERDATA/reconfigs/input.USER
  3. Add reconfigs and toggles in their respective blocks using the documented syntax in the file


An example EDGE reconfig menu

What's really going on

Ultimately, the reconfig file that gets used is the one passed in to the script plugin on the command line. For example, as of this writing, the default config file has:

-plugin script      '-input "${RECONFIG_FILE}"'

in the command line block. This ${RECONFIG_FILE} variable is being set in the environment. What is suggested is to override this variable in the user's user.cfg DEFINES block, and point to a reconfig file below the userdata directory so that the user can add reconfigs and toggles.

"But won't that make me lose the reconfigs that are normally included?" Yep it will. Unless you put a postload at the top to tell it to include another file. You can put something like:

POSTLOAD
 {
   ${DOUG_HOME}/reconfigs/input.${MISSION}
 }

That will pull in the delivered reconfig after your inputs. This way you can add to the list, and also inherit the delivered data. It also makes updates to the delivered reconfig seemless as there is no need to integrate or merge your previous work.

Syntax

For the syntax of the reconfig blocks themselves, see the top of the reconfig file. Most reconfig files that are delivered have a section at the top with comments showing the commands and usage.

Most people just need to relink a node, or move some DOF of the node. Moving or relinking a node with a reconfig is very easy. The LINK command is probably what you want if you want to reparent a node to another node. For example, to have a node jump to the position of a different parent, you might have:

LINK body_B body_rms 0 0 0 0 0 0

that would reparent body_B to body_rms and set xyzPYR all to 0. Of course, you can do multiple commands inside a block, so when you click a reconfig, it can do as many things as you like.

If you just want to move or rotate a node without adjusting the parent, you can use the POSITION command, and for any DOF that you don't want to change, you just use "*". For example,

POSITION FSS_GEAR_RING * * *| * 180 *

would change the "Yaw" of the FSS_GEAR_RING node to 180 without changing any of the other fields.

The commands for the reconfig files are:

reconfig
{
# LINK       NODE1->NODE2     X Y Z P Y R
# MOVE       NODE1  ROT/AXIS  START   STOP   DEG/SEC
# MOVE       NODE1  x y or z  START   STOP   UNITS/SEC
# ROTATE     NODE1  P Y or R(+,-,STOP)   ROT/AXIS   DEG/SEC
# MODELS     NODE1
# TOGGLE     NODE1   FLAG
# SWAP       NODE1<->NODE2
# POSITION   NODE1   X Y Z P Y R
# GROUP_MOVE NODE    DIR/ROT  START STOP INC  SINGLE_STEP(if wanting to increment one step at a time)
# GROUP_MOVE NODE    DIR/ROT  START STOP INC
# FOV        CAMERA    fov
# SCRIPT     tcl_script

}

« Adding a Tcl Script | EDGE User’s Guide | Advanced Lighting Effects »