'Q' CubeScript Pack

introduction | getting started | checklist | tweak | usage | adding your own | basics

Introduction

QCSP is a Pack of Scripting for Sauerbraten,
the language it is written in is called CubeScript.
 
Current Version: v0.5 (ALPHA) Release Date: 2007-05-26

Motivation

QCSP is script modification based on the current version of the Sauerbraten Engine,
with a specific focus on MouseWheel and Speedups.
The overall goal is to create a thoroughly comprehensive set of functions.
The next day ... world domination! Muahhahahaa.

Release File Naming Convention

On our way we will use releases with an uneven fraction for "alpha" (meaning experimental) and even fractions
for the "beta" or stable, with bug-fixes, releases.
The bugfixes are simply numbered through.
Files will then comply to
QCSP_vA.BCr_YYmmdd.zip
With the silver parts corresponding to the release-main-version and date and the red "r" will be either "a" or "b" - with an added number for BETA releases, if it's a bug-fix.

Getting Started

As a script modification, you are given a load of *.cfg files. NOTE: You must already have, or obtain, the current full distribution of the Sauerbraten Engine.

Mod Installation

extract the ZIP into your sauerbraten folder, nothing (except older versions of this package) will be overwritten.
To run, put the contents of this archive directly into your Sauerbraten directory, keeping paths intact.
It will not overwrite or otherwise modify any original Sauerbraten data. If you've done this right, this html
document should be styled like Sauerbraten's included documentation.

Include the following line in your autoexec.cfg:

exec packages/QCSP/init.cfg
create one in your sauerbraten folder if it doesn't already exist. It should at least contain a line with
name "your_name_here"
anyway, you know!?!

  1. move config.cfg to trash or backup
  2. start your engine
  3. press F1
  4. hold N and scroll MouseWheel
  5. watch the GUI
  6. press the designated number key to execute the alias
  7. try toggling into editmode ... and back
  8. press F1 or ESC to disable the GUI
  9. ...of course this is only a helpful display, the keys work without the GUI :)

also try LALT for speeding up some scrolling-stuff (textures for example).

also try J with MouseWheel for toggling different gamespeeds.

Checklist

 ( ) ... added exec line to autoexec.cfg
 ( ) ... moved config.cfg out of the way
 ( ) ... no errors in console when starting
 ( ) ... pressing N and scrolling MW renders messages
 ( ) ... when pressing number keys functions get run
 ( ) ... this works for editmode as well as in-game

Optional tweaks to official files

toggle QCSP on|off via menu

The following is a quick (and unsupported) guide to installing the menu option to toggle back to QCSP menu,
if you used the QCSP menu option to toggle to the default menu. Put following line into your data/menus.cfg at appropriate position.

[showgui "QCSP Main Menu"]
If in doubt - paste it between these two :
	guibutton "about.."		"showgui about"
	guibutton "quit"		"quit"                 "exit"
so it ends up like this :
	guibutton "about.."		"showgui about"
	guibutton "QCSP"		[showgui "QCSP Main Menu"]
	guibutton "quit"		"quit"                 "exit"

Aktivierte Umlauttasten

/* *************************************
*                                      *
*   QCSP plugin "german keymappings"   *
*                                      *
*                 written by MeatROme  *
*                          2007-01-19  *
************************************** */

= QCSP 'de'-keymap plugin =

== EN : ==
This is a plugin to enable german keys inside sauerbraten.
You can use it as an example to adapt your own personal keyboard layout to the game engine. 
You'll require the ANSI-Keycodes of the hitherto unbindable keys on your keyboard to enable them.
Look at the end of this document to see which keycodes we use to implement the german "Umlaut" keys into sauerbraten;
these (or your adaptation) need to be copied into the data/keymap.cfg file to work correctly.
Sadly when loading these definitions in CFG's loaded later in the engine startup process I have encountered troubles,
so I strongly suggest you modify your default setup files in this one case -
be sure to keep a backup of your original data/keymap.cfg, 
just in case something makes you want to return to the original!

== DE : ==
Um dieses plugin zu installieren empfehle ich - ausnahmsweise - die Anpassung einer Standard-Datei!
Normalerweise ist sowas ja eigentlich nicht besonders clever,
aber weil es sonst einfach zu viele Probleme geben kann ... diesmal soll man es dann doch!
Am Ende dieses Dokuments stehen ein paar Zeilen,
die solltest Du (oder muß ich Sie siezen?) in die data/keymap.cfg kopieren (vorzugsweise ans Ende).
Damit aktivieren wir diese Tasten für weitere keybindings innerhalb unserer eigenen Skripte.
Natürlich empfehle ich - wie immer - eine Sicherheitskopie der modifizierten Dateien zu bewahren,
falls man irgendwann (warum auch immer) zum Originalzustand zurückkehren will.
Die beiden Dateien 
packages/QCSP/kmap/km_de_game.cfg 
und
packages/QCSP/kmap/km_de_edit.cfg
sind dann dafür verantwortlich die entsprechenden bindings vorzunehmen,
dieses plugin belegt die Tasten mit keinen weiteren Funktionalitäten, lediglich einem "echo"-Befehl -
quasi zur Installationskontrolle - also viel Spaß damit diese "Zusatztasten" nach eigenem Bedarf zu belegen :)

-------------------------------------------------------------------------------------------------------------------

== Installation : ==

There are two steps required,
the first one described is to activate the plugin inside QCSP
and the second is to inform sauerbraten of the new keys to be used :

=== 1) QCSP configuration : ===

