sandbox default.cfg

Started by vampirefrog, March 11, 2009, 11:19:52 AM

Previous topic - Next topic

vampirefrog

This might be useful for making cfg files, especially the @shiftkeybind, @ctrlkeybind and such, you can basically bind CTRL+F11 and stuff like that:

Hirato gave it to me:

// these default settings get executed whenever "config.cfg" is not available
// do not modify anything below, instead change settings in game, or add to autoexec.cfg

if (strstr (getname) "ssandboxer unnamed") [name "Sandboxer"]
team "PAS"

//set hud theme here.. this is just for colours really...
exec hud/2.3.cfg

mapcomplete = [ complete $arg1 packages/base ogz ]
mapcomplete map

complete importcube packages/cube cgz
complete demo . dmo

//////////////////////////////////
// universal scrollwheel + modifier commands:

defaultmodifier = 0
modifier = $defaultmodifier
domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ] ]

universaldelta = [
  do [delta_@(if $editing [ result edit ] [ result game ])_@modifier @arg1]
]

bind G [ domodifier 1 ]

// commands below are used with scroll wheel (and universaldelta).
// if you have no scroll wheel or don't want to use it,
// you can either change the binds of universaldelta
// ex:  bind MOUSE4 [ universaldelta 1 ]
//      bind MOUSE5 [ universaldelta -1 ]
// can be changed to:
//      bind INSERT [ universaldelta 1 ]
//      bind DELETE [ universaldelta -1 ]
// so that the INSERT and DELETE key act just like a scroll wheel
//
// or you can rebind all the commands to seperate keys
// ex:  bind T [ domodifier 6 ]
// can be changed to:
//      bind HOME [ edittex 1 ]
//      bind END [ edittex -1 ]

delta_edit_0 = [ if $blendpaintmode [ nextblendbrush $arg1; echo (getblendbrushname (curblendbrush)) ] [ editfacewentpush $arg1 1 ] ] // Fill and Empty cube, or switch brushes when blendpaintmode
delta_edit_1 = [ gridpower (+ $arg1 $gridpower) ]
delta_edit_2 = [ editfacewentpush $arg1 0 ] // push face/corners selected
delta_edit_3 = [ editfacewentpush $arg1 2 ] // push corner pointed at by cursor
delta_edit_4 = [ editrotate $arg1 ] // rotate 90 degrees
delta_edit_5 = [ entproperty 0 $arg1 ]  // and the others
delta_edit_6 = [ edittex $arg1 ] // change textures
delta_edit_9 = [ selectbrush $arg1 ] // change heightmap brushes
delta_edit_10 = [ entautoview $arg1 ]
delta_edit_11 = [ entproperty 0 (* $arg1 $multiplier) ]
delta_edit_12 = [ entproperty 1 (* $arg1 $multiplier) ]
delta_edit_13 = [ entproperty 2 (* $arg1 $multiplier) ]
delta_edit_14 = [ entproperty 3 (* $arg1 $multiplier) ]
delta_edit_15 = [ entproperty 4 (* $arg1 $multiplier) ]

multiplier = 1

VARoutlinecolours = ["0xFF0000" "0x00FF00" "0x0000FF" "0x000001" "0xFFFF00" "0xFF00FF" "0x00FFFF" "0xFFFFFF" "0x00FF7F" "0xFF7F00" "0x7F00FF" "0xFF007F" "0x007FFF" "0x000000"]

changeoutline = [
    VARoutlinestatus = (mod (+ $arg1 $VARoutlinestatus) (listlen $VARoutlinecolours))
    if (> 0 $VARoutlinestatus) [
        VARoutlinestatus = (+ (listlen $VARoutlinecolours) $VARoutlinestatus ) //just making sure it'll fit
    ]
   
    if (= (+ $VARoutlinestatus 1) (listlen $VARoutlinecolours)) [
        echo "Outline 0"
        outline 0
    ] [
        echo (concatword "Outline " (+ $VARoutlinestatus 1))
        outline (at $VARoutlinecolours $VARoutlinestatus)
    ]
]

togglemessage = [
    if (> $numargs 1) [
        if (= $arg1 0) [
            echo (concatword $arg2 " off")
        ] [
            echo (concatword $arg2 " on")
        ]
    ]
]
//blendpaintmode
paintmodes = ["off" "overwrite blendmap" "merge blendmap" "max opacity to brush's" "inverted merge" "opacity multiplier (erasing)"]