edit packages/QCSP/kmap/init.cfg and add the following two lines:
  QCsubi kmap km_de_game
  QCsubi kmap km_de_edit

-- -- --

=== 2) Keymap Definition : ===

edit data/keymap.cfg and add the following 5 lines:
  // QCSP : added for 'de' support
  keymap 223 SZ 
  keymap 252 UE 
  keymap 246 OE 
  keymap 228 AE

Usage

Minimal:

I'll list the new keybinds to look out for, check the scripts themselves for further details and/or consult the documentation available from README.html in your sauerbraten installation folder!

always : LALT : turbo-switch - increases speed of MW-scrolls that have been made aware of it. Currently entproperty and texture selection are :)

in-game: N : "iota" plugins - MW game func selection

in-edit: 1-4 : (in "epsl"-0) are bound to respective entproperty J : gamespeed via MW M : history N : "epsl" plugins - MW edit func selection

basics

After installation and verifying there were no errors on your in-game console when you started sauerbraten, you can hold down the N key and scroll your mouse. Do this (up & down) till you have "chat" function-set selected ... press 1, then 2. now scroll back down till #1 - weapons. now the keys work as with vanilla flavoured sauerbraten.

switch to editmode, move close to a light entity; N + MW to "light", then press 9. scroll back down to #1 - entproperty. press 2 + MW and watch the "nearest entity" display on your lower left corner of the screen. when the RED-channel (the value your modifying right now) is on a particular digit you like then press LALT, keep 2 pressed or repress now scroll your mouse and modify 10 in one stroke. This works in the texture selection list too.

iota : 'in on the action' : your game functions epsl : 'editing procedures support laziness' : edit-funcs

Remarks:

iota & espl:

The "iota" and "epsl" func-list selection works in the following fashion:

You keep N pressed and scroll MW (your mousewheel), it will say "I/N : IDENTIFIER" in the console output, with : I : your current index in the respective func-list N : the length of the list IDENTIFIER : the cfg name The function IDENTIFIER is sinonymous with a cfg file, this is located in the QCSP subdirectory for each func-list. Their order (and indeed which get preloaded in the first place) can be set inside packages/QCSP/init.cfg.

To create your own function-set just copy from one of the existing files and adapt to your needs, of course you need to know some CubeScripting to get it doing what you want ...

As soon as you've selected a function-set the number keys [1-9] +0 will be bound to that set. Not all keys have to be bound! 0 should always reset the function-set to the basic set of the current listing - "iota" for in-game, "epsl" for in-edit!

mastermode:

The wrapper assumes you will never use "/mastermode X" yourself - you should use "/mm X" instead! If you get kicked you should also press 6 in iota-2, meaning the master-function-set during an in-game keyboard layout. This will reset to "I'm not master".

When "claiming master" (press 5) you will first be asked to confirm (press ENTER) [or discard by ESC]; then you'll need to enter your clientnum ... this is the tricky bit. You need to get the scoreboard visible for that. Else you can just hope your the first on the server and hence have the default of 0, if you know it press that number and then RETURN.

To correct it later on press 8.

This will hopefully get more comfortable in later releases ... I'm sure of it ... at least I hope so.

adding your own:

So - you like my stuff but you really already had those keys in use with your own bindings?
Or - you'd just love to have some of your own functions running on a function set
 
Never fear - it's as easy as pie.
The "tactics" section is clean so far.
So take a copy of packages/QCSP/ (from now on called ./)
./iota/tactics.cfg
copy it to
./iota/myset.cfg
or choose something for "myset" that's appropriate :)
 
Edit this file.
There are 9 different tuples of lines you'll need to define.
You can have some additional scripting in there too;
this will only be active, though, if you actually _do_ load this function set.
More about loading function sets later.

function sets : keys 1-9

The basic tuple for one of the keys 1 to 9 is :
_Nc = "" _Nd = [result ""] Where N is 1 to 9 ...
You should also define a _QFname_doc alias.
This is for display in the GUI and is generally used for a quick
overview of the keybinds used.
In _QCinfo mode 2 you'll see this when toggling with MW + N ...
 
Into each _Nc alias include your keybinding.
Into each _Nd alias the doc-string the GUI should show.
You can make this be auto-updating, like the QCSP already does for LALT, or team-settings when in voting iota-mode and/or F6-menu.
If you have a variable, say "$foo" - which holds some vital info of yours - and you want to display it on key-#3's doc-string then you change the basic result = "" into a line giving such a result - but constructing it "on-the-fly"
concat the foo value is $foo From there on I can't tell you how-to do what you need,
even the developers don't know all they've made possible with their engine.
 
It's up to us users to make the programs run :)

loading function sets

There are two lines in ./QCSP/init.cfg that are important for this

16:	_QCnamz = "weapons voting master moderator chat tactics"
and
24:	_QCname = "octa entprop ammo items lights monster"
Into these you should enter (at your preferred position) your own filenames.
For _QCnamz into ./iota and for _QCname into ./epsl respectively.
If you change your indexes this way you should be prepared to change the scripting wherever certain
settings get made to _QCzeta or _QCepsl respectively (maybe even through wrapper functions!).
To be on the safe side you should add them at the end of the list -
this avoids these index confusions.
 
Always take care that CubeScript lists are strings built like
"Value1 Value2 Value3 .."
Read : space-seperated values.

Have Fun

Enjoy this ScriptPack with just your basic personal tweaks,
base your own scripting pack off this,
or just use some of the stuff I've shown you how to do ...
 
It'd be nice though if you'd give me as much credit as you deem appropriate.