//binds without mutators
editbind SPACE  [ cancelsel; hmapedit 0; passthroughsel 0 ] // meh.. will need to make better fix
editbind MOUSE1 [ if $blendpaintmode paintblendmap editdrag ]
editbind MOUSE3 [ selcorners ]
editbind MOUSE2 [ if $blendpaintmode rotateblendbrush editextend ]
editbindmod LALT    [ passthrough ]
editbindmod RALT    [ passthrough ] //purposely not used for mutators, known to do some funny things on different OS'
bind SPACE "jump"
bind MOUSE2 "jump"
specbind MOUSE1 "nextfollow"
specbind MOUSE2 "nextfollow -1"
specbind MOUSE3 "follow"
specbind SPACE "follow"
//mutators
shiftkey = 0
bind RSHIFT [shiftkey = 1; onrelease [shiftkey = 0]]
bind LSHIFT (getbind RSHIFT) //future proofing :D
ctrlkey = 0
bind RCTRL [ctrlkey = 1; onrelease [ctrlkey = 0]]
bind LCTRL (getbind RCTRL)

//bind making made easier
nokeybind = [if (&& (= $shiftkey 0) (= $ctrlkey 0))]
shiftkeybind = [if (&& (= $shiftkey 1) (= $ctrlkey 0))]
ctrlkeybind = [if (&& (= $shiftkey 0) (= $ctrlkey 1))]
bothkeybind = [if (&& (= $shiftkey 1) (= $ctrlkey 1))]
//alphabetical arrangement
editbind A [
    @nokeybind [/font][left][font=courier]
    @shiftkeybind [air]
    @ctrlkeybind [entselect insel]
]
editbind B [
    @nokeybind [domodifier 9; brushcopy = 0]
]
editbind C [
    @nokeybind [editcopy]
    @ctrlkeybind [editcopy]
    @shiftkeybind [clip]
]
editbind D [
    @nokeybind
]
//E reserved for toggle
editbind F [
    @nokeybind [domodifier 2]
]
editbind G [
    @nokeybind [domodifier 1]
    @shiftkeybind [glass]
]
editbind H [
    @nokeybind [hmapedit (if ($hmapedit) 0 1); blendpaintmode 0]
]
//editbind I [redo] //think, is I really screaming redo...
editbind J [
    @nokeybind [domodifier 9; brushcopy = 0]
]
editbind K [
    @nokeybind [calclight 3]
    @shiftkeybind [calclight 2]
    @ctrlkeybind [calclight 0]
    @bothkeybind [calclight -2]
]//meh, might want to try something original
editbind L [
    @nokeybind [fullbright (= $fullbright 0); togglemessage $fullbright "full bright geometry"]
    @shiftkeybind [lava]
]
editbind M [
    @nokeybind [showmat (= $showmat 0); togglemessage $showmat "show material volumes"]
]
editbind N [
    @nokeybind [entselect insel]
    @ctrlkeybind [showgui newmap]
    @shiftkeybind [noclip]
]
//O
editbind P [
    @nokeybind [
        hmapedit 0;
        blendpaintmode (if (= $blendpaintmode 5) 0 (+ $blendpaintmode 1));
        echo (at $paintmodes $blendpaintmode)
    ]
    @ctrlkeybind [ blendpaintmode 0; echo "blendpaintoff" ]
]
editbind Q [
    @nokeybind [domodifier 3]
]
editbind R [
    @nokeybind [domodifier 4]
    @shiftkeybind [editmat respawn]
]
editbind S [
    @nokeybind [backward]
    @ctrlkeybind [showgui savemap]
]
editbind T [
    @nokeybind [saycommand]
]
editbind U [
    @nokeybind [undo; passthroughsel 0]
]
editbind V [
    @nokeybind [editpaste]
    @ctrlkeybind [editpaste]
]
editbind W [
    @nokeybind [forward]
    @shiftkeybind [water]
]
editbind X [
    @keybind [editcut]
    @ctrlkeybind [editflip]
]

editbind Y [
    @nokeybind [domodifier 6]
    @ctrlkeybind [redo]
    @shiftkeybind [showtexgui]
]
editbind Z [
    @nokeybind [undo; passthroughsel 0]
    @ctrlkeybind [undo; passthroughsel 0]
    @bothkeybind [redo]
]
//alternative movement keys.. though I may wish to do them seperately to avoid materials and stuff
editbind LEFT (geteditbind A)
editbind RIGHT (geteditbind D)
editbind DOWN (geteditbind S)
editbind UP (geteditbind W)
editbind 1 [
    @nokeybind [domodifier 11]
    @shiftkeybind [showdynlights (= $showdynlights 0); togglemessage $showdynlights "preview dynlights in editmode"]   
]
editbind 2 [
    @nokeybind [domodifier 12]
    @shiftkeybind [dtoutline (= $dtoutline 0); togglemessage $dtoutline "outline depth testing"]
]
editbind 3 [
    @nokeybind [domodifier 13]
    @shiftkeybind [showlighting (= $showlighting 0); togglemessage $showlighting "preview lights"]
]
editbind 4 [
    @nokeybind [domodifier 14]
    @shiftkeybind [hidehud (= $hidehud 0); togglemessage $hidehud "hidden HUD"]
]
editbind 5 [
    @nokeybind [domodifier 15]
    @shiftkeybind [editingparticles (= $editingparticles 0); togglemessage $editingparticles "show particles in edit mode"]
]
editbind 6 [
    @shiftkeybind [entselsnap (= $entselsnap 0); togglemessage $entselsnap "entity snap"]
]
editbind 7 [
    @shiftkeybind [changeoutline 1]
]
editbind 8 [
    @shiftkeybind [wireframe (= $wireframe 0); togglemessage $wireframe "wire frame"]
]
//9 reserved for thirdperson
editbind 0 [
    @shiftkeybind [allfaces (= $allfaces 0); togglemessage $allfaces "texture all faces"]
]
editbind F2 [
    @nokeybind [showtexgui]
]
editbind F3 [
    @nokeybind [cleargui; showentgui]
]
editbind F4 [
    @nokeybind [showgui skies]
]
editbind F5 [
    @nokeybind [showgui entfind]
]
editbind F6 [
    @nokeybind [notepad (mapcfgname)]
]
editbind F7 [
    @nokeybind [showgui editopts]
]

editbind COMMA  [
    @nokeybind [domodifier 10; onrelease entautoview]
]
editbind PERIOD [
    @nokeybind [selentedit]
]
editbind KP_ENTER [
    @nokeybind [entselect insel]
]

editbind BACKSPACE  [
    @nokeybind [editdel]
    @ctrlkeybind [entselect insel; editdel]
]
editbind DELETE [
    @nokeybind [editdel]
    @ctrlkeybind [entselect insel; editdel]
]

editbind EQUALS [
    @nokeybind [floatspeed (if (> $floatspeed 950) 1000 (+ $floatspeed 50))]
    @ctrlkeybind [floatspeed (if (> $floatspeed 900) 1000 (+ $floatspeed 100))]
    @shiftkeybind [floatspeed (if (> $floatspeed 990) 1000 (+ $floatspeed 10))]
    @bothkeybind [floatspeed 1000]
    echo (format "floating speed = %1" $floatspeed)
]
editbind MINUS [
    @nokeybind [floatspeed (if (< $floatspeed 50) 10 (- $floatspeed 50))]
    @ctrlkeybind [floatspeed (if (< $floatspeed 110) 10 (- $floatspeed 100))]
    @shiftkeybind [floatspeed (if (< $floatspeed 20) 10 (- $floatspeed 10))]
    @bothkeybind [floatspeed 10]
    echo (format "floating speed = %1" $floatspeed)
]

entcomplete = [ listcomplete $arg1 $enttypelist@(getgame) ]
entcomplete newent
entcomplete entfind

listcomplete editmat "air water clip glass noclip lava respawn"
air = [ editmat air ]
water = [ editmat water ]
clip = [ editmat clip ]
glass = [ editmat glass ]
noclip = [ editmat noclip ]
lava = [ editmat lava ]

//For peeps like calimer :P

exit = [quit]


//mostly universal gamemode stuff
bind MOUSE4 [ universaldelta 1 ]
bind MOUSE5 [ universaldelta -1 ]

delta_game_0 = [ if (= $zoom $arg1) [] [zoom $arg1 ]]
delta_game_1 = [if (= $arg1 1) [if (= $fov 150) [] [fov (+ $fov 5)]] [if (= $fov 10) [] [fov (- $fov 5)]]]

bind W forward
bind A left
bind S backward
bind D right
bind T [
    @nokeybind [saycommand]
]
bind BACKQUOTE [
    @nokeybind [saycommand "/"]
]
bind SLASH [
    @nokeybind [saycommand "/"]
]
bind E [
    @nokeybind [edittoggle]//mostly universal :P
    @ctrlkeybind [if $editing showentgui]
    @shiftkeybind [showtexgui] //won't show unless $editing
    @bothkeybind [notepad (mapcfgname)]
]
bind KP_MINUS [
    @nokeybind [conskip 1]
    @shiftkeybind [conskip 5]
    @ctrlkeybind [conskip 20]
    @bothkeybind [conskip 1000]
]
bind KP_PLUS [
    @nokeybind [conskip -1]
    @shiftkeybind [conskip -5]
    @ctrlkeybind [conskip -20]
    @bothkeybind [conskip -1000]
]
bind F1 [
    @nokeybind [paused (= $paused 0); togglemessage $paused "paused"]
]
bind F11 [
    @nokeybind [toggleconsole]
]
bind F12 [
    @nokeybind [screenshot]
    @ctrlkeybind [hidehud 1; sleep 100 [screenshot; hidehud 0]]
]

bind 9 [
    @nokeybind [thirdperson (= $thirdperson 0); togglemessage $thirdperson "third person"]
    @ctrlkeybind [thirdperson 0; echo "first person"]
    @shiftkeybind [thirdperson 1; echo "third person"]
    @bothkeybind [thirdperson 2; echo "free rotation"] //strangely, it isn't a bool :p
]
bind ESCAPE [
    @nokeybind [if (cleargui 1) [] [showgui main]]
    @ctrlkeybind [cleargui]
]

showquickgui = [
    if ($hmapedit) [
        showgui heightfield
    ] [
        if (enthavesel) [
            showgui (et)
            initentgui
        ] [
            showgui quickedit
        ]
    ]
]



//game specific stuff
if (strcmp (getgame) "movie") [
    showquickgui = [
        if ($hmapedit) [
            showgui heightfield
        ] [
            if (enthavesel) [
                if (strcmp (et) "actor") [addcue (entgetinfo)] [
                    showgui (et)
                    initentgui
                ]
            ] [
                showgui quickedit
            ]
        ]
    ]
    editbind 9 newactor
    bind 0 "showgui playerprops"
    bind Q "animate" //for custom animations assigned to the player
    edithudtoggle = [ edittoggle; hidehud (= $editing 0) ]
    bind E [
        @nokeybind [edithudtoggle]
        @ctrlkeybind [if $editing showentgui]
        @shiftkeybind [showtexgui]
        @bothkeybind [notepad (mapcfgname)]
    ]
    bind UP "pitchup"
    bind DOWN "pitchdown"
    bind RIGHT "turnright"
    bind LEFT "turnleft"
]

if (strcmp (getgame) "fps") [
    maxplayermodels = 6
    bind 0 [playermodel (* (+ $playermodel 1) (< $playermodel $maxplayermodels)); echo (format "Using Playermodel %1" $playermodel)]
    freerun = [mode 0; map $arg1]
    coop = [mode 1; map $arg1]
    bananarelay = [mode 2; map $arg1]
    sp = [mode -2; map $arg1]
    demo = [ stopdemo; mode -1; map $arg1 ]
    mapcomplete coop
    mapcomplete freerun
    mapcomplete bananarelay
    mapcomplete sp
    bind I taunt
    bind TAB "showscores"
]

if (strcmp (getgame) "ssp") [
    bind D [if $editing right moveright]
    bind A [if $editing left moveleft]
    bind W [if $editing forward jump]
    bind S [if $editing backward switchaxis]
]
bind UP (getbind W)
bind DOWN (getbind S)
bind RIGHT (getbind D)
bind LEFT (getbind A)

   

[/font][/left]

Daniel

We should build an editor oriented cfg for hell with the most important commands bound to function keys, BTW in BF ins and suppr are bound to sendmap and getmap (which are deprecated).

Sushi

isnt there a vehicle mod in sandbox? try and extract that n put it into sauer, u would become gods xD
Hmm.. I guess I might make something new for this… someday...