http://cubeengine.com/w/index.php?title=Special:NewPages&feed=atom&hidebots=1&hideredirs=1&limit=100&offset=20141212155926&namespace=0&username=&tagfilter=&size-mode=max&size=0Cube Wiki - New pages [en]2024-03-29T15:55:29ZFrom Cube WikiMediaWiki 1.31.7http://cubeengine.com/wiki/Importing_md2_and_md3_filesImporting md2 and md3 files2014-12-12T15:59:25Z<p>Admin: </p>
<hr />
<div>There are tons of existing Quake MD2 and MD3 files, so if you're interested in learning how to get these to import and look good in Sauerbraten read on!<br />
<br />
=The Basics= <br />
MD2 files are collection of animated vertices. All the animations must start/stop at specific frames, these are hard coded into the model and the game engines. There is one texture map used for the whole mesh, head to toe. It is one solid piece, so it rotates/bends as a whole unit.<br />
<br />
MD3 files are three separate collections of animated vertices, the lower, the torso and the head. There should be an animation.cfg file that comes with the model that contains the start/length of each animation, but the animations must come in a fixed order in the models. There can be multiple texture maps, even within one section of the model. The model will rotate as a whole unit, but each piece can be made to bend separately.<br />
<br />
=Importing MD2 files= <br />
The most important thing is creating the MD2.cfg file to match the model you want to import. For MD2 files this process is really straight forward. Just use any text editor and create the file with the contents below.<br />
<br />
===Example MD2.cfg===<br />
<pre><br />
mdlspec -1 // turn off speculars<br />
mdlscale 100 // keep original scale<br />
mdltrans 0 0 24 // raise feet up to surface plane<br />
md2pitch 1 0 -30 30<br />
</pre><br />
<br />
Please refer to the documentation page [http://sauerbraten.org/docs/models.html Sauer Models Doc] for more details on each of these commands, but here are some of my notes on each.<br />
* <tt>mdlspec -1</tt> -- This will turn off speculars, or make it so the model isn't shiny. Of course you'll want to adjust this to suit each particular model.<br />
* <tt>mdlscale 100</tt> -- typically the default scale of MD2s look good in Sauer, but you can tweak how tall your model is here.<br />
* <tt>mdltrans 0 0 24</tt> -- most quake models have 0,0,0 at the waist of the model. Sauer wants this to be at the feet, so we add 24 to the Z axis to raise the model up. You may need to adjust this up or down a little if your toon appears to float or have its feet stuck in the ground.<br />
* <tt>md2pitch 1 0 -30 30</tt> -- the docs don't mention it, but you can clamp the pitch on an MD2. This makes it so the toon will only rotate so far when the player adjusts the pitch (up and down) of the toon. If you don't clamp this and the player looks down at the ground, the entire toon will rotate until it's parallel to the ground and looks rather silly. NOTE: If you have a toon that's a robot, like a Dalek or something, that you don't want to have rotate up and down at all, use md2pitch 1 0 0 1. If you try to use 0 0 for the last two arguments it will disable clamping, not clamp to 0 as you might have guessed.<br />
<br />
===Adding a skin=== <br />
The only other thing you need to do to import an MD2 is to provide a skin for your toon. Sauer is going to look for either skin.jpg or skin.png, so rename one of the existing skins that came with the model. If it is another file format such as .PCX, .TIF, .TGA, etc. be sure to use a tool to convert it. Some of these may not be exact widths/height of a power of two. So far, I haven't noticed this to be a problem for Sauer, but if it is for you, just use your image tool to resize the image so that the contents are stretched.<br />
<br />
=Importing MD3 files= <br />
You should try your hand at a couple MD2 files before trying an MD3 as they are a little more complicated to import. Hopefully the model comes with an animation.cfg file, this file contains where to find all the animation offsets you will need. There will also be various *.skin files. If it has ones named lower_default.skin, upper_default.skin, and head_default.skin, I'd use the textures found in those. To start off with you want to create an MD3.cfg file.<br />
<br />
===Example MD3.cfg=== <br />
<br />
<pre><br />
md3load lower.md3 // always start with the mesh for the legs, named lower.md3<br />
md3skin l_lower joker256.png // refer to lower_default.skin for any textures, there may be multiple ones you need to add<br />
<br />
md3pitch 1 0 0 1 // you want the toon to bend at the waist, so totally disable the pitch for the legs<br />
md3anim dying 0 30 25 // extract from line 0, BOTH_DEATH1 in animation.cfg<br />
md3anim dead 0 30 25 // extract from line 1, BOTH_DEAD1<br />
md3anim "lag|edit" 90 1 20 // extract from line 13, LEGS_WALKCR NOTE: set frames to 1 so the toon doesn't animate<br />
md3anim "forward|left|right" 98 12 20 // extract from line 14, LEGS_WALK<br />
md3anim backward 119 10 20 // extract from line 16, LEGS_BACK<br />
md3anim swim 129 10 15 // extract from line 17, LEGS_SWIM<br />
md3anim jump 139 8 15 // extract from line 18, LEGS_JUMP<br />
md3anim idle 173 6 7 // extract from line 22, LEGS_IDLE<br />
<br />
md3load upper.md3 // the upper or torso comes next<br />
md3skin u_upper joker256.png // refer to upper_default.skin and include any textures listed in this file<br />
<br />
md3pitch 1 0 -30 30 // let the toon bend up to 30 degrees either way at the waist<br />
<br />
md3anim dying 0 30 25 // extract from line 0, BOTH_DEATH1 in animation.cfg<br />
md3anim dead 29 1 25 // extract from line 1, BOTH_DEAD1<br />
md3anim "idle|lag|edit" 151 1 15 // extract from line 11, TORSO_STAND<br />
md3anim shoot 130 6 15 // extract from line 7, TORSO_ATTACK<br />
md3anim punch 136 6 15 // extract from line 8, TORSO_ATTACK2<br />
md3anim taunt 90 40 17 // extract from line 6, TORSO_GESTURE<br />
<br />
md3load head.md3 // last comes the head<br />
md3skin h_head head256.png // refer to head_default.skin for any textures listed<br />
<br />
// heads cannot be animated, so there are no animations<br />
<br />
md3link 0 1 tag_torso // these lines will link the three chunks together<br />
md3link 1 2 tag_head // thankfully these are identical for 99% of the models<br />
<br />
mdlspec -1 // turn off speculars<br />
mdlscale 100 // keep original scale<br />
mdltrans 0 0 24 // raise feet up to surface plane<br />
</pre><br />
<br />
<br />
===Extracting Animations=== <br />
By far the trickiest part of this process is learning to extract the animations from the animation.cfg to convert them into your MD3.cfg. In my comments above, I included a line offset and the comment to look for. Please note, the line indices are 0 based not 1. Hopefully your animation.cfg has the comments on each line animation that says what it is. Typically every animation has a line in this file with the starting frame, the number of frames, looping frames (unused by Sauer, so we will ignore) and the speed of the animation, followed by a comment describing the animation.<br />
<br />
===Sample Animation.cfg:=== <br />
<pre><br />
// first frame, num frames, looping frames (ignored by Sauer), frames per second<br />
<br />
0 30 0 25 // BOTH_DEATH1<br />
29 1 0 25 // BOTH_DEAD1<br />
30 27 0 30 // BOTH_DEATH2<br />
57 1 0 25 // BOTH_DEAD2<br />
60 30 0 25 // BOTH_DEATH3<br />
89 1 0 25 // BOTH_DEAD3<br />
90 40 0 17 // TORSO_GESTURE<br />
130 6 0 15 // TORSO_ATTACK (MUST NOT CHANGE -- hand animation is synced to this)<br />
136 6 0 15 // TORSO_ATTACK2 (MUST NOT CHANGE -- hand animation is synced to this)<br />
142 5 0 20 // TORSO_DROP (MUST NOT CHANGE -- hand animation is synced to this)<br />
147 4 0 20 // TORSO_RAISE (MUST NOT CHANGE -- hand animation is synced to this)<br />
151 1 0 15 // TORSO_STAND<br />
152 1 0 15 // TORSO_STAND2<br />
153 8 8 20 // LEGS_WALKCR<br />
161 12 12 20 // LEGS_WALK<br />
173 8 8 15 // LEGS_RUN<br />
182 10 10 20 // LEGS_BACK<br />
192 10 10 15 // LEGS_SWIM<br />
202 8 0 15 // LEGS_JUMP<br />
210 1 0 15 // LEGS_LAND<br />
218 10 0 15 // LEGS_JUMPB<br />
229 1 0 15 // LEGS_LANDB<br />
236 6 6 7 // LEGS_IDLE<br />
250 1 1 15 // LEGS_IDLECR<br />
240 7 7 15 // LEGS_TURN<br />
</pre><br />
<br />
<br />
So for each md3anim you need to look up the corresponding animation I documented in the MD3.cfg above and extract the first, second, and fourth columns to get the three numbers to pass into your md3anim. The first number, the start frame, may take some work, I'll explain next. The second and fourth numbers become your second and third numbers to use. We are ignoring the third column of numbers in the animation.cfg.<br />
<br />
The first column is the starting frame of the animation. The torso animations you can alway use the number given as the start frame as your start frame. Heads don't have animations, so no worries there. However, not all models save the leg animations stored the same way, so you may have to adjust the starting frames shown in the animation.cfg for all the leg animations.<br />
<br />
To see if you need to offset the start frames, subtract the start frame for the LEGS_WALKCR animation from the start frame of the TORSO_GESTURE animation. In this example these are 153 and 90, so subtracting we have an offset of 63. So for every LEG animation you must take the start frame of the animation and subtract 63 before you put it in the md3anim. For example, LEGS_SWIM starts on frame 192, so we subtract 63 and get 129 for the start frame. In our MD3.cfg we will have md3anim swim 129 10 15. Now if ''LEGS_WALKCR and'' TORSO_GESTURE both started at the same number, then they already lined up and we would subtract zero, in other words, just use the same number.<br />
<br />
===Example:=== <br />
<pre><br />
192 10 10 15 // LEGS_SWIM<br />
\_ignored<br />
<br />
md3anim swim 129 10 15<br />
^ ^ ^<br />
192 - 63 = _/ | \_taken from fourth column<br />
\_taken from second column<br />
</pre><br />
<br />
===MD3 Textures=== <br />
No big surprise here, for every texture you referenced in your MD3.cfg file you need to make sure you include and it has been converted to a .JPG or .PNG file. Getting which textures to use is just a matter of looking at the xxxxx_default.skin files.<br />
<br />
Example lower_default.skin file:<br />
<br />
<pre><br />
l_lower,models/players/Joker/Joker256.tga<br />
tag_torso,<br />
tag_floor,<br />
</pre><br />
<br />
So in this example, we want to add md3skin l_lower joker256.png to our MD3.cfg and convert the Joker256.tga to a .png file.<br />
<br />
=Importing into Sauer= <br />
After you get your model ready for importing, you want to make a folder for each model under packages/models/ This is the only place Sauer will look for them. Unfortunately you cannot use new models for yourself without making a change to the code and recompiling Sauer. If you're feeling up to this, open fpsrender.h and look for the following code:<br />
<br />
===fpsrender.h code excerpt:=== <br />
<pre><br />
static const playermodelinfo playermodels[4] = // increase the length of the array if you add models!!!<br />
{<br />
// here i've added a hansolo model, he doesn't have red team/blue team special versions<br />
{ "hansolo", "hansolo", "hansolo", NULL, NULL, { NULL, NULL, NULL }, "hansolo", "hansolo", "hansolo" },<br />
{ "mrfixit", "mrfixit/blue", "mrfixit/red", NULL, "mrfixit/horns", { "mrfixit/armor/blue", "mrfixit/armor/green",<br />
"mrfixit/armor/yellow" }, "mrfixit", "mrfixit_blue", "mrfixit_red" },<br />
{ "ironsnout", "ironsnout/blue", "ironsnout/red", NULL, "quadspheres", { "shield/blue", "shield/green",<br />
"shield/yellow" }, "ironsnout", "ironsnout_blue", "ironsnout_red" },<br />
{ "monster/ogro", "monster/ogro/blue", "monster/ogro/red", "monster/ogro/vwep", NULL, { NULL, NULL, NULL },<br />
"ogro", "ogro", "ogro" }<br />
};<br />
<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Hudguns_with_Hands_IIIHudguns with Hands III2014-12-12T15:59:25Z<p>Admin: </p>
<hr />
<div>[[File:Screenshoti.png|888x675px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The reason for this is Blender's axis orientation is different from that of Sauerbraten and most graphic applications, for that matter.<br />
<br />
Now align the empty for the duplicate weapon in the same fashion with this orientation; X axis on X, Y axis on Y, Z axis on Z. I am unsure as to the reasoning behind this. But it works. :P<br />
[[File:Screenshotj.png|880x669px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Now you are ready to export. Rename the hands' empty to tag_weapon. Select the armature to ensure the proper action is represented in the action editor. Open the export script obtained [[Blender Animated Md3 Export|here]] in another window;<br />
<br />
[[File:Screenshotk.png|879x669px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Ensure you are on the final frame of the animation. Right click on the text window and Execute Script! Name the file something appropriate like Gl_hands.md3. Now rename the empty to its original, tag_hands. Select the empty for the duplicate weapon and name it tag_weapon. Ensure the proper action appears in the action editor. Select the empty and the weapon. Right click on the text window and Execute Script. Name the file appropriately with the .md3 extension. Now for a quick trial of your newly created hands and weapon write a quick md3.cfg like so;<br />
<br />
md3load Glhands.md3<br />
md3skin Hands ./handtexture.jpg<br />
md3anim "gun idle" 0 1<br />
md3anim "gun shoot" 1 18<br />
<br />
md3load gl.md3<br />
md3skin gl ./gltexture.jpg<br />
md3anim "gun idle" 0 1<br />
md3anim "gun shoot" 1 18<br />
<br />
md3link 0 1 tag_weapon<br />
<br />
and save it. place all of the necessary files into :Sauerbraten/packages/models/hudguns/gl/ after moving its current contents. Fire up Sauerbraten to test the location of the hands and weapon and the linkage/orientation. If all went well proceed to the next step. Otherwise readjust your animations and/or models as necessary until you are satisfied. If all goes well it should look something like this;<br />
[[File:Screenshotm.png|881x660px|left]]<br />
<br />
<br />
<br />
<br />
<br />
Repeat the same process for as many weapons as you wish to have. If you want to use one single set of hands for all the weapons use a separate action for the hands for each weapon. Align all of the hand animations in the nla editor and inform Sauerbraten where to find the hands.md3 file which will logically be placed in Sauerbraten/packages/models/hudguns/.<br />
<br />
I hope you find success with this tutorial.<br />
<br />
-geartrooper<br />
<br />
=[[Hudguns with Hands II|Previous Page]]=</div>Adminhttp://cubeengine.com/wiki/Hudguns_with_Hands_IIHudguns with Hands II2014-12-12T15:59:25Z<p>Admin: </p>
<hr />
<div>[[File:Screenshote.png|875x664px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Proceed with animating the hands and weapon being sure to keep the animations separate for the hands and weapon in the action editor. You may find it easier to animate the action of the weapon such as reloading and firing before aligning it to the hand postion.<br />
<br />
Now that you have animated the hands moving and the weapon firing in unison its time for another step. Switch to rear view [shift-keypad 1]. We must duplicate the weapon, its armature, and its empty and align the empty to 0,0,0 will retaining its position relative to the duplicate weapon and its armature like so;<br />
[[File:Screenshotf.png|883x670px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The duplicate weapon appears oriented incorrectly in relation to the original. This is because after you align the empty to 0,0,0 you must snap the cursor to center [shift-c], set the pivot point to cursor[.], select only the duplicate armature and weapon(not the empty) and rotate them on the X axis with [r, x, 90, -]. Otherwise the weapon will show up dissoriented in Sauerbraten. The hands and weapons should now appear as so in rear view;<br />
<br />
[[File:Screenshotg.png|887x674px|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Now we must assign a new animation based off the first weapon to the duplicate weapon. The reasoning for this is to keep the basic actions but remove any movement of the duplicate weapon as a whole from its empty. Open two action editors and in one select the original weapon's armature and corresponding action. For the sake of simplicity lets say we named it 'AC:gl". Add a copy of this action by going into the action editor's select arrows and choosing "ADD NEW". Voila. You now have 'ACgl.001'. Change the action back to 'AC:gl' for this armature. Select the duplicate weapon's armature and set the action to 'AC:gl.001'. Select all the keys for the root bone and delete them preserving all other action keys like so;<br />
<br />
[[File:Screenshoth.png|884x672px|left]]<br />
<br />
<br />
You should now have a weapon that performs exactly as the original but without straying from its empty.<br />
<br />
The next step is to ensure our empties are on the proper axis before exporting. Select the empty parented to the hands. Snap the cursor to it and ensure you are in the crosshairs pivot mode[.]. Ensure that the empty's X axis is aligned to Blender's X axis, the empty's Y axis is aligned to Blender's Z axis, and the empty's Z axis is aligned to Blender's Y axis as on the next page;<br />
<br />
=[[Hudguns with Hands|Previous Page]] [[Hudguns with Hands III|Next Page]]=</div>Adminhttp://cubeengine.com/wiki/Hudguns_with_HandsHudguns with Hands2014-12-12T15:59:24Z<p>Admin: </p>
<hr />
<div>Hello again and welcome to the Sauerbraten Wiki tutorial about exporting hudguns with hands through Blender. I will attempt to instruct you as to the process of importing hands and weapons into Sauerbraten from Blender. This tutorial assumes you have read and understand the [[MD3 Export From Blender Tutorial|Static MD3 Export]] tutorial and the [[Blender Animated Md3 Export]] tutorials. Lets also assume you have a set of mapped, textured and rigged hands and at least two mapped, textured and rigged weapons all in the same blender file.<br />
<br />
''Show below are the hands and the first weapon.''<br />
<br />
[[File:Screenshota.png|888x675px|left]][[File:Screenshotb.png|886x672px|left]]<br />
<br />
<br />
<br />
Go to front view [keypad 1]. Align the hands and weapon as so. Be sure to keep the hands and weapons armatures separate. The reason will become apparent later. In the following picture you can get a general idea as to the position and scaling of the hands and weapons so they will appear correctly in Sauerbraten.<br />
<br />
[[File:Screenshotd.png|887x675px|left]]<br />
<br />
<br />
<br />
<br />
<br />
The hands and weapon together are approximately 30 blender units long and 20 blender units high. Not shown is the top view which places the center of the weapon approximately 10 blender units to the right of the Y axis. Now we will affix empties or tags, as they are known in Sauerbraten, to both the weapon and the hands. Still in front view lets concentrate on the hands armature and pick a bone that most resembles a root bone. To this we will snap the cursor with [shift-s, cursor to selection].<br />
<br />
[[File:Screenshotc.png|883x669px|left]]<br />
<br />
<br />
<br />
Parent the empty to said bone with [ctrl-p, parent to bone]. Name the empty something appropriate like 'tag_hands' for the time being. After having completed this step duplicate the empty. Remove the parent child relationship but keep the postion with [alt-p, clear and keep transformation]. Now select the root bone of the weapon and parent the empty to the bone with [ctrl-p, parent to bone]. Name the empty, 'tag_grenadelauncher' or something fitting. Don't worry too much about the axis of the empties yet as we will align them later. The finished step should look something like the picture on the next page;<br />
<br />
=[[Hudguns with Hands II|Next Page]]=</div>Adminhttp://cubeengine.com/wiki/How_to_approach_moddingHow to approach modding2014-12-12T15:59:24Z<p>Admin: </p>
<hr />
<div>=Modding Sauerbraten= <br />
This is in contrast to [[How not to start a mod|How NOT to start a mod]]. If you would like to try yourself at writing additional code to the current (or -- don't, please! -- ''old release'' based) source you've come to the right page. The following examples are based off the 2007-09-18 Summer release and have become relatively obsolete. They're here more as "in the broad strokes" examples.<br />
<br />
First we'll add <tt>getyaw</tt>, which is good as a command for editors; helping to orientate when they've forgotton which way the sun is in this skybox or are underground. It's like a compass.<br />
<br />
With the second modification we'll add ourselves a new command that gives us a shortcut from hunting down specific textures from unspecified sets to add them with shaders to our own map config... it outputs path-to-texture.<br />
<br />
Finally, the most contraversial modification, it has certain undeniable benefits... but in it's current state also it's drawbacks. If you really think about the issues at hand I hope this example helps you avoid underestimating implications of your ideas before you invest time into something that turns out to require a better idea...<br />
<br />
=Following the examples= <br />
First create a backup of any file before you edit it.<br />
<br />
=Examples= <br />
<br />
==<tt>getyaw</tt>== <br />
File: We're going to modify ''src/fpsgame/client.h''.<br />
Goal: Easy access to orientation.<br />
<br />
<pre><br />
CCOMMAND(getyaw, "", (clientcom *self), intret((int)self->player1->yaw)); // MeatROme<br />
</pre><br />
<br />
I suggest you place this line after the one defining getteam, before the closing curly-bracket below that. A modification can be ''very'' simple. Use it in your CubeScript:<br />
<br />
<pre><br />
echo [I'm pointing due (concatword (getyaw) ".")]<br />
</pre><br />
<br />
==<tt>gettexname</tt>== <br />
File: We're going to modify ''src/engine/octaedit.cpp''<br />
Goal: Easy access to texture paths/namesUsage: CubeScript: <tt>echo (gettexname)</tt><br />
<br />
<pre><br />
void gettexname()<br />
{<br />
if(noedit()) return;<br />
filltexlist();<br />
int cti = -1;<br />
loopxyz(sel, sel.grid, cti = c.texture[sel.orient]);<br />
loopi(curtexnum) if(texmru[i]==cti)<br />
{<br />
Slot &slot = lookuptexture(texmru[i], false);<br />
if(slot.loaded) conoutf("%d : %s", i, slot.sts[0].name);<br />
return;<br />
}<br />
}<br />
COMMAND(gettexname, ""); // MeatROme<br />
</pre><br />
<br />
This code should end up somewhere close to the definitions for <tt>edittex</tt> and <tt>gettex</tt>. Use it in the console, bind yourself a key to it; use a result-a-string approach like getyaw if you want to process it further with CubeScript, but for general info a conoutf seemed most appropriate.<br />
<br />
==<tt>showboguschar</tt>== <br />
File: We're going to modify ''src/engine/rendertext.cpp''.<br />
Goal: Vasic INTL8 awareness, so that the engine doesn't ignore special chars (such as €, ä, Ü, ß...)<br />
Usage: Automatic<br />
<br />
.. right in front of the ''implementation of '''draw_text''''' you should add:<br />
<br />
<pre><br />
static int bcc = 0; // boguscharcount<br />
</pre><br />
<br />
and then replace the two lines<br />
<br />
<pre><br />
c -= 33;<br />
if(!curfont->chars.inrange(c)) continue;<br />
</pre><br />
<br />
with this<br />
<br />
<pre><br />
// MeatROme:<br />
bcc += (c<0 || c>127) ? 1 : 0; //if(bcc) printf(" [%2d:%+4d: %c ] ", bcc, c, c);<br />
<br />
c -= 33; // original<br />
<br />
if ( ! curfont->chars.inrange(c) ) // continue; original<br />
{<br />
if ( ! bcc ) continue;<br />
bcc--;<br />
c = curfont->chars.length() - 1; // assume last char is /bogus char/<br />
glColor4ub(200, 96, 96, a);<br />
}<br />
</pre><br />
<br />
For this to work as intended you should add a specific "bogus" char to your data/font.cfg.<br />
If you don't do anything it will pick the tilde "~" which might be to inconspicious, use the "#" with<br />
<pre><br />
fontchar 52 0 35 // #:bogus char<br />
</pre><br />
this suggested default bogus char - or paint your own into some of the remaining space and give those coords.<br />
<br />
If you have keys not keymapped for sauerbraten it won't show their occurence in the console.<br />
E.g. german Umlaut characters "Ö", "Ü", "ä" ("&auml;") for example aren't shown in-game,<br />
but your text output will show them.<br />
<br />
This modification makes them apparent in-game too;<br />
so you won't wonder whereever you typed that hitherto invisible character inside your console width spanning on-the-fly script.<br />
<br />
Did you ever get an "unknown command 'map'" error?<br />
It was probably due to a special (= invisible) character in the input.<br />
<br />
But it's usage/display is somewhat lacking the way this is done ... better to rethink the approach ...<br />
<br />
=Epilog= <br />
Notice how I marked all my changes - this is a licensing requirement!<br />
Hope I got you onto the tracks with this, have fun!</div>Adminhttp://cubeengine.com/wiki/How_not_to_start_a_modHow not to start a mod2014-12-12T15:59:24Z<p>Admin: </p>
<hr />
<div>How not to start a mod: a very good writeup by Aardappel and eihrul [http://www.cubeengine.com/forum.php?action=display_thread&thread_id=1562 on the forums], wikified here.<br />
Compare it to [[How to approach modding]].<br />
<br />
Since this seems to come up a lot, here is how to fail spectacularly with any particular modding idea:<br />
<br />
Premises:<br />
* Propose starry-eyed idea<br />
* Ask for significant help to start the project<br />
<br />
Conclusion:<br />
* Always fail<br />
<br />
='''<span style="font-weight: normal;">Summary</span>'''= <br />
* <span style="font-weight: normal;">Ideas are cheap. Everyone has cool ideas.</span><br />
* <span style="font-weight: normal;">If you make a mod, you must be willing to do the majority of the work by yourself.</span><br />
* <span style="font-weight: normal;">Any skill your mod requires you need to have yourself.</span><br />
* <span style="font-weight: normal;">Anything you plan to do, plan to do entirely by yourself.</span><br />
* <span style="font-weight: normal;">Present your project only after some significant work has already been done.</span><br />
* <span style="font-weight: normal;">It's usually better to team up with more skilled people and follow their lead. Working on a finished project is worth more than a failed personal project.</span><br />
* <span style="font-weight: normal;">Do not release screenshots, etc. until they are at least up to par with Sauerbraten's default maps.</span><br />
* <span style="font-weight: normal;">If your screenshot is the ugliest, throw the map away and start again. No one wants a map that goes backward in quality.</span><br />
<br />
The reality is of any volunteer project is: if the people you want to help are significantly more skilled than you, or just significantly skilled, they will be more likely to work on their own projects than bother at all helping you.<br />
<br />
Why is this? '''Ideas are cheap. Everyone has cool ideas.''' But very few people have the skill to follow through with them. When they do, they're usually not very altruistic about using them for the good of someone else.<br />
<br />
Leadership skills matter not for starting something. People won't take marching orders from someone they perceive as less skilled. Leadership only matters in the endgame, when you have a lot of stuff to manage.<br />
<br />
So what does this mean for someone wishing to start a mod or just volunteer project in general (one might say any non-commercial project, particularly open source ones)? It means: '''You must be willing to do most -- often all -- of the work yourself''''''.'''<br />
<br />
And when the critical mass of your project makes coming across it by accident via word-of-mouth unavoidable, then you'll start to get... a few, but very limited number of somewhat skilled people proposing to help. Very rarely, you might even get one or two skilled people.<br />
<br />
The breakdown:<br />
<br />
Of your users, a very small amount will express interest in helping. Let's say ten percent, being generous.<br />
Of those, a smaller amount will actually ''try'' to help you. Again: ten percent. ''Extremely'' generous.<br />
Of those, a much smaller amount will be ''capable'' of doing what they're trying. Ten percent.<br />
Of those, a much smaller amount will be capable of doing what they're trying to do ''well''. Ten percent.<br />
<br />
So, being overly generous, maybe one ''hundredth'' of your users will help you. So unless you have several hundred users, there is very little chance you will get much help. BUt the bigger and more prestigious your project is the more the ratios will grow.<br />
<br />
Consider the whole Cube and Sauerbraten project: it is about six years old by now. It's been quite successful by anyone's standards as a game/engine project (millions of downloads, etc.), yet even with this project there are less than twenty truly dedicated people -- programmers, artists, etc. (Level design has always been easier because this project was designed as the ultimate level design tool).<br />
<br />
So if such a huge project gets so few contributors, even that many years in, why should your project get any right at the start?<br />
<br />
Consider the mods that have been attempted for Sauer: there has been only one really successful one so far, [[@http://www.redeclipse.net/|Red Eclipse]] , and that worked out because a couple very skilled people got together, managed to keep the same vision, and, more importantly, managed to keep determined enough to continue it.<br />
<br />
When you think you have something 80% finished, it's probably closer to 20%. Finishing something and polishing it takes a ''lot'' of determination, and usually isn't fun. It is ''work''. Why do you think game programmers get paid like they do?<br />
<br />
**Any skill your mod requires you need to have yourself.<br />
<span style="font-weight: normal;">This includes C++ for gameplay changes, modeling and exporting for art, etc. Similarly, this means that the less skills your project requires (e.g. a map or map pack), the more likely you will be able to finish.</span>'''<br />
<br />
**Any project you do, plan to do it entirely by yourself.'''<br />
Any people that will want to help you at some stage will be a bonus, but don't rely on it.<br />
<br />
**Present your project only after some significant work has already been done.'''<br />
People may see your skill and determination, which makes them ten times more likely to participate.<br />
<br />
**If you want to work on a mod, unless you are super-skilled, it's better to team up with more skilled people and follow their lead than start your own.'''<br />
Yes, it's attractive to do your own ideas, but there are infinitely more ideas than means to execute them, so something has to give. Having made a contribution to a finished, polished project of someone else is worth so much more than a failed personal project.<br />
<br />
This one goes not just for mods, but for anything:<br />
<br />
**Do not release screenshots, etc. until they are at least up to par with other good maps.'''<br />
Do this test: compare a screenshot of your map with the ones for the maps on the [http://sauerbraten.org/ main Sauerbraten page] .<br />
**If your screenshot is the ugliest, throw the map away and start again. No one wants a map that goes backward in quality.'''<span style="font-size: 18px; line-height: 27px;"> </span></div>Adminhttp://cubeengine.com/wiki/Main_PageMain Page2014-12-12T15:59:23Z<p>Admin: </p>
<hr />
<div>Welcome to the [http://sauerbraten.org/ Cube 2: Sauerbraten] project wiki. You can visit our project page on SourceForge [http://sourceforge.net/projects/sauerbraten/ here] .<br />
<br />
<br />
=Help=<br />
[http://sauerbraten.org/README.html The Readme]: The first place you should look for information on setting up the game.<br><br />
[[Install Guide]]: This describes the installation process.<br><br />
[[Beginners Guide|Beginners' Guide]]: How to get up and running.<br><br />
[[FAQ]]: View and get the answers to some commonly asked questions.<br><br />
[[Performance Guide]]: Things you can try to make Sauerbraten either run faster or look better.<br><br />
<br />
=Gameplay= <br />
[[Singleplayer Guide]]: How to play games offline.<br><br />
[[Multiplayer Guide]]: How to play games online or host your own server.<br><br />
<br />
=Editing= <br />
[[Mapping and Editing]]: Itching to create? Follow these steps.<br><br />
[[Distributing Maps]]: After you finish slaving over your map, you need to distribute it.<br><br />
[[Cooperative Editing]]: Creating with others can be fun and rewarding, but there are important principles.<br><br />
[[Scripting Guide]]: A look at the possibilites of scripting, with examples.<br><br />
[[MD3 Export From Blender Tutorial|Static MD3 Export From Blender]]: A tutorial for exporting static MD3s from Blender.<br><br />
[[Blender Animated Md3 Export|Animated MD3 Export with Tags from Blender]]: A slightly more difficult tutorial for exporting multiple animated and tagged MD3s from Blender.<br><br />
[[Hudguns with Hands|Hudguns with Hands via Blender]]: A more complex yet powerful tutorial on adding personal hudguns and hands.<br><br />
[[Blender to MD5 to Sauerbraten|MD5 from Blender to Sauerbraten]]: It just got easier.<br><br />
[[Mr Fixit|Mr. Fixit Blend File]]: For educational purposes.<br><br />
[[Importing md2 and md3 files|Importing MD2 and MD3 files]]: How to import existing models into Sauerbraten.<br><br />
[[Creating Ragdolls]]: Information on the ragdoll editor used to create ragdolls for skeletal models.<br><br />
<br />
=Projects= <br />
[[Eisenstern Modelling]]: Information on 3D modeling in the Sauerbraten RPG branch.<br> Unfortunately, the Eistenstern project has been discontinued. There is a group working on the project [https://sourceforge.net/projects/eisenstern/ on SourceForge] . The official design notes can be found [http://eisenstern.com/eisenstern_design_notes.html on the Sauerbraten website] .<br />
[[Wiki Guidelines]]: For contributing and expanding the Cube Wiki.<br><br />
[[Modding Guide]]: Like Sauerbraten? Learn how to add features.<br><br />
[[Videos]]: A page for collecting video material.<br><br />
<br />
=Engine= <br />
Disclaimer: the information stated here (below the "Engine" and "Producing Content" headings) are suggestions. The engine's complete license is ZLIB, which you should read before changing any part of the game, executable, installer, readme, or any other included media. You should also read the license of any media you are planning to use in any way.<br />
The Sauerbraten game is freeware. You may:<br />
<br />
* freely distribute the Sauerbraten archive/installer ''unmodified'' on any media.<br />
* re-compress using different archival formats suitable for your OS (e.g., ZIP, TGZ, RPM, DEB or DMG), but any changes beyond that require the explicit permission of Wouter van Oortmerssen (aka Aardappel) or any other copyright-holder.<br />
* play Sauerbraten for any purpose as long as you don't blame the author(s) for any damages incurred.<br />
<br />
Media (textures, sounds, models, etc.) will have its own specific license. Some media will be [http://www.gnu.org/philosophy/free-sw.html free] to use for any purpose, but if there is no license it is for the official Sauerbraten release distribution ''only''. The source code is free to use, but the downfall of this is that many people unfamiliar with the history and style of the engine think the game's executable and bundled data are also free to use. As restated below, '''nothing but the engine source code is necessarily ZLIB'''. Any changes you make to the engine need to be clearly recorded in an included text file -- read the ZLIB license below for more details.<br />
<br />
==Producing Content== <br />
If you want to produce new content with the Sauerbraten engine/game, you have to be aware that the source code may be open source, but the game and the media it consist of have their individual licenses and copyrights. This means that you have roughly three options:<br />
<br />
* You may produce new content for the Sauerbraten game, for example as a map (OGZs, CFGs, textures, etc.). Contributing content to the original game is most welcome, and the most productive way of working with Sauerbraten.<br />
* If you want to create your own gameplay beyond what you can do with a map, the best way to do this is as a mod (same as above, but with new executable application that incorporates your gameplay) that requires an existing install of Sauerbraten, and installs only the new files you created in parallel to and without modifying the existing files.<br />
* If you insist on making a standalone game based on Sauerbraten, do realize that only the source code is yours to use freely (if you abide by the ZLIB license below), not the media. You ''cannot'' simply redistribute the entire Sauerbraten package with your modified files, as the majority of game media is not yours to use freely (because it is made by many authors with a variety of licenses and copyright restrictions). Unless you have explicit permission from the authors, or the readme file says explicitly that it may be used for any purpose, it will be illegal to include said media in your standalone game based on the Sauerbraten engine. If a file has no specific license, it is for the Sauerbraten game's distribution only. Therefore, if you wish to produce a standalone game, be prepared to make many of the game's maps, models, textures, sounds, etc. from scratch yourself.<br />
<br />
In this sense Sauerbraten is similar to games like Quake (its code is open source, but its media is not): it is a game that is meant to be added to, not copied and used as a template. Sauerbraten is not meant to be a quick game creation kit, it is a game and an engine.<br />
<br />
If you wish to use the Sauerbraten source code in any way, read the ''src/readme_source.txt'' file and the [http://www.gzip.org/zlib/zlib_license.html ZLIB license] carefully.</div>Adminhttp://cubeengine.com/wiki/FAQFAQ2014-12-12T15:59:23Z<p>Admin: /* A: In your Cube 2 home folder */</p>
<hr />
<div>=Frequently Asked Questions= <br />
When experiencing problems running the game, this is the first place to look as it contains the fastest method of getting an ''answer'' to your question or a solution to your problem. Should your question not be answered here, use the [http://www.cubeengine.com/forum.php Cube Forums] to ask a question, and ''not'' the this page's discussion.<br />
<br />
If you're just starting out, consider going over the [[Beginners Guide]] and the [[The Readme|Documentation]], which touches on more topics in depth.<br />
<br />
Note to readers: If a word or phrase appears in a fixed-width (monospaced) font, <tt>like this</tt>, then it is likely CubeScript, Sauerbraten's scripting language. To use CubeScript, press the / (slash) key in-game or [[Scripting Guide|create a script]].<br />
<br />
<span id="sauerbraten_home"></span><br />
==Q: Where are my saved maps, configs, screenshots? Where do I put things I wish to add?== <br />
===A: In your Cube 2 home folder=== <br />
On Windows, try ''C:\Users\$USER\Documents\My Games\Sauerbraten\''.<br />
On a Mac, it's ''~/Library/Application Support/sauerbraten''/.<br />
On Linux, it's ''~/.sauerbraten''.<br />
<br />
<span id="screenshots"></span><br />
<br />
==Q: How do I take good screenshots?== <br />
===A: <tt>hudgun</tt> and <tt>hidehud</tt>=== <br />
<pre><br />
hudgun 0 // This hides the HUD gun, the gun that you see onscreen.<br />
hidehud 1 // This hides the HUD, including the stats and crosshair.<br />
sleep 10000 [ screenshot ] // Waits 10,000 milliseconds (ten seconds) then takes a screenshot.<br />
</pre><br />
For more detailed information, see [[Map Screenshot]].<br />
<br />
<span id="movie_recording"></span><br />
==Q: How do I record movies?== <br />
===A: The <tt>movie</tt> command=== <br />
Type <tt>/movie moviename</tt> to save as "moviename.avi" and <tt>/movie</tt> to stop recording. See the [http://sauerbraten.org/docs/game.html#movie_recording Cube 2 command reference] for more details.<br />
<br />
<span id="slow_game"></span><br />
==Q: The game runs very slowly, how can I fix it?== <br />
Performance is an issue with 3D games, and it is essential to a quality experience with the game.<br />
===A: Ensure you have up-to-date drivers=== <br />
Retrieve and install the drivers from your manufacturer's website.<br />
* [http://www.amd.com/ ATI/AMD Homepage]<br />
* [http://www.nvidia.com/ Nvidia Homepage]<br />
<br />
===A: Manipulate game settings=== <br />
Refer to the [[Performance Guide]] for steps on how to configure the game for more speed.<br />
===A: Tweak graphics drivers settings=== <br />
Common issues with performance are settings in your graphics driver configuration that determine your quality. Many of these are forced. How to tweak graphics is beyond the scope of this document, please refer to your driver manufacturer's website for further information:<br />
* [http://www.amd.com/ ATI/AMD Homepage]<br />
* [http://www.nvidia.com/ Nvidia Homepage]<br />
<br />
<span id="game_strangeness"></span><br />
==Q: Why is the game behaving strangely?== <br />
The most common cause of this problem is having configured (knowingly or otherwise) obscure settings or attempting to install over an older version of the game.<br />
===A: Remove your old config=== <br />
Most of the time, it should be sufficient enough to simply delete the file ''config.cfg'' in the game's base directory, this allows the game to load updated bindings and commands from ''data/defaults.cfg''. Read more about these files on the page [[Configuration Hints]].<br />
===A: Perform a clean install=== <br />
A surefire way to ensure the game will run correctly is to completely delete/uninstall and install from scratch.<br />
<br />
<span id="HOM"></span><br />
==Q: How do I fix the "Hall of Mirrors" effect?== <br />
This problem occurs most frequently on older ATI video cards or cards with incorrect or poor support for pixel shaders.<br />
===A: Limit or disable shaders=== <br />
You should first try the console command <tt>shaderdetail 0</tt>. Failing that, you may try disabling shaders completely by using the <tt>-f0</tt> switch on the command line as a last resort.<br />
<br />
<span id="game_systemlock"></span><br />
==Q: The game locks up my system, how do I get back?== <br />
===A: Linux=== <br />
With ATI cards, your problem could be related to driver issues with 3D Acceleration, for more information visit the [http://www.thinkwiki.org/wiki/Fglrx Fglrx] article on [http://www.thinkwiki.org/ ThinkWiki].<br />
* Try pressing Control-Alt-Fn to switch consoles (from X).<br />
* Try logging in from another computer using SSH.<br />
If you manage to get to a console, run <tt>ps ax | grep sauerbraten</tt> to find the process id of the process (the first number) then <tt>kill -KILL N</tt> where N is the process ID. If you are unable to do any of this, it might indicate a hard lock which could be related to a hardware/driver problem.<br />
===A: Windows=== <br />
* Try pressing Alt-Tab until you find the ''console'' (also known as the command prompt) window for Sauerbraten. If you are able to select the icon that comes up with this, press Control-Pause/Break to terminate the batch process.<br />
* Try pressing Control-Alt-Delete (forward delete, not backspace) to bring up the task manager, to manually find the ''sauerbraten.exe'' on the process page. Select it and ''End Process''.<br />
If you are unable to do any of this, it might indicate a hard lock which could be related to a hardware/driver problem.<br />
===A: Mac OS X=== <br />
* Try pressing Command-Option-Escape to get back to your desktop. If the Sauerbraten launcher consistently misbehaves, right-click on it, click Show Package Contents and go to Contents>gamedata>sauerbraten.app. Select Sauerbraten and press Command-I to open the get info panel, and make sure you have Read & Write access.<br />
<br />
<span id="mapsmenu"></span><br />
==Q: Why aren't my maps in the menu?== <br />
===A: The game already knows about them=== <br />
Either use auto-complete on the console or manually modify your maps menus. See [[Script Demo - Map Menu]].<br />
===A: You didn't put them in the right place=== <br />
Look at this FAQ: [[FAQ#sauerbraten_home|Path-Info]]<br />
<br />
<span id="monsters"></span><br />
==Q: Where are the monsters?== <br />
===A: Start in Single Player=== <br />
You need to be in a singleplayer mode (<tt>-1</tt> or <tt>-2</tt>) -- see [[Beginners Guide#introSP | Beginner's Guide - Singleplayer]].<br />
<br />
<span id="changing_my_name"></span><br />
==Q: How do I change my name?== <br />
===A: Use the commands=== <br />
Press slash (to the left of the right shift key) and type <span style="font-family: monospace,helvetica,sans-serif;">/name myname</span>. Note that your name cannot contain spaces. <tt>t</tt> opens your text-console, if <tt>/</tt> is the first character the input is interpreted as a CubeScript-command.<br />
You can put these commands into autoexec.cfg too (create if it doesn't exist); in this file you do ''not, I repeat you do not,'' need to prepend the <tt>/</tt> as all lines are interpreted as CubeScript!<br />
Welcome to the world of [[Scripting Guide|CubeScript]].<br />
<br />
<span id="ports"></span><br />
==Q: Which ports do Sauerbraten servers need opened?== <br />
==A: Read config.html== <br />
It's on the configuration page of your local documentation (README.html); always check there for most accurate information. Rumour has it they`re fixed at <tt>udp 28785</tt>and <tt>udp 28786</tt>.<br />
<br />
<span id="save_settings"></span><br />
==Q: How can I save my settings?== <br />
===A: Use ''config.cfg''=== <br />
The engine autosaves into config.cfg. You should always check config.cfg for "on-the-fly" scripting and personal settings before erasing it; keep it backed up from time to time. A missing config.cfg will be replaced by defaults.cfg and autoexec.cfg. autoexec.cfg overrides defaults.cfg. The engine first checks for a config.cfg, if it isn't there it uses defaults.cfg then autoexec.cfg.<br />
<br />
===A: Use ''autoexec.cfg''=== <br />
Put any required settings into autoexec.cfg. It's executed after config.cfg.<br />
<br />
<span id="screenres"></span><br />
==Q: The <tt>screenres</tt> command doesn't work, so how do I change my screen resolution in-game?== <br />
===A: Use the command-line parameters=== <br />
Depending on your operating system this can be either the sauerbraten.bat file (Windows) or a shell script. Add the <tt>-wWIDTH</tt> and <tt>-hHEIGHT</tt>, so if your screen is 1280 by 800, type <tt>-w1280</tt> and <tt>-h800</tt>.<br />
On Windows it might be advisable to simply create multiple shortcuts to the BAT and change the parameters solely in the attributes of that shortcut -- that way you can have multiple setups for running -- e.g. one with shaders and filters off, one with all features on that your card can support, etc. See [[Performance Guide]] for hints at what to tweak.<br />
===A: On Linux <tt>screenres</tt> works fine=== <br />
The <tt>screenres</tt> and <tt>fullscreen</tt> commands only work on UNIX based systems (e.g. Linux systems such as Debian, Ubuntu, RedHat, etc.) or OS X.<br />
<br />
<span id="waypts"></span><br />
==Q: How do I make and delete waypoints?== <br />
===A: <tt>showwaypoints</tt> and <tt>dropwaypoints</tt>=== <br />
Use <tt>showwaypoints 1</tt> to make waypoints appear as blue lines and <tt>dropwaypoints 1</tt> to drop them as you move. When you do drop them, don't jump except when absolutely necessary (such as over lava or an endless pit), and don't riflejump at all. Run around all pathways in your map a few times.<br />
To delete all waypoints for a map, use <tt>clearwaypoints</tt>. To only delete in the selection, use <tt>delselwaypoints</tt> (think "delete selection waypoints"). If your waypoints aren't loading, use <tt>loadwaypoints filename</tt> replacing ''filename'' with a specified file ending in ''.wpt'' if it is named something other than the current map.<br />
<br />
<span id="windows_exception_dialog"></span><br />
==Q: I get an exception dialog on Windows, what do I do?== <br />
===A: Grab the output in the console=== <br />
This message contains information useful to the developers, you can contribute to eliminating bugs by posting a copy and paste of the output in the console window running the game on the forum. It also helps if you add information on your system (OS, CPU, RAM, GFX, drivers installed, etc).<br />
<br />
<span id="old_gfx_card_warning"></span><br />
==Q: I get the error "your video card is WAY too old". How can I fix it?== <br />
===A: Check out your system configuration=== <br />
A fatal error like this could mean several things. Most likely, you have a video card far too old to be playing Sauerbraten with. If you have a modern card though, it could be because you have failed to install the drivers for your card. Go to your video card manufacturer's website and download the latest drivers there (links at the top of the page). If you however have a modern card with proper drivers installed and still get the error, make sure that "extension limit" in your Nvidia/ATI control panel is turned off.<br />
<br />
<span id="old_hardware"></span><br />
==Q: How can I make the game run on old hardware?== <br />
===A: Tweaking Settings=== <br />
There's no easy answer to this question, as every computer is different. If you're having problems running the game due to graphical glitches, try the <tt>-f0</tt> command line option. For further performance tweaking see the [[Performance Guide]].<br />
<br />
<span id="development_snapshot"></span><br />
==Q: Where do I get the latest development snapshot?== <br />
==Q: How do I download SVN files?== <br />
===A: Use an SVN client=== <br />
Actually, most people will not really want to download a development snapshot from SVN, but since it is regularly discussed and hence asked about in the community: SVN stands for "SubVersioN" meaning that all the developers around the world share this system. So when you download from SVN you don't know what you're getting. You have been warned.<br />
Now just go and read [http://sourceforge.net/scm/?type=svn&group_id=102911 Sourceforge SVN Repository Primer] (for Sauerbraten). You will need to install a SVN client for yourself -- e.g. SmartSVN (a Java client that should work on most platforms. It is available from Syntevo) or [http://tortoisesvn.tigris.org/ TortoiseSVN].<br />
Sauerbraten previously used CVS, as a sidenote.<br />
<br />
<span id="music_files"></span><br />
==Q: Where can I obtain the music files?== <br />
===A: In Fanatic's folder, or on his website.=== <br />
Check out: (Sauerbraten base folder)/packages/fanatic. There are a bunch of *.ogg (Ogg Vorbis) files there, numbered 1-41. The track names are also there in Track Names.txt. If you want to download the MP3s, go to [http://www2.fanaticalproductions.net:8080/ Fanatic's website] and look for the albums "Two Minute Warning", "Sauer Anger", "Panexypnos Dimiourgia", and "Spontaneous Failure".<br />
<br />
<span id="colored_text"></span><br />
==Q: How do I use colors in my text?== <br />
===A: Use the FormFeed Control Character=== <br />
ASCII-12, "\f" -- see the [[colored text]] explanation.<br />
<br />
<span id="compiz"></span><br />
==Q: Why is my mouse not working in OpenGL (Ubuntu 8.10 (Intrepid Ibex))?== <br />
===A: It seems to be caused by Compiz=== <br />
Try installing the Compiz-Fusion Button and switch to Metacity whenever you're gaming. For some reason, this fixes the mouse problem. See the following message and its followups on the official forum [http://cubeengine.com/forum.php?action=display_thread&thread_id=1890&start=112 Mouse Fix on Ubuntu 8.10].</div>Adminhttp://cubeengine.com/wiki/Eisenstern_ModellingEisenstern Modelling2014-12-12T15:59:23Z<p>Admin: </p>
<hr />
<div>==Model Development== <br />
<br />
This page is for updates, progress and tasks for 3D models in the RPG part of Sauerbraten. If you have the time to help with any tasks please put your name at the task you are undertaking or ask Geartrooper to do it for you.<br />
**The Eistenstern project is being considered for continuation or discontinuation. There is a group working on the project [https://sourceforge.net/projects/eisenstern/ on SourceForge]. The official design notes can be found [http://eisenstern.com/eisenstern_design_notes.html on the Sauerbraten website].'''<br />
<br />
===Tasks=== <br />
<br />
There are several models in desperate need of skinning and textures. Anyone comfortable with this task please contact geartrooper via irc or email.<br />
They include;<br />
A ground based dragon<br />
A gargoyle<br />
A metal bull<br />
<br />
Hud hands<br />
<br />
1. Skin and paint the Hands. -Makke<br />
2. Animate and tag for weapons. -Geartrooper<br />
<br />
Vweps<br />
<br />
1. Tag and pos weapons when pack is recieved. - unassigned<br />
<br />
<br />
Monkey_Warrior<br />
<br />
1. Model default and tagarmor, tagweapons- Geartrooper<br />
2. Skin- Unnassigned<br />
3. Animate- Geartrooper<br />
<br />
<br />
''Horse Model''<br />
# ''Fix animation cfg for any discrepencies. -'''''Geartrooper's Task'''<br />
# ''Move some verts for a more smooth appearance, specifically between the front legs'''''. -Geartrooper's Task''' '''''DONE'''''<br />
# ''Make the legs more horselike and scale the proportions for more believability.'' '''-Geartrooper's Task''' '''''DONE'''''<br />
<br />
''Rat Model''<br />
# ''Fix UV's for seams and speed up idle animation.'' '''-DONE updated files sent'''<br />
<br />
''NPCMan Model''<br />
# ''Mask specularity'' '''-unnassigned'''<br />
# ''Scale smaller sans md3.cfg'' -'''DONE files will be provided upon completion of all npcman tasks'''<br />
# ''Improve mapping and texture?'' -unnassigned<br />
<br />
''MMan''<br />
# ''Mask specularity'' '''-unnassigned'''''<br />
<br />
General<br />
# Use an inclusive scale for all models to help project ferocity, difficulty, danger to a degree.<br />
# Scale wolf a bit bigger.<br />
# Mask all models for glow and/or specularity.</div>Adminhttp://cubeengine.com/wiki/Edit_WalkThroughEdit WalkThrough2014-12-12T15:59:22Z<p>Admin: </p>
<hr />
<div>==Text Only -- The basic stuff== <br />
<span id="Part1"></span><br />
===Part I=== <br />
Assuming you start with a <tt>newmap</tt>...<br />
* <tt>e</tt> to <tt>edittoggle</tt>,<br />
* <tt>/gamespeed 300</tt><br />
* move up above the plane, viewing down<br />
* <tt>MW + G</tt> until your grid shows the plane as 4 by 4<br />
<br />
Since this walkthrough was first written, a lot has changed in the engine, so I'd suggest you put the following into your ''autoexec.cfg'' instead of using the <tt>gamespeed</tt> command:<br />
<br />
<pre><br />
editbind LSHIFT [ floatspeed 723; onrelease [ floatspeed 100 ] ]<br />
editbind RSHIFT [ floatspeed 30; onrelease [ floatspeed 100 ] ]<br />
</pre><br />
<br />
This will make your left and right shift keys toggle your <tt>floatspeed</tt> -- a personal value, unlike <tt>gamespeed</tt>, so it works in spectator and coop-editing too -- to a fast (left shift) or a slow (right shift) setting. Of course, you might wish to tweak the exact values to your own liking.<br />
<br />
Remove the outer layer of cubes completely.<br />
<tt>MW</tt> scrolling on the active cube will push/pull geometry.<br />
The active cube is either the off-white ''pointed at'' cube<br />
or it's the one you left-clicked to select.<br />
Selection can be enlarged/reduced by dragging - even while moving;<br />
but the easiest way to select structures is to:<br />
# select two corners opposite on all 3D planes<br />
# select the first by left-click, the second by right-click<br />
<br />
continue the process of removing the outer layer,<br />
take note of the depth of the map.<br />
# move down along the borders of the central pillar<br />
# remove the lower row of cubes to make it a free floating cube<br />
# <tt>/savemap my_first_map</tt><br />
<br />
You just excavated only on the lower half of an octree.<br />
The initial map was a completely half-filled octree.<br />
Manage your space wisely!<br />
<br />
The grid is your friend!<br />
Since textures align to the grid it is vital when geometry is deformed,<br />
great care needs to go into texture/geometry combinations when detailed areas are created.<br />
<br />
===Part II=== <br />
If you followed [[Edit WalkThrough#toc1|Part I]] : <tt>/map my_first_map</tt><br />
If you don't load the map, you might still want to <tt>/gamespeed 100</tt> - maybe use [[Using the Console|history]].<br />
Drag a single cube-border on your map by following these steps:<br />
Assuming you just have a central block inside your map ...<br />
<br />
# select any cube on the border of your map<br />
# <tt>MW + G</tt> until your grid won't go any smaller<br />
# <tt>MW</tt> it as far as it will go, that's border #1<br />
# <tt>/gamespeed 300</tt><br />
# continue a row of cubes at the border .. 4 rows actually<br />
# use the 1st/2nd selection to quickly select ''known'' fields as soon as you've done the first couple of faces completely :)<br />
# <tt>/savemap</tt><br />
<br />
===Part III=== <br />
If you followed [[Edit WalkThrough#toc2|Part II]] : <tt>/map my_first_map</tt><br />
Remember <tt>/gamespeed 100</tt> .... or less - for delicate movements.<br />
<br />
Go to the center of your map, you will be placed there if upon mapload,<br />
since no spawn is yet placed.<br />
We will change this.<br />
<tt>/newent playerstart</tt><br />
then move a bit up from the sparkle of the playerstart entity.<br />
<tt>/newent light 128 64 64 64</tt><br />
place yourself somewhere looking nicely onto your platform<br />
<tt>/calclight 2;savemap</tt><br />
on linux you could even do<br />
<tt>/fullscreen 0;fullbright 1;calclight 2;savemap;fullscreen 1</tt><br />
<br />
Now your map has an entity to spawn and a light to see.<br />
Everything else is more of the same with your knowledge of the [http://sauerbraten.org/README.html documentation].<br />
<br />
==Illustrated example - building ''with'' the grid== <br />
===Motivation=== <br />
Say you want to make a map that contains some curved walls ..<br />
.. but we only have a rectilinear grid on which to place corners of our cubes -<br />
what to do?<br />
<br />
We will try to create the closest fit to a curved line by interpolating -<br />
using the different gridsize and edges of the octree.<br />
<br />
When preparing for the layout of your map, you should try having your required rotation variants already too. So when you've done one curvature: copy/paste/flip that building block once across every plane of the world (XY, YZ, XZ) - imagine you need to make one crossroads of hallways with every corner a curved one.<br />
This is also good to take a close look at your cubes orientation - meaning: which edge goes in how far, could maybe the face to the side be better suited .. because of texture-mapping seamlessness/beauty/verisimilitude - also note exactly how you've postitioned your geometry on the grid in relation to the size of your texture(s) - meaning: when you paste it somewhere, on what gridcount of which gridsize will you have to snap your target-area(s).<br />
<br />
===Realisation=== <br />
Pics to shoot .. Text to write ..</div>Adminhttp://cubeengine.com/wiki/Editing_WalkThroughEditing WalkThrough2014-12-12T15:59:22Z<p>Admin: </p>
<hr />
<div><span id="walkthru"></span><br />
=Walk Through 101= <br />
You should definitely be aware of the editing conventions:<br />
If we write <tt>X</tt>, the key X is what you should press. Any and all dimensions : <tt>width by depth by height</tt> ...are, of course, always relative to your current viewport, unless explicitly noted otherwise!<br />
<br />
Depending on your depth of involvement with this project you might want to skip ahead ...<br />
* [[Editing Methods#wt_basic|Basic Introduction]]<br />
* [[Editing Methods#wt_features|Features Introduction]]<br />
* [[Editing Methods#wt_expert|Expert Examples]]<br />
<br />
<span id="wt_basic"></span><br />
==First Run==<br />
Launch Sauerbraten. Open the console by pressing <tt>/</tt>. Type so it looks like this:<br />
<br />
<pre><br />
> /gamma 150_<br />
</pre><br />
<br />
with the <tt>></tt> being the prompt, the <tt>/gamma 150</tt> being the command, and the underline "<tt>_</tt>" being the cursor. Press Enter to execute this command. Then press E. Now type...<br />
<br />
<pre><br />
/newmap<br />
</pre><br />
<br />
The resulting blank map is a half-filled octree.<br />
<br />
From here on you will start to build your own map layout.<br />
<br />
Turn your camera view downwards<br />
scale up grid by 2 : <tt>G+MW</tt><br />
delete a cube downwards by simply scrolling away from you<br />
and delete another one next to that<br />
fly into the hole and <tt>edittoggle</tt> (or 'E')<br />
run around - get a feel for the size<br />
<tt>edittoggle</tt> (or 'E')<br />
fly out of the hole<br />
lengthen the corridor by 2 cubes,<br />
Your corridor should have dimensions of 1x4x1,<br />
with orientation depending on your position and selection of first cube, etc.<br />
<br />
turn it into a square of corridors<br />
<pre><br />
a top-down view of your square,<br />
with x as deleted cubes<br />
xxxx<br />
x x<br />
x x<br />
xxxx<br />
</pre><br />
select this top-down square of cubes into a 6x6 selection of the top<br />
adapt the texture : <tt>Y+MW</tt> - brick<br />
select from outermost back face of corridor ...<br />
...to off-center side of square : 1x5x4<br />
<tt>Y+MW</tt> - brick<br />
and repeat for all 4 wall orientations.<br />
[[File:wt101i_1x4x5.jpg]]<br />
fly into square<br />
scale down grid by 2 : <tt>G+MW</tt><br />
HxWxD:3x2x5 cubes from center of any inner wall<br />
turn corner (left or right)<br />
repeat 3x2x5 inwards<br />
<pre><br />
savemap wt101<br />
map wt101<br />
</pre><br />
orientation will be same as when changing the map,<br />
but spawn will replace you at the coordinates (0,0,0)<br />
where exactly this is in relation to the square of corridors<br />
...let's call it : an atrium<br />
depends very much on your personal execution of this walk-through!<br />
<br />
You can select a specific starting point by placing your first entity.<br />
What every map should have at least on of.<br />
A <tt>playerstart</tt><br />
<pre><br />
newent playerstart<br />
</pre><br />
(or use editing menu)<br />
orientation taken from your LOS as the editing camera position at creation time<br />
[LOS:line-of-sight]<br />
<pre><br />
entproperty N D<br />
</pre><br />
with N the property index (0..3) and D the delta (..-2,-1,0,+1,+2..)<br />
<pre><br />
savecurrentmap<br />
map wt101<br />
map wt101<br />
map wt101<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Editing_MethodsEditing Methods2014-12-12T15:59:22Z<p>Admin: </p>
<hr />
<div><br />
<span id="conventions"></span><br />
=Conventions= <br />
If we write <tt>'X' - key X</tt> is what you should press. Any and all dimensions : <tt>''Width'' x ''Depth'' x ''Height''</tt> ...are, of course, always relative to your current viewport, unless explicitly noted otherwise!<br />
<br />
Value ranges always start at 0, so the 1st <tt>entproperty</tt> is <tt>entproperty 0</tt>!<br />
<br />
<span id="intro"></span><br />
=Introduction= <br />
Your installation folder holds some offline documentation in "docs/" -- always keep it handy! You might also want to read the [[Edit WalkThrough]] to get you going and/or verify you've got the basics down.<br />
<br />
<span id="i-basics"></span><br />
==Basics== <br />
To get started with Sauerbraten editing, you will first need to be acquainted with the key mappings. The easiest thing to do here, is simply print out the file found in <tt>\Sauerbraten\data\defaults.cfg</tt>. Aside from any autoexec.cfg edits you use, this file contains everything you'll need to get editing fast. These pages will assume you are running a default keymapping if telling you about a key binding. Take a look at the [[Scripting Guide|scripting section]] if you want to adapt your bindings. Using a wheel-mouse is highly recommended and the default bindings assume one is used!<br />
<br />
Some basic introduction into sauerbraten editing mode is given here [http://www.quadropolis.us/node/27 Sauer Editing (by staffy on quadropolis)]. A good primer to every budding mapper is [http://www.quadropolis.us/node/30 Some general mapping tips (by makkE on quadropolis)].<br />
<br />
===The Power of the Right-Click=== <br />
Left-clicking to mark entities or faces is straight-forward. So too is the usage of right clicking to extend selection.<br />
<br />
Don't underestimate the power this gives you, e.g. after the first entity in a given set, right-click to add all the rest of the set. Then right-click a face somewhere nearby. Copy-Paste is now as easy as orientating from the face you chose as "handle".<br />
<br />
<span id="i-geom"></span><br />
==geometry== <br />
<br />
===Scroll Wheel bindings=== <br />
* <tt>Y-Scroll</tt>: select texture for face<br />
* <tt>F-scroll</tt>: push current face into cube<br />
* <span style="font-family: monospace,helvetica,sans-serif;">Q-scroll</span>: push current corner into cube -- also middle mousebutton<br />
* <span style="font-family: monospace,helvetica,sans-serif;">R-scroll</span>: rotate cube (along current faces normal)<br />
* <span style="font-family: monospace,helvetica,sans-serif;">J-scroll</span>: select brush (just for [[Editing Methods#heightfield|heightfields]])<br />
<br />
===Single Key Bindings=== <br />
* <tt>C and</tt> <tt>V</tt>: copy / paste ''(use +/- X gridsize for scaling)''<br />
* <tt>X</tt>: mirror cube ''(along current faces plane)''<br />
* <tt>0</tt>: allfaces ''(for textureediting)''<br />
* <tt>.</tt>: editent ''DOT-key''<br />
* <tt>H</tt>: as heightfield<br />
* <tt>BACKSPACE</tt>: delete selection<br />
<br />
<span id="i-ents"></span><br />
==Entities== <br />
create entities via menu or by manually calling <tt>newent NAME [arg1 [arg2 [arg3 [arg4]]]]</tt>drag entities by their sparkly along plane closest to current FOV. modify a certain property of your selected (or closest) entity by using<br />
<pre><br />
entproperty 0 +10<br />
entproperty 1 -180<br />
entproperty 3 -1<br />
loop p 3 [entproperty (+ 1 $p) -32]<br />
</pre><br />
or if you like to scroll via <tt>MW + 4</tt> and select the appropriate property (0..3) via <tt>MW + 3</tt> you might use [http://www.quadropolis.us/node/300 this script]. Some entities constantly rotate, others can be orientated - for example mapmodels, teledest and playerstarts. These ents will take their original orientation from your viewing angle at time of placement, this angle will be saved in entproperty 0 (usually - check on your console to be sure!)<br />
<br />
===Interesting Entities=== <br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| entname <br />
| param <br />
| description <br />
|-<br />
| jumppad <br />
| P H V <br />
| P = power of push, H and V power in direction of N/S and E/W (absolute on map).This means you could have two jumppads diagonally opposite each other and with properties <tt>23 10 -10</tt> and <tt>23 -10 10</tt>, <br />
|-<br />
| monster <br />
| T <br />
| T = type of monster. 0 is ogro, 1 is rhino, 2 is ratamahatta, 3 is slith, 4 is bauul, 5 is hellpig, 6 is hellknight, 7 is goblin - current FOV @ placement is direction it's facing, tweak by <tt>entproperty 0</tt> <br />
|-<br />
| teleport <br />
| I <br />
| I = index of this teleport (needs to be unique) <br />
|-<br />
| teledest <br />
| I <br />
| I = index of target teleport (see above) - current FOV @ placement is direction your facing on exit <br />
|}<br />
<br />
===Handling Entity Properties===<br />
There are a zillion possible alterations of the example procedure shown below, it's just not possible to give you all the possible methods of interaction - the document would be of infinite size and thus infinitely unhelpful. You just need to build up your own subset of handy commands you keep using, start writing some on-the-fly scripts and then - when they turn out to be really useful - copy (and enhance) them inside their own little CFG file you call from inside your autoexec.cfg - this way you'll have these "functions" stored nice and clean and seperate ... good basis for distributing them later to a site like http://quadropolis.us<br />
The following is based on a discussion that occured on the cube-forum - http://cubeengine.com/forum.php?action=display_thread&thread_id=3&start=4406<br />
<pre><br />
#4412: Rotate mapmodels<br />
by aiueo on 11/25/2010 06:55<br />
I wonder if it is possible to rotate all the mapmodels inside of some selection.<br />
The problem is, I've rotated some large map with about two hundreds of mapmodels, <br />
but they all saved their original direction. Is there any way I could turn them by -90 (or +270) degrees?<br />
<br />
<br />
#4415: Re: Rotate mapmodels<br />
by SheeEttin on 11/26/2010 07:58, refers to #4412<br />
http://sauerbraten.org/docs/editref.html#replaceents<br />
If you just want to do it on a subset of all mapmodels (those inside a selection), <br />
then it's more complicated [...]<br />
<br />
<br />
#4416: Re: Rotate mapmodels<br />
by Hirato Kirata on 11/26/2010 13:03, refers to #4415<br />
rotate in a selection<br />
/entselect insel<br />
/entloop [entset (et) (+ (ea 0) 270) (ea 1) (ea 2) (ea 3) (ea 4)]<br />
To rotate everything, just replace insel with 1<br />
<br />
<br />
#4418: ..<br />
by Drekow on 11/26/2010 21:13<br />
There is a way to deselect all the ents without loosing the blue selection box?<br />
I wants to do a script that flips ents for ctf maps...<br />
<br />
<br />
#4419: Re: ..<br />
by eihrul on 11/27/2010 00:25, refers to #4418<br />
/entcancel command?<br />
</pre><br />
<br />
<span id="beforeumap"></span><br />
=Before You Map= <br />
<br />
Be warned that:<br />
* mapping can burn a lot of your time,<br />
* keeping backups is an absolute necessity,<br />
* and not adhering to playability standards will make your map a failure.<br />
<br />
When you've done tinkering around and getting to grips with your tools, try to build some stuff -- just to really get a feel for resulting scale, after endless hours refining just one corner of your layout -- you might want to read something like this [http://www.cliffyb.com/art-sci-ld.html article on mapping], or either of these two chapters [http://book.hourences.com/bookgameplay.htm gameplay] and [http://book.hourences.com/booklighting.htm lighting]. They will help you to get the most out of your work into something being a great map. Don't hesitate to really closely examine how architectural stuff and visual impressions are done by others. Use E on any part of a map you like to find out how it was done. Just don't save over the originals, or you might not be able to play on servers. Also, don't forget to check out what ''data/default_map_settings.cfg'' does or how the map you're looking at might be modifying this through it's own map-CFG (for map "this_map" it would be p''ackages/base/this_map.cfg'').<br />
<br />
You will most surely want to use a lot of <tt>floatspeed 10</tt> up to <tt>floatspeed 1000</tt> to speed up or slow your movement -- depending on wether you need to zoom across your RPG map toward some distant location or are fine tuning minimal grid-size stuff.<br />
<br />
The final thing a new mapper should be thinking about is releasing their first. Share the maps with a few other people, just for ideas, and encouragement along the way. If you are unsure about what is actually a nice looking/playing map, just load up any map from the first maps menu in Sauerbraten. This should give you some guidelines as to what is expected out of a map.<br />
<br />
If the [http://sauerbraten.org/docs/editing.html editing tutorial] didn't get you started, try this [[Editing WalkThrough|DIY-walkthrough]].<br />
<br />
<span id="wt_features"></span><br />
=Editing Features Explained= <br />
You really have some incredible features at your fingertips -- this will likely call for some personalized key-bindings sooner or later. Since your view's angles have influence on the way you select faces of cubes you should think about being able to finetune your movement sensitivity by quickly switching from one gamespeed to another. The simplest form would be have two key-bindings to toggle between "default" and a high as well as a low setting. This script sets you to move five times faster while holding the equals sign, and a third as fast while holding backslash (above enter).<br />
<pre><br />
bind EQUALS [ gamespeed 500; onrelease [ gamespeed 100 ] ]<br />
bind BACKSLASH [ gamespeed 30; onrelease [ gamespeed 100 ] ]<br />
</pre><br />
Finer grained modifiers can be used if this is your style -- either get some basic scripting from the interwebs or write it yourself, this is too personal for there to be big packs, the meATpAk might be an exception -- but it does everything it's own way, so: you've been warned!<br />
<br />
<span id="wt_expert"></span><br />
=Expert Editing Methods= <br />
<br />
[[Map Screenshot]]: for use as the GUI map icon, Quadropolis image, and so on.<br><br />
[[Map Config and Scripting#tocMap Config and Scripting4|Shaders]]: what are they? How do you use them?<br><br />
<br />
Please help us to fill this page with more helpful information! Simply post your suggested entries on the discussion page here.<br />
Things that should be discussed in (more) detail:<br />
<br />
Particles, triggers (for more than a simply locked door), lighting<br />
<br />
<span id="heightfield"></span><br />
==Heightfield== <br />
Convert your current selection to a heightfield by pressing <tt>H</tt>, then roll your mouse with <tt>J</tt> pressed to select your desired brush. Now more over your selection and roll your mouse as usual for geometry manipulation. Now you're manipulating the heightfield with your selected brush. If you press <tt>H</tt> again it will smooth your current selection. (Uses a moving avg algorithm)</div>Adminhttp://cubeengine.com/wiki/Distributing_MapsDistributing Maps2014-12-12T15:59:21Z<p>Admin: </p>
<hr />
<div>Redirect to Sharing Content</div>Adminhttp://cubeengine.com/wiki/Demo_RecordingDemo Recording2014-12-12T15:59:21Z<p>Admin: </p>
<hr />
<div>To record a demo you need to be admin, so -- even on a locally run server -- you will need to set a master-password and authenticate yourself with this to gain admin status.<br />
If you're running a linux-machine you could start a (private [i.e. non-public]) server something like this<br />
<pre><br />
bin_unix/linux_server -mlocalhost -pMY_SECRET_PASSWORD<br />
</pre><br />
and then in your client execute<br />
<pre><br />
/setmaster MY_SECRET_PASSWORD<br />
</pre><br />
<br />
It is not possible to do this on the mini-server running for your regular client, you will need to run a dedicated server and then <tt>connect localhost</tt> to it!<br />
<br />
This page is just a stub -- please feel free to elaborate more on this subject.</div>Adminhttp://cubeengine.com/wiki/Cubescript_Tutorial_Key_ReferenceCubescript Tutorial Key Reference2014-12-12T15:59:21Z<p>Admin: </p>
<hr />
<div>Here’s an easy-to-use list of the keys available to bind in Sauerbraten. All the names are defined in ''data/keymap.cfg''. If you need to change this file be sure to keep a backup of the original! Changing it might be necessary if you're not using a US-keyboard -- see here for [[configuration|adding dead keys]] to use in binds. If a key has a question mark next to it, it may not be present on all keyboards. The keyboard being measured against here is a MacBook laptop keyboard.<br />
<br />
<pre><br />
MOUSE1 left-click<br />
MOUSE2 right-click<br />
MOUSE3 center-click<br />
MOUSE4 depends on mouse (?)<br />
MOUSE5 depends on mouse (?)<br />
BACKSPACE backward delete<br />
TAB<br />
CLEAR (?)<br />
RETURN<br />
PAUSE (?)<br />
ESCAPE<br />
SPACE<br />
QUOTE '<br />
COMMA ,<br />
MINUS -<br />
PERIOD .<br />
SLASH /<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
SEMICOLON ;<br />
EQUALS =<br />
LEFTBRACKET [<br />
BACKSLASH \<br />
RIGHTBRACKET ]<br />
BACKQUOTE ’<br />
A<br />
B<br />
C<br />
D<br />
E<br />
F<br />
G<br />
H<br />
I<br />
J<br />
K<br />
L<br />
M<br />
N<br />
O<br />
P<br />
Q<br />
R<br />
S<br />
T<br />
U<br />
V<br />
W<br />
X<br />
Y<br />
Z<br />
DELETE forward delete (?)<br />
KP0 number pad 0 (?)<br />
KP1 number pad 1 (?)<br />
KP2 number pad 2 (?)<br />
KP3 number pad 3 (?)<br />
KP4 number pad 4 (?)<br />
KP5 number pad 5 (?)<br />
KP6 number pad 6 (?)<br />
KP7 number pad 7 (?)<br />
KP8 number pad 8 (?)<br />
KP9 number pad 9 (?)<br />
KP_PERIOD number pad . (?)<br />
KP_DIVIDE number pad / (?)<br />
KP_MULTIPLY number pad * (?)<br />
KP_MINUS number pad - (?)<br />
KP_PLUS number pad + (?)<br />
KP_ENTER number pad Enter (or Return) (?)<br />
KP_EQUALS number pad = (?)<br />
UP<br />
DOWN<br />
RIGHT<br />
LEFT<br />
INSERT (?)<br />
HOME (?)<br />
END (?)<br />
PAGEUP (?)<br />
PAGEDOWN (?)<br />
F1<br />
F2<br />
F3<br />
F4<br />
F5<br />
F6<br />
F7<br />
F8<br />
F9<br />
F10<br />
F11<br />
F12<br />
F13 (?)<br />
F14 (?)<br />
F15 (?)<br />
CAPSLOCK<br />
NUMLOCK (?)<br />
SCROLLOCK (?)<br />
RSHIFT right shift<br />
LSHIFT left shift<br />
RCTRL right control (ctrl)<br />
LCTRL left control (ctrl)<br />
RALT right alt (option on a Mac)<br />
LALT left alt (option on a Mac)<br />
RMETA right meta (Command key on a Mac, Windows key?)<br />
LMETA left meta (Command key on a Mac, Windows key?)<br />
RSUPER right super (?)<br />
LSUPER left super (?)<br />
MODE (?)<br />
COMPOSE (?)<br />
HELP (?)<br />
PRINT (?)<br />
SYSREQ (?)<br />
BREAK (?)<br />
MENU (?)<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Cubescript_Tutorial_Chapter_4Cubescript Tutorial Chapter 42014-12-12T15:59:20Z<p>Admin: </p>
<hr />
<div>=CubeScript Tutorial= <br />
<br />
==Chapter 4: More Valuable Information== <br />
<br />
===4.1 <tt>arg1</tt>!=== <br />
<br />
Each value after a command is called an argument, “arg” for short. Many commands in Sauerbraten have only one argument; but some have several. How can you give this power to your own commands (i.e. <tt>zoom</tt>)? Try this out for size:<br />
<br />
<pre><br />
emergency = [<br />
say We have $arg1 enemy attacking $arg2.<br />
say Send $arg3 men immediately!<br />
]<br />
</pre><br />
<br />
“<tt>arg1</tt>”, “<tt>arg2</tt>”, and “<tt>arg</tt>3” are three (that’s more than two but less than four) arguments following the new command “<tt>emergency</tt>”. If you type<br />
<br />
<pre><br />
/emergency [ many ] [ base 1 ] [ 5 ]<br />
</pre><br />
<br />
The following message will be sent out to all players:<br />
<br />
We have many enemy attacking base 1.<br />
Send 5 men immediately!<br />
<br />
Cool, huh? (Yes, there is a script you can write to check and correct your grammar/spelling. No, it will never be written.)<br />
<br />
A note about “arg” before we move on. “$arg” can only be used directly inside its parent script, as show. If you place it within [ ] inside of the script, use “@arg” instead. If you need a further [ ] inside the [ ], use “@@arg”, etc..:<br />
<pre><br />
example = [ $arg1 [ @arg2 [ @@arg3 [ @@@arg4 ] ] ] ]<br />
</pre><br />
<br />
===4.2 <tt>if ( = $continuing 1 ) [ proceed ] [ return_to 2.1 ]</tt>=== <br />
<br />
For the past few sections, you’ve been using “if” statements that only do something if a value equals X. “if” statements are a lot more flexible, though. What if you wanted to do D if “zoomvar” equals one, but N if it doesn’t? Simply place the second part after the first:<br />
<pre><br />
if (= $zoomvar 1) [echo zoomvar is 1] [echo zoomvar is not 1]<br />
</pre><br />
This will echo<br />
<br />
zoomvar is one<br />
<br />
if "zoomvar" is one, and<br />
<br />
zoomvar is not 1<br />
<br />
otherwise. Another neat thing to do with “if” statements is non-equals comparisions (ie greater or less than):<br />
<pre><br />
if (> $zoomvar 1) [echo zoomvar is too big!]<br />
if (< $zoomvar 1) [echo zoomvar is too small!]<br />
if (= $zoomvar 1) [echo zoomvar is just right!] //jff...<br />
</pre><br />
To figure out which direction to place the compare symbols, just think (X > Y), then just move the symbol to the front. Or just use<br />
<pre><br />
($zoomvar > 1)<br />
</pre><br />
Wait, there’s more! The two math equations 3-1 and 1+1 both equal 2, but they’re not the same. Cube can tell the difference between the contents of two scripts with “strcmp” (string compare):<br />
<pre><br />
if (strcmp $zoom $rootzoom) [echo you copied rootnis’ zoom] [echo you did not copy rootnis’ zoom]<br />
</pre><br />
Then there are the “existence” comparisons.<br />
<pre><br />
if ($zoom) [echo the script zoom exists]<br />
<br />
if (! $zoom) [echo zoom does not exist]<br />
<br />
if (&& $zoom $rootzoom) [echo both zoom and rootzoom exist]<br />
<br />
if (|| $zoom $rootzoom) [echo either zoom or rootzoom exists]<br />
<br />
if (^ $zoom $rootzoom) [echo either zoom or rootzoom does not exist]<br />
</pre><br />
Those should be pretty self-explanitory.<br />
<br />
Now, this has only a little to do with “if” statements, but see the part in parenthese ()? Those are all the equations you can perform with “if”, but you can also add, subtract, etc.:<br />
<pre><br />
(+ 2 2) //add<br />
<br />
(- 2 1) //subtract<br />
<br />
(* 2 2) //multiply<br />
<br />
(div 4 2) //divide<br />
<br />
(mod 17 5) //finds the remainder after the two numbers are divided<br />
</pre><br />
Very similar to “if” is “while”, which is very useful. We’ll get to that later.<br />
<br />
===4.3 Your fourth zoom script=== <br />
<br />
(still debugging the example script)</div>Adminhttp://cubeengine.com/wiki/Cubescript_Tutorial_Chapter_3Cubescript Tutorial Chapter 32014-12-12T15:59:20Z<p>Admin: </p>
<hr />
<div>==Chapter 3: Getting More Complex== <br />
<br />
===3.1 Your third zoom script (introducing "<tt>sleep</tt>")=== <br />
<br />
Your current zoom script should look like this:<br />
<br />
<pre><br />
zoom = [<br />
if ( = $zoomvar 1 ) [<br />
fov 50<br />
zoomvar = 0 // Sets zoomvar to 0<br />
]<br />
if (= $zoomvar 0) [<br />
fov 100<br />
zoomvar = 1 // Resets zoomvar to 1<br />
]<br />
]<br />
</pre><br />
<br />
Right now, all it does is zoom in, then out. How would you make it slow down? Maybe<br />
<br />
<pre><br />
zoom = [<br />
if (= $zoomvar 1) [<br />
fov 90<br />
fov 80<br />
fov 70<br />
fov 60<br />
fov 50<br />
zoomvar = 0<br />
]<br />
if (= $zoomvar 0) [<br />
fov 100<br />
zoomvar = 1<br />
]<br />
]<br />
</pre><br />
<br />
right? Wrong: Sauerbraten wants to execute the scipt as fast as possible. To you, it will seem as if the script zooms in just as fast as before. So what can possibly be done to slow it down? <tt>sleep</tt>.<br />
<br />
<pre><br />
sleeper = [<br />
echo Hello<br />
sleep 1000 [<br />
echo World<br />
sleep 1000 [<br />
echo !<br />
]<br />
]<br />
]<br />
</pre><br />
<br />
"sleeper" <tt>echo</tt>'s the word “Hello” on the console, then “World” a second later, and finally “!” a second after that.<br />
<br />
Note two things:<br />
1. The structure of sleep commands. Each new sleep has to be embedded in the one before, as with any other commands: <tt>sleep X [ sleep X [ echo hi; sleep X [ X ] ] ]</tt><br />
2. Time in Cube is measure in milliseconds (ms). A millisecond is 1/1000 of a second, so one second is 1,000 ms, a minute is 60,000 ms, etc..<br />
<br />
So how can you apply this to "<tt>zoom</tt>"? <tt>sleep</tt>ing for a fraction of a second before each <tt>fov</tt> change will zoom in (rather) smoothly. Try<br />
<br />
<pre><br />
zoom = [<br />
fov 90<br />
sleep 200 [<br />
fov 80<br />
sleep 200 [<br />
fov 70<br />
sleep 200 [<br />
fov 60<br />
sleep 200 [<br />
fov 50<br />
zoomvar = 0<br />
]<br />
]<br />
]<br />
]<br />
if ( = $zoomvar 0 ) [<br />
fov 100 // Or just reverse the process to smoothly zoom out<br />
zoomvar = 1<br />
]<br />
]<br />
</pre><br />
<br />
It’s a bit thrown-together, but also rather advanced for your third script. (We’ll keep doing more advanced zooms as you learn more terms and processes.)<br />
<br />
===3.2 Menus=== <br />
<br />
<pre><br />
newgui<br />
guitext<br />
guibutton<br />
guitab<br />
showgui<br />
cleargui<br />
guititle<br />
guiimage<br />
guicheckbox<br />
guilist<br />
guibar<br />
guislider<br />
guiradio<br />
</pre><br />
<br />
Those terms let you script Cube's in-game menus. A simple menu that uses the first three (and "<tt>cleargui</tt>") is<br />
<br />
<pre><br />
newgui hello [<br />
guitext “Hello World!”<br />
guibutton “close” “cleargui”<br />
]<br />
</pre><br />
<br />
This creates a menu that looks like this:<br />
<br />
[[File:hello_gui_scrnsht.jpg]]<br />
<br />
and that closes when you click the text “close”.<br />
<br />
To sum up, “newgui” is like “alias”. It creats a new menu with the title that comes after. “guitext” creats a new line of text, while “guibutton” creats a line of text that does “x” when you click it. Another basic element is a “guitab”. This allows you to put more information in your menu by using more than one “page”:<br />
<br />
<pre><br />
newgui hello [<br />
guitext “Hello World!”<br />
guibutton “close” “cleargui”<br />
guitab “next page”<br />
guitext “Hello again”<br />
guibutton “main menu” “showgui menu”<br />
]<br />
</pre><br />
<br />
(As you should be able to guess, “showgui” shows the specified menu, while “cleargui” hides the menu.) Now we want to give our menu (gui from now on) a title. “guititle” shows the specified name centered at the specified place on the list.<br />
<br />
<pre><br />
newgui “hello 2” [<br />
guititle “The second Hello GUI”<br />
guitext “Say hello to the world again...”<br />
guibutton “click here” “say Hello World!; cleargui”<br />
]<br />
</pre><br />
<br />
From the examples, you can see that you can script within the guibuttons’ actions. But you can also script in other parts of the gui, too, like the name, or the guitext:<br />
<br />
<pre><br />
newgui zoom [<br />
guititle “Status of the script ‘zoom’”<br />
guitext (format “zoomvar currently is %1” $zoomvar)<br />
if (= $zoomvar 1) [<br />
guitext “You are currently zoomed out.”<br />
guibutton “Click here to zoom in now.” “zoom”<br />
]<br />
if (= $zoomvar 0) [<br />
guitext “You are currently zoomed in.”<br />
guibutton “Click here to zoom out now.” “zoom”<br />
]<br />
guibutton “Click here to close.” “cleargui”<br />
]<br />
</pre><br />
<br />
Note the use of “%” to display the value of “zoomvar” in the guitext. After the text in quotes is a list of values or alias names, which will be displayed in their designated place (%1, %2, %3, etc.)<br />
<br />
<pre><br />
format “%1 bottles of %2 on the %3, %1 bottles of %2!” $bottlenum beer wall<br />
</pre><br />
<br />
You may use up to nine values like this (%1 through %9).<br />
<br />
=[[Cubescript Tutorial Chapter 2|Previous Chapter]] [[Cubescript Tutorial Chapter 4|Next Chapter]]=</div>Adminhttp://cubeengine.com/wiki/Cubescript_Tutorial_Chapter_2Cubescript Tutorial Chapter 22014-12-12T15:59:20Z<p>Admin: </p>
<hr />
<div>=CubeScript Tutorial= <br />
<br />
==Chapter 2: Simple Scripts== <br />
<br />
===2.1 Your first and second zoom scripts (and "<tt>if</tt>", too!)=== <br />
<br />
Almost everyone's first script is a zoom script. Sauerbraten already comes with one, but it's kinda hard to use (hold "G" while scrolling with the mouse, then scroll out to zoom out). Here it is:<br />
<br />
<pre><br />
defaultmodifier = 0<br />
modifier = $defaultmodifier<br />
domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ]<br />
<br />
zfov = 120<br />
delta_game_1 = [<br />
zfov = ( + $zfov ( * $arg1 ( div $zfov -5 ) ) )<br />
if ( < $zfov 10 ) [ zfov = 10 ]<br />
if ( > $zfov 120 ) [ zfov = 120 ]<br />
fov $zfov<br />
]<br />
<br />
bind G [ domodifier 1 ]<br />
</pre><br />
<br />
Technically, in Cube 1, you can’t zoom. You only decrease the field of vision (<tt>fov</tt>), which give the effect of zooming in, and allows you to see much finer details. The script I commonly use was written by rootnis, and it allows you to zoom in while you hold down MOUSE2, but stop any time; the next click, you return to normal zoom. Your first will be much simpler, of course.<br />
<br />
Open myfirstscript.cfg. Now you need a name for your script. How about “zoom”? To name an alias (a name that allows easier script execution), you can use two methods:<br />
<br />
<pre><br />
alias zoom [ ]<br />
<br />
zoom = [ ]<br />
</pre><br />
<br />
The first one is the original way, so you’ll see it used a lot. The second is newer, but a lot easier to use: we'll use this. (Make sure to use spaces between the name, the equals sign, and the brackets that contain the script.) Now that you’ve got a name, let’s find a way to decrease your <tt>fov</tt>. The simplest way is to zoom all the way in when you click the button:<br />
<br />
<pre><br />
zoom = [ fov 50 ]<br />
</pre><br />
<br />
Okay, there’s a zoom script. Problem is, you can't zoom out. Try the command "<tt>onrelease</tt>", which will execute whatever you tell it to when you release the button.<br />
<br />
<pre><br />
zoom = [ fov 50<br />
onrelease [ fov 100 ] ]<br />
</pre><br />
<br />
And here’s that as a one-liner:<br />
<br />
<pre><br />
zoom = [ fov 50; onrelease [ fov 100 ] ]<br />
</pre><br />
<br />
Now let's try one that’s a little more complex. Let's say you want to click to zoom in, and then click to zoom out. A touchy way to do this is (if you want the zoom bound to MOUSE2):<br />
<br />
<pre><br />
zoom1 = [ fov 50<br />
bind "MOUSE2" [ zoom2 ] ]<br />
zoom2 = [ fov 100<br />
bind "MOUSE2" [ zoom1 ] ]<br />
bind "MOUSE2" [ zoom1 ]<br />
</pre><br />
So many problems arise with this one that it’s impossible to use. Plus, you never (except in rare cases) want to bind anything inside a script. So it must be time to introduce “if”.<br />
<br />
"<tt>if</tt>" is a neccessary part of many, many scripts. The sooner you learn to use it, the better. Here's how <tt>if</tt>'s used, with an explanation:<br />
<br />
<pre><br />
if ( = $zoomvar 1 ) [ ]<br />
</pre><br />
<br />
First comes "<tt>if</tt>" itself, declaring this to be an <tt>if-then</tt> statement. Then we have parentheses enclosing some wierd math equation. First comes the equals? CubeScript has some odd syntax. These statements are comparing the value of a script/variable (these are the same thing; script names are just variables with scripts as their values) called "zoomvar" and 1, to see if they equal each other. (Note: remember to put $ before any variables in the statement.) If they do, then the following <tt>[script]</tt> will execute; if not, the script will pass on to the next part (if there is any).<br />
<br />
Now to add this to your zoom script. (As your scripts get more complex, you’ll want to move away from using single-liners, and start formatting them like the following. If you use this style, you don’t need “;” between individual commands, only start them on a new line):<br />
<br />
<pre><br />
zoom = [<br />
if ( = $zoomvar 1 ) [<br />
fov 50<br />
zoomvar = 0 //sets zoomvar to 0<br />
]<br />
if ( = $zoomvar 0 ) [<br />
fov 100<br />
zoomvar = 1 // Resets zoomvar to 1<br />
]<br />
]<br />
</pre><br />
<br />
Looks complicated, huh? Look closer, and see if you can understand it all. It's all simple stuff you’ve already learned, combined. Now all you have to do is find a way to execute it.<br />
<br />
===2.2 Executing scripts=== <br />
<br />
To execute your script, Sauerbraten needs a way to find it. So far, you’ve saved your zoom script to myfirstscript.cfg, but the game doesn’t know this. Here’s where autoexec.cfg comes into play again. Place the line<br />
<br />
<pre><br />
exec myfirstscript.cfg<br />
</pre><br />
<br />
into your autoexec. Now add your <tt>bind</tt> (somewhere after the <tt>exec</tt> line: Sauerbraten always has to know a script’s name before it can use it in another script or bind):<br />
<br />
<pre><br />
bind "MOUSE2" [zoom]<br />
</pre><br />
<br />
So fire up Sauerbraten, and try it out. If it doesn’t work, make sure you’ve typed it all correctly (no missing “]”s, etc.). If it still doesn't work, remember the common solution to most problems: delete config.cfg, and open Sauerbraten again.<br />
<br />
Now that you’ve executed it with a bind, let’s try the command line. Some commands don’t necessarily need to be bound, such as loading a map. Try out your zoom script; open sauerbraten and press <tt>/</tt>. This make a little arrow (>) near the bottom of your screen, with a blinking "_" after it. The "_" is your cursor; just type<br />
<br />
<pre><br />
/zoom<br />
</pre><br />
<br />
so it looks like<br />
<br />
<pre><br />
>/zoom_<br />
<br />
</pre><br />
<br />
and press Enter. Your script executes. Now type it again, and hit Enter. You zoom out. Simple. (Remember to type "/" in front of all commands you enter in the console, otherwise they just appear as a chat message.) It's just as easy to load a map:<br />
<br />
<pre><br />
/map mapnamehere<br />
</pre><br />
<br />
will load the map of your choice. Try "/map corruption", which loads "Corruption" by Kaiser.<br />
<br />
=[[Cubescript Tutorial Chapter 1|Previous Chapter]] [[Cubescript Tutorial Chapter 3|Next Chapter]]=</div>Adminhttp://cubeengine.com/wiki/Cubescript_Tutorial_Chapter_1Cubescript Tutorial Chapter 12014-12-12T15:59:19Z<p>Admin: </p>
<hr />
<div>=CubeScript Tutorial= <br />
<br />
==Chapter 1: Getting Started== <br />
<br />
===Making a CFG=== <br />
<br />
The most basic part of a script is having a file to run it in. Of course you can simply type it in the console on-the-fly, but scripts can get very complex. Trying to type in an entire script, or even copy-and-paste it into the console simply won’t work even in slower games than Sauerbraten.<br />
<br />
So let’s open up your favorite word processor, right? Not quite yet, as your editor needs to be able to save files as pure text. Word processors, what newbs will be more familiar with, save their contents in special binary files, which Sauerbraten can’t read. Examples are Microsoft Word (*.doc), Apple’s Pages (*.pages), and OpenOffice (*.odt). Most of these can edit and save text files, but they are sluggish apps for the most part that have a lot of useless features for simple text editing.<br />
Now that you know what not to use, let’s find something you can. For Windows, most people will use Notepad -- Very exciting. For Linux, there are kate, nano, emacs, and vim. Finally, Mac has TextEdit, which reads and writes most file types. [http://www.bean-osx.com/Bean.html Bean] , an open-source offering, is free to download and a very nice balance between features, speed and elegance. Below is a list of apps that you can use, their platform(s), and how to make a CFG (“configuration file”).<br />
<br />
(If you have any information on the Windows or Linux sections, please comment in the articles discussion page.)<br />
<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| Windows <br />
| <br />
|-<br />
| Notepad <br />
| Preinstalled <br />
|-<br />
| <br />
| <br />
|-<br />
| [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] <br />
| Download <br />
|-<br />
| <br />
| <br />
|}<br />
<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| Linux <br />
| <br />
|-<br />
| [http://kate-editor.org/ kate] <br />
| Depends <br />
|-<br />
| <br />
| <br />
|-<br />
| [http://www.nano-editor.org/ nano] <br />
| Depends <br />
|-<br />
| To save, press Ctrl-O. To quit, hit Ctrl-X. <br />
| <br />
|-<br />
| [http://www.gnu.org/software/emacs/ emacs] <br />
| Depends <br />
|-<br />
| Choose the file name by typing Ctrl-F Ctrl-X (in sequence). Ctrl-X Ctrl-S (in sequence) to save, Ctrl-X Ctrl-C to quit. <br />
| <br />
|-<br />
| [http://www.vim.org/ vim] <br />
| Depends <br />
|-<br />
| <br />
| <br />
|}<br />
<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| Mac OS X <br />
| <br />
|-<br />
| TextEdit <br />
| Preinstalled <br />
|-<br />
| Open TextEdit. Click Format>Make Plain Text or press Command-Shift-T, then press Command-S and choose where to save it and what to call it. <br />
| <br />
|-<br />
| [http://www.bean-osx.com/Bean.html Bean] <br />
| Download <br />
|-<br />
| Open Bean. Click File > Save As... > Text (you provide extension) and choose a name (must end in ".cfg") <br />
| <br />
|-<br />
| [http://www.barebones.com/products/TextWrangler/ TextWrangler] <br />
| Download <br />
|-<br />
| [http://smultron.sourceforge.net/ Smultron] <br />
| Download <br />
|-<br />
| <br />
| <br />
|}<br />
<br />
===1.2 Binds: How To=== <br />
<br />
<pre><br />
bind “W” [forward]<br />
<br />
bind “W” [ forward ]<br />
<br />
bind W [forward]<br />
<br />
bind W “forward”<br />
<br />
</pre><br />
<br />
These four lines show the two ways you can assign (bind) a key to a certain command. (I prefer the first or second or even third, since they appear to be more in line with the rest of CubeScript’s style; I’ve included the fourth so you can recognize it.) This tells Cube you want to move forward when you press “w” on your keyboard. Most keys will already be assigned in Sauerbraten/sauerbraten/data/defaults.cfg (defaults.cfg from now on), so you don’t have to worry about most of them.<br />
<br />
You can assign any command to any available key (see section 1.4 for all key names). If I named a script “hello” and I wanted to assign it to the left shift key, I’d add<br />
<pre><br />
bind “LSHIFT” [hello]<br />
</pre><br />
to autoexec.cfg in my sauerbraten folder; if autoexec.cfg doesn’t already exist, you can simply make one like you did in 1.1.<br />
<br />
By default, jumping is bound to your right mouse button (MOUSE2). You might like this; however, other games usually have jumping bound to the spacebar. If you want to keep all your movement keys in one place, and your shooting keys on your mouse, you can switch some stuff around. (Currently, both left click and the spacebar are jump; however, this is still a good exercise.)<br />
<br />
So what do you do? Well, the key name (SPACE) and the command (jump) are fairly obvious, and you know how to make simple binds, so go ahead and try it. Remember to place your customizations in autoexec.cfg so that Cube will remember them if you ever need to delete config.cfg (a common fix for many problems).<br />
<br />
You should end up with something like<br />
<pre><br />
bind “SPACE” [jump]<br />
</pre><br />
Now left click is free to bind a “zoom script” to. You’ll make your first script, a zoom, in 2.1.<br />
<br />
NOTE:<br />
In defaults.cfg, you will see some lines that look like this:<br />
<pre><br />
editbind “SPACE” [ cancelsel; passthroughsel 0 ]<br />
</pre><br />
As you can see, it’s some sort of bind. But editbinds only apply while you’re in edit mode. This is delicate territory, so we’ll learn about editbinds much later on. For now, don’t touch any of them.<br />
<br />
1.3 Some basic commands for common use<br />
<br />
Here are some commands you’ll need fairly often:<br />
<br />
These five should be fairly obvious:<br />
* forward<br />
* backward<br />
* left<br />
* right<br />
* jump<br />
<br />
* "thirdperson X" turns thirdperson view on and off (X equalling 1 and 0, respectively)<br />
* "fov X" changes your field of vision to any number between 150 and 50 degrees (100 is default in Sauerbraten, 90 in most other games)<br />
* "hudgun X" shows your gun in-game (1) or hides it (0)<br />
* "hidehud X" shows your hud (heads-up-display) (0) or hides it (1)<br />
* "screenshot" takes a screenshot as a .bmp and saves it to your sauerbraten folder<br />
* "say X" used by a script to say a comment, such as “good game”, for you<br />
* "taunt" performs the taunt animation in-game<br />
* "map X" loads map X<br />
* "mode X" changes the mode for the next map to X<br />
* "echo X" is used by a script to tell only you something, such as warnings, map information, or a story in singleplayer<br />
* "''" is used to start a comment line in a script<br />
<br />
===1.4 Bind: Key names reference=== <br />
<br />
See [[Cubescript Tutorial Key Reference|this page]] for a complete list of the keys you can bind in Cube II.<br />
<br />
=[[Cubescript Tutorial Chapter 2|Next Chapter]]=</div>Adminhttp://cubeengine.com/wiki/Cubescript_TutorialCubescript Tutorial2014-12-12T15:59:19Z<p>Admin: </p>
<hr />
<div>=CubeScript Tutorial= <br />
<br />
==Table of Contents== <br />
<br />
# [[Cubescript Tutorial Chapter 1|Chapter 1: Getting Started]]<br />
## [[Cubescript Tutorial Chapter 1#toc1|1.1 Making a CFG file]]<br />
## [[Cubescript Tutorial Chapter 1#toc2|1.2 <tt>bind</tt>]]<br />
## [[Cubescript Tutorial Chapter 1#toc3|1.3 Basic commands]]<br />
## [[Cubescript Tutorial Chapter 1#toc4|1.4 <tt>bind</tt>s: Key names reference]]<br />
# [[Cubescript Tutorial Chapter 2|Chapter 2: Simple Scripts]]<br />
## [[Cubescript Tutorial Chapter 1#toc5|2.1 Your first and second <tt>zoom</tt> scripts and <tt>if</tt>]]<br />
## [[Cubescript Tutorial Chapter 1#toc6|2.2 Executing scripts]]<br />
# [[Cubescript Tutorial Chapter 3|Chapter 3: Getting More Complicated]]<br />
## [[Cubescript Tutorial Chapter 1#toc7|3.1 Your third <tt>zoom</tt> script and <tt>sleep</tt>]]<br />
## [[Cubescript Tutorial Chapter 1#toc8|3.2 GUIs]]<br />
# [[Cubescript Tutorial Chapter 4|Chapter 4: More Valuable Information]]<br />
## [[Cubescript Tutorial Chapter 1#toc9|4.1 arg1]]<br />
## [[Cubescript Tutorial Chapter 1#toc10|4.2 <tt>if ( = $continuing 1 ) [ proceed ]</tt>]]<br />
## [[Cubescript Tutorial Chapter 1#toc11|4.3 Your fourth <tt>zoom</tt> script]]<br />
# Chapter 5 (WIP)</div>Adminhttp://cubeengine.com/wiki/CubeScript_in_21_daysCubeScript in 21 days2014-12-12T15:59:19Z<p>Admin: </p>
<hr />
<div>=Orphaned= <br />
This is not a finished page, so it is not for publishing yet. You probably want the [[Cubescript Tutorial]]. This doesn't have much material or many references -- that's another reason why it's an orphan.<br />
That means that you should leave this paragraph here.<br />
<br />
=<span style="font-size: 17px; line-height: 25px;">Rough Goals</span>= <br />
Merge the information from the [[Scripting Guide|two]] [[Cubescript Tutorial|branches]] about CubeScript currently in this wiki out from this central reference; not required to be rigidly followed by a reader; but by the ordering into a 3-week course, someone hunting for references, ideas, or samples about anything will be able to learn...<br />
* from an introduction -- e.g. start reading till you start skipping on your own<br />
* intermediary stuff, like your first own scroll wheel modifier<br />
* advanced stuff, where in-depth knowledge about <tt>arg1</tt> and such might get those bits of the puzzle rattling around a scripter's mind to fall into place.<br />
* and find the right pages to look at quickly.<br />
<br />
Remember: the power of CubeScript may surprise everyone, even it's developers! Its flow-control structures combined with the (extendable -- see the [[Modding Guide]]) get-set functions make the body of possible applications impossible to count.<br />
<br />
==<span style="font-weight: 800;">Being a WIP</span>== <br />
Subsections will only contain teasers; any "real" content happens on dedicated pages. Initially we should maybe try sketching out the progression of the 3 weeks in kind-of waves, let's not touch Week 3 until Week 1 is standing solid, for example, or something like that anyway -- let's try to logically build up from Day 1.<br />
<br />
=CubeScript in 3 Weeks= <br />
This section should contain a quick to check/discard list of pages one should be at least aware of:<br />
* JadeMatrix's [[Cubescript Tutorial|CubeScript Tutorial]]<br />
* The [[Scripting Guide]]<br />
==Usage== <br />
An explanation of the hierarchy ''--'' the one we'll have eventually ''--'' of how to begin, peruse or scan this part of the wiki.<br />
If it's intricate stuff it might first become clear by reading in Week 3... if it's about more basic matters it'll probably already have been discussed earlier.<br />
<br />
=Week 1= <br />
==Day 1== <br />
===Why To Use CubeScript=== <br />
Are you repeating the same commands over and over? Have you tired of using the command history for a series of commands? Do you want to create a scroll wheel toggle of your own? Or would a simple <tt>bind</tt> even do?<br />
<br />
Even something like performing the same task on a scriptable subset of entities is possible.<br />
<br />
===Goal=== <br />
For starters we'll handle a simple keybinding scenario:<br />
<br />
**Direct Gun control'''<br />
<br />
In the Trooper release: check, if I recall correctly, this is now handled natively. Often players coming from other FPSes find the way weapon selection works unsatisfactory. The closest Sauerbraten's engine can come would be by putting this code at the end of your autoexec.cfg.<br />
<pre><br />
bind 0 "weapon 0 0 0"<br />
bind 1 "weapon 1 0 0"<br />
bind 2 "weapon 2 0 0"<br />
bind 3 "weapon 3 0 0"<br />
bind 4 "weapon 4 0 0"<br />
bind 5 "weapon 5 0 0"<br />
bind 6 "weapon 6 0 0"<br />
</pre><br />
----<br />
**<tt>entproperty</tt> Control'''<br />
<br />
This has been done natively for quite some time now. We'll handle the scroll wheel function now; let's think about entity properties... so we need a multiplier alias to know whether to scroll fast or at regular speed. Then we need an alias named game_modifier_'''n''' - where n is an appropriate index, this is the function that get's passed either +1 - 1 depending on whether the user scrolled up or down. Last -- but not least -- we need a keybinding, that will make the function accessible in-game.<br />
<pre><br />
my_scroll_multiplier = 1<br />
my_scroll_multlistof = "1 2 5 10 100"<br />
game_modifier_440 = [<br />
// Todo: Clean up the CubeScript<br />
]<br />
</pre><br />
----<br />
===Walk-Through=== <br />
[...] the clean CubeScript mentioned above, with some explanation along the way [...]<br />
==Day-2== <br />
[...]<br />
=Week-2= <br />
==Day-8== <br />
===Motivation=== <br />
[...] going deeper... probably somewhere along JadeMatrix's [[Cubescript Tutorial Chapter 4]].<br />
===Goal=== <br />
[...]<br />
===Walk-Through=== <br />
[...]<br />
=Week-3= <br />
==Day-15== <br />
===Motivation=== <br />
[...]<br />
===Goal=== <br />
[...]<br />
===Walk-Through=== <br />
[...]<br />
==Day-21== <br />
Some last words, perhaps?</div>Adminhttp://cubeengine.com/wiki/Creating_RagdollsCreating Ragdolls2014-12-12T15:59:19Z<p>Admin: </p>
<hr />
<div>Sauerbraten supports ragdolls for skeletally-animated models -- currently only MD5 models. These are specified by a ragdoll config file that is included in a model's config file.<br />
<br />
=Downloading the Editor= <br />
The ragdoll editor can be downloaded at http://sauerbraten.org/lee/ragdoll.tar.gz.<br />
<br />
=Using the Editor= <br />
See the included README.txt for basic information on keybinds for editing. Some additional stuff:<br />
<br />
The <tt>savecfg</tt>/<tt>writecfg</tt> (*) command writes a sauerbraten-readable ragdoll.cfg file. Do this when you are finished.<br />
(*): some discussion arose as to which is the correct command to use, see here : Posts 13 & 14 on http://cubeengine.com/forum.php?action=display_thread&thread_id=2029<br />
<br />
A useable ragdoll needs to have the model's joints bound to spheres (and triangles) in the ragdoll. /bindjoint (J) will bind the currently selected joint, sphere(s) and triangle. <tt>printjointmap</tt> gives some details on current binding.<br />
<br />
You might want to place spheres exactly on joints. After doing so, to select one or the other you can use the toggle visibility commands (F5-F8).<br />
<br />
The editor will load the quicksave file automatically. To load a new MD5 model, use <tt>loadmodel NAME</tt>. Then do <tt>quicksave</tt> (minus key, left of the equals sign) and it will be loaded automatically next time you run the editor. Use <tt>quicksave</tt>/<tt>quickload</tt> as you work for efficiency.<br />
<br />
=More Information= <br />
Sauerbraten's ragdoll algorithm was based on an article by David Rosen, [http://legacy.wolfire.com/rotationconstraintpaper/paper.html Character Physics based on Newtonian Particle Simulation with Angular Constraints].</div>Adminhttp://cubeengine.com/wiki/Cooperative_EditingCooperative Editing2014-12-12T15:59:18Z<p>Admin: </p>
<hr />
<div>Unique to the Cube Engine games, cooperative editing lets you build and modify maps with others seamlessly. This mode allows you to just switch to the edit mode online, just like as if you were editing locally. Some functions however are not available in coopedit, namely the undo function, along with some convenient commands like <tt>gamespeed</tt> and heightmapping.<br />
<br />
=Saving and Resuming Coopedit Sessions= <br />
Lighting and saving, is done client-side, so while still completely functional, it requires cooperation to keep everyone in the server up to date. This means if you do a <tt>calclight</tt>, everyone else will still be on fullbright or the previous <tt>calclight</tt>. Saving will just save a local copy of the current map to the hard drive, think of it as "dumping" the map off the server, rather than saving. So if you're with some friends, urge them all to save the map periodically so you don't lose your work.<br />
<br />
When resuming a coopedit session, simply use the commands <tt>sendmap</tt> and <tt>getmap</tt> to send and receive the map through the server, respectively. Note that with this method, CFG files are not sent, meaning if you've got a custom texture list in the map's CFG, everyone else will see another random set of textures instead. If you're going to coopedit with a custom config, you'll need to send the map config by other means to your friends editing with you. People who join won't be able to see the map unless they <tt>getmap</tt>, so you should probably set the server to private (using <tt>[[Multiplayer Guide#master|mastermode]]</tt>).<br />
<br />
=Editing Etiquette= <br />
Coopedit is just that -- you can add to other's work or remove it. It is poor form to delete others' work without their consent, just like it wasn't nice to destroy the other kid's castle in the sandbox. Editors try to not work next to each other to avoid interference.<br />
<br />
When choosing a server to coopedit on with your friends, use common sense. Server hosts despise editors who join a 32 player server and set it to private. There are many specialized coopedit servers which might have client limits of six or less, which is more than you'd want in a typical coopedit anyway -- four or five players is generally more than enough. As a general guide, servers with eight player slots or above shouldn't be used for coopedit, you could be stopping a group of players from having a game of capture, which they can't do on the smaller four to six player slot servers.<br />
<br />
Learn to control your temper. If a newbie joins and starts messing with your map, don't lose it. Explain calmly and concisely why you don't want them to do whatever they are doing, and try to give them a few pointers. If you don't want outsiders to join, set the server to private (<tt>mastermode 3</tt>).<br />
<br />
Coopediting can speed up redundant, repetitive, or redundant processes -- especially useful for large and complicated maps, like smoothing lots of curves or building long stairways. Other editors can fix errors that you didn't notice -- possibly with methods you didn't know about. It's important in coopedit to share editing techniques, so that even newbies can help you out. Think of editing Sauerbraten maps as writing wiki articles: anyone can contribute, and even if suffering some damage (inflicted deliberately or not) it can be reverted back to a normal state.</div>Adminhttp://cubeengine.com/wiki/Configuration_HintsConfiguration Hints2014-12-12T15:59:18Z<p>Admin: </p>
<hr />
<div>=Basic Configuration= <br />
==autoexec.cfg and config.cfg== <br />
These files reside in the base installation folder. If anything unusual happens -- like key bindings not working anymore -- you should be prepared to move (or even delete) your <tt>config.cfg</tt>. This file is autosaved during <tt>quit</tt> and executed upon engine start. It is used to keep values from one run to the next for persistent game settings and for any "on-the-fly" scripting you might have done during your last sessions. The trouble is... this may result in bogus data being saved -- the only way to win is: not to play -- so, just be ready for trashing config.cfg to return to a clean setup.<br />
<br />
It will be written at every clean exit. If it doesn't exist it will initially contain whatever is in <tt>./data/defaults.cfg</tt> - so never modify ''that'' file! It helps to remind yourself that <tt>config.cfg</tt> is actually just saved for what settings you may have changed during your previous session.<br />
<br />
Since a few releases we now have personal home-directories used for the engine, which means you need to check that folder for the config.cfg too.<br />
* On Linux it's to be found in <tt>~/.sauerbraten</tt><br />
* On Windows somewhere inside <tt>C:\Documents and Settings</tt> and or on Windows 7 you may have to go to %LOCALAPPDATA% and navigate within that directory up to Program Files\Sauerbraten<br />
* On Mac "~/Library/Application Support/sauerbraten" is the correct destination<br />
<br />
If this information is too sketchy for you, just perform a search over your harddisk for files called config.cfg!<br />
<br />
=Keyboard= <br />
==Binding Keys== <br />
You can bind your own CubeScript to keys simply by adding appropriate lines to your <tt>autoexec.cfg</tt>.<br />
<pre><br />
bind P [ echo "I pressed the key P" ]<br />
editbind P [ echo "I'm in editing and pressed P" ]<br />
<br />
// Unfortunately, the fullscreen command only works on Linux and OS X<br />
bindvar F2 fullscreen<br />
</pre><br />
<br />
==Internationalization== <br />
If you want to use extra keys on your keyboard, that aren't bindable by default -- like German Umlaut keys for example -- you'll have to edit <tt>data/keymap.cfg</tt>. You need to know the ANSI code for the key and add it to the configuration. As an example -- here the required lines for those german keys:<br />
<pre><br />
// These keybindings have been added for DE support<br />
keymap 223 SZ<br />
keymap 252 UE<br />
keymap 246 OE<br />
keymap 228 AE<br />
</pre><br />
Then you can bind them just like <tt>CARET</tt>, <tt>HOME</tt> or <tt>KP_5</tt> (e.g. any other key).<br />
If you are on Linux or Mac the tool to find out about the codes is called <tt>xev</tt>. Open a terminal and type:<br />
<pre><br />
xev|egrep "code|button"<br />
</pre><br />
The terminal is found in /Applications/Utilities/Terminal.app on Mac OS X.</div>Adminhttp://cubeengine.com/wiki/ConfigurationConfiguration2014-12-12T15:59:18Z<p>Admin: </p>
<hr />
<div>Redirect to Configuration Hints</div>Adminhttp://cubeengine.com/wiki/Coloured_textColoured text2014-12-12T15:59:17Z<p>Admin: </p>
<hr />
<div>==Coloured Text== <br />
You'll need to use the control-character "\f" (line-feed),<br />
If you need to use it interactively (in-game), you'll want to know it has the ASCII-code of 12;<br />
* On Linux and Windows '''Control + L''' will create it (unseen, it doesn't render - it's invisible!) in-game - behaviour in a gui-editor (3rd party) may vary.<br />
* On Linux '''Control + V''' and then '''L''' will produce it on the shell or similar enviroment<br />
* On Windows you can also try to create it via '''AltGr + 1 + 2''' (numpad only!). The key combination '''Control + Alt''' can be used instead of '''AltGr''' if you don't have that key.<br />
* You can also use [http://cubeengine.com/w/files/Control_char_formfeed.txt Control_char_formfeed.txt] (use "Save Link as..." from your browser!) - again, it may be rendered invisible by your editor - find one for your platform that shows up control-characters!<br />
<br />
Colourization (this also applies for CubeScript/ingame colors) works via the control-char followed by a indication character. Apart from the special cases of "\fs" and "\fr" for saving/restoring previously set colors in the current line of text you can use the following numbers to set to the respective colour:<br />
<br />
* 0: green<br />
* 1: blue<br />
* 2: yellow<br />
* 3: red<br />
* 4: grey<br />
* 5: magenta<br />
* 6: orange<br />
<br />
Everything else is drawn in white; a commonly seen colour-code-string is "\ff" for white<br />
<br />
Also see what the AssaultCube people wrote on the [[@http://wiki.cubers.net/action/view/CubeScript|AC wiki about colouring text]]</div>Adminhttp://cubeengine.com/wiki/Colored_textColored text2014-12-12T15:59:17Z<p>Admin: </p>
<hr />
<div>==Colored Text== <br />
You'll need to use the control-character "\f" (line-feed),<br />
If you need to use it interactively (in-game), you'll want to know it has the ASCII-code of 12;<br />
* On Linux you should be able to create it with Control-L (ingame or in an editor) or Ctrl + V and then L (on the shell)<br />
* On Windows you should be able to create it via AltGr-1-2 (numpad only!). The key combination Control-Alt can be used instead of AltGr if you don't have that key.<br />
<br />
Colorization (this also applies for CubeScript/ingame colours) works via the control-char followed by a indication character. Apart from the special cases of "\fs" and "\fr" for saving/restoring previously set colors in the current line of text you can use the following numbers to set to the respective color:<br />
<br />
* 0: green<br />
* 1: blue<br />
* 2: yellow<br />
* 3: red<br />
* 4: gray<br />
* 5: magenta<br />
* 6: orange<br />
<br />
Everything else is drawn in white.</div>Adminhttp://cubeengine.com/wiki/Building_and_CompilingBuilding and Compiling2014-12-12T15:59:17Z<p>Admin: </p>
<hr />
<div>The following are methods to compile Sauerbraten for the three main target OSes (Windows, Linux and Mac OS X).<br />
<br />
----<br />
<br />
==Windows== <br />
<br />
===Code::Blocks / TDM-GCC=== <br />
First, install TDM-GCC 64bit version: [[@http://tdm-gcc.tdragon.net/download|TDM-GCC]] (the second link on that page)<br />
Then, install [[@http://www.codeblocks.org/downloads/26#windows|Code::Blocks]] (first windows download link, no need for the packaged mingGW)<br />
<br />
Boot up Code Blocks, click "Open An Existing Project", navigate to sauerbraten/src/vcpp/ and select sauerbraten.cbp<br />
<br />
In the menu bar click Build, -> Build, and it will compile to your sauerbraten folder. After it is done (you will see blue text saying 0 errors and such) you can run sauerbraten.bat<br />
<br />
===Code::Blocks / MinGW=== <br />
''Note: the following method does not work with the more recent versions, use tdm gcc 64 bit.''<br />
<br />
To compile Sauerbraten under Windows, download [http://www.codeblocks.org Code::Blocks] and install it. After installation has completed, load up Code::Blocks, go to File > Open. Navigate to "sauerbraten/src/mingw" and select "sauerbraten.cbp". Once the project has loaded, go to Build > Build, and wait patiently for sauerbraten to compile. Once it has finished compiling, you will find the EXE in "sauerbraten/bin" under the name "sauerbraten-mingw.exe". Simply edit your .bat launcher to use this executable instead, and enjoy.<br />
<br />
The version of MinGW that ships with Code::Blocks was known to be buggy, especially when compiling Sauerbraten. You should probably obtain the latest version from [https://sourceforge.net/projects/mingw/files/ the Sourceforge download page] and install it (to the default location, unless you want to mess with Code::Blocks compiler settings).<br />
<br />
===Microsoft Visual C++ Express=== <br />
An alternative method for compiling under Windows is by using Microsoft's Visual C++ 2008 Express Edition. This method is slightly more painful than compiling with Code::Blocks and MinGW, but if you are more familiar with the VC++ line of IDEs, then it can be worth it.<br />
To start, navigate to sauerbraten\src\vcpp, double-click on sauerbraten.sln, and click through the process of converting the solution to the latest format. Now, you should have the solution open in front of you. Minimize it (you should still have sauerbraten\src\vcpp open) and open sauerbraten.rc in Notepad or your preferred text editor. The top line should read <tt>#include "afxres.h"</tt>. Now, this header file is deprecated, so change it to the more recent <tt>winresrc.h</tt>. (Note that you should have the Platform SDK installed, which you probably do if you're developing with VC++; you should have the include directories set up, because that's where the header is.) Save and close. One more thing to go: Right click on sauerbraten in the solution explorer, go to Properties, expand Linker, go to General, and change ..\..\bin\sauerbraten.exe to something like ..\..\bin\sauerbraten-vcpp.exe, since you probably don't want to replace the vanilla Sauerbraten executable. Hit OK. Now you're ready! Hit Build > Build Solution, and wait patiently for it to compile. As above, edit your .bat launcher (or create a new one) to use the executable you compiled. Have fun!<br />
<br />
===MSYS=== <br />
Yet another alternative method exists for Windows: that of compiling using the cmd replacement MSYS. Information and download links can be had at [http://www.mingw.org MinGW.org]. Once you have both MSYS and the MinGW compiler, the compile process is strikingly similar to Linux's: Open up MSYS, cd into Sauerbraten's src directory, and perform, as shown below, the 'make-dance'.<br />
<br />
----<br />
<br />
==Linux== <br />
Provided they have GCC installed (pulled in with the package 'build-essential' on a lot of distributions) and the required SDL development libraries (libsdl-image1.2-dev, libsdl-mixer-1.2-dev), the users of Linux need only perform the ''usual'' make-dance.<br />
Change into the directory "sauerbraten/src" (in a terminal) and then run<br />
<pre><br />
make clean<br />
make<br />
make install<br />
</pre><br />
<br />
Of course, after this, you need to make sure you run the <tt>native_*</tt> binaries, not the <tt>linux_*</tt> binaries! (The sauerbraten_unix script handles this for you.)<br />
<br />
----<br />
<br />
==Mac OS X== <br />
Todo...<br />
There is an Xcode project file, or you can use Code::Blocks for Mac.</div>Adminhttp://cubeengine.com/wiki/Blender_to_MD5_to_SauerbratenBlender to MD5 to Sauerbraten2014-12-12T15:59:17Z<p>Admin: </p>
<hr />
<div>Hello again, folks. Geartrooper here. If you've followed along the MD3 tutorials using the MD5 format will be a breeze. Just remember to have ''only'' the meshes you wish to export in your .blend file, else you'll get a lot of meshes you didn't want ingame. The exporter [http://cubeengine.com/w/files/blendermd5_2_09.zip blendermd5_2_09.zip] [updated 2/21/09, header by VerbalShadow] which also contains the md5 importer should be extracted to your .blender/scripts folder. The interface is self explanatory;<br />
<br />
[[File:md5.jpg|left]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
You must name the mesh file NAME.md5mesh and the animation file NAME.md5anim. For sanity's sake I name the individual animation files 'run.md5anim' and 'idle.md5anim'. Use what suits you best. As with md3 remember to rotate the model [r] [90] [-] before export. If you are importing models I suggest changing the Scale factor to a lower number than the default Scale:1.000. Otherwise you will see giant bones over your mesh. The cfg for md5 files is similiar to the md3 format. Just stay posted and check the wiki for default commands.</div>Adminhttp://cubeengine.com/wiki/Blender_Animated_Md3_ExportBlender Animated Md3 Export2014-12-12T15:59:16Z<p>Admin: </p>
<hr />
<div>Hello, and welcome to the Blender Animated MD3 Export tutorial. It is assumed you have viewed and understand the [[MD3 Export From Blender Tutorial|Static MD3 tutorial]] , understand basic Blender commands, and have an animated character ready for export to Sauerbraten. Also, this [http://johnny3d.promail.ca/wikitut/blendermd3_updated.zip exporter] is current and should be used for proper tag alignment for CVS Sauerbraten as of May 14, 2007.<br />
<br />
Let's open up Blender and load the character with Control-O.<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut.png]]<br />
<br />
The mesh objects are represented by arrows to show the orientation of each throughout the tutorial.<br />
<br />
<br />
Select the armature and press tab to get to edit mode. select the tip of the bone where you want the tag_torso to be and press Control-S snap the cursor to selection.<br />
<br />
''NOTE: the following image has the legs and torso text switched. Use your imagination.''<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut3.jpg]]<br />
<br />
Parent the tag to a bone Control-P that is the meeting point between the legs and torso. For graphical purposes the tag is represented in the picture by the text 'Tag_T'. Do not mistaken its position for the actual tag, which should remain at the tip of the selected bone.<br />
<br />
Do the same for tag_head. Again, tag_head is represented graphicaly by the text 'Tag_H' in the picture. Keep the actual tags parented to the tips of the respective bones.<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut3.png]]<br />
<br />
We will add tag_weapon in a moment. But first, snap the cursor to the center of the 3D space Shift-C. Set the rotation/pivot point to 'cursor' by pressing period (to the left of the slash key). This will align all rotations to the exact center of the 3d space. Now, select everything (with A) and rotate everything on the Z-axis counter clockwise by pressing R, Z, 90, and hyphen (left of the equals sign). To the exporter this is facing forward and will export properly.<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut8.png]]<br />
<br />
In the image you can see the tag_weapon representation [Tag_W]. Alignment of this tag can be touchy. Here is a good trick to use for tag alignment. Go to the frame in your animations where the character is shooting and the arm with which you will assign the weapon is level to the X-axis. Ensure you are in pose mode. Align the cursor as best you can to the tip of the bone where you want the tag to be. Go to side view -- keypad 3 -- and add the empty tag_weapon. Parent the empty Control-P to the appropriate bone.<br />
<br />
Now go to the last frame of the animations. Select only the legs and tag_torso. Open the text editor, select the exporter 'md3_export_test2.py' and execute the script [right click over the text editor window and select 'execute script']. Name the file something appropriate like 'legs.md3' and export.<br />
<br />
Now for the torso. Ensure you are in object mode. Center the cursor Shift-C.<br />
<br />
''Note-- At this point it is a good idea to save the file as nametorso.blend--''<br />
<br />
Select all and align tag_torso with the centered cursor. Make sure the pivot point is set at 3D cursor -- period again -- so that any rotations of objects and armature will occur at the cursor. Select everything except tag_torso. Rotate on the z axis 90 degrees. Now rotate selected on the x axis 90 degrees. Commands are R, X, 90, then R, X, 90. Once complete the orientation should appear so:<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut10.png]]<br />
<br />
Select the torso mesh and all tags. Export to torso.md3 or something similiar.<br />
<br />
Orientation for the head mesh and tag_head are the same for the head mesh.<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut11.png]]<br />
<br />
One difference between exporting the head mesh with all others is that you only need one frame to export with no animations. The torso md3 will take care of the head animations.<br />
<br />
In the buttons window go to Scene Mode with F10 and in the Anim tab ensure Sta: is at 1 and End: is at 1.<br />
<br />
[[File:http://johnny3d.promail.ca/wikitut/tut13.png]]<br />
<br />
Select the head mesh, tag_head, and export to head.md3 or something appropriate.<br />
<br />
Take a moment and congratulate yourself. If all went accordingly the hard part is over. Good job!<br />
<br />
Write the md3.cfg. For a comprehensive guide view /sauerbraten/docs/models.html to perform this step.<br />
<br />
Test, tweak, and enjoy.<br />
<br />
-geartrooper</div>Adminhttp://cubeengine.com/wiki/Beginners_GuideBeginners Guide2014-12-12T15:59:16Z<p>Admin: </p>
<hr />
<div><span id="prepreq"></span><br />
=Requirements= <br />
When you decide to try out Sauerbraten you should be aware of your operating system, your current graphics chipset (manufacturer and card name) and that this project is open-source and as such very much a work in progress.<br />
<br />
Typically, to run Sauerbraten at playable speeds on minimum settings, you'll need at least:<br />
1GHz or higher CPU, 256MB RAM and a GeForce 4 MX or equivalent GPU.<br />
<br />
For maximum settings, you'll need at least:<br />
2GHz or higher CPU, 512MB RAM and a GeForce 6600 or equivalent shader model 2.0 GPU.<br />
<br />
Before you even download Sauerbraten, make sure you meet the above requirements and have the latest video card drivers installed for your OS. If you're on Linux, make sure you're not using MESA drivers, and if you're on Windows, make sure you're not using the generic drivers.<br />
<br />
==Graphics Card== <br />
Be prepared that some graphics cards have problems running with the default configuration.<br />
You should then try to use all toggles to reduce rendering complexity and work yourself up.<br />
Some example combinations:<br />
* [maximum compatibility] : -w640 -h480 -b8 -z8 -a0 -f<br />
* [nVidia bpp/z-buffer] : -w1024 -h768 -b16 -z24 -a1 -f1<br />
* [full fledged] : -f3 -a4 -b24 -z24 -w1600 -h1200<br />
See the [[Performance Guide]] for an in-depth view at what to tweak.<br />
<br />
==Platform Dependencies== <br />
Due to platform dependencies some stuff works differently depending on your OS.<br />
For example on Linux and Mac OS X, users can dynamically change their screen resolution; on Windows this just isn't possible.<br />
Other aspects include driver issues, file formats (*.jpg, *.mp3) and naming (Pic1.jpg is <u>not</u> pic1.JPG)<br />
<br />
If you are running Windows be sure to have most current driver for your graphics card installed,<br />
often ATI drivers have proven to be glitchy -- [[Performance Guide]] might help there!<br />
<br />
If you are running Linux you should be sure that you have set up your system sufficiently to play,<br />
running "glxgears -info" can help and having other OpenGL and/or SDL based applications already working is a solid basis to encourage you to proceed here. If your running a 64-bit kernel you'll need to figure out wether to run in 32-bit emulation or if you can recompile the engine for your kernel.<br />
<br />
<span id="progstart"></span><br />
=Setup= <br />
First try running the game out-of-the-box, but in the long run you will want to optimize [[configuration|your setup]] to your hardware and personal preferences.<br />
There is a [[Performance Guide|plethora of settings]] for you to do this.<br />
RTFM : [http://sauerbraten.org/docs/config.html config page]<br />
<br />
To run with these parameters call your systems shell script with them.<br />
* on UNIX: usage as usual for you.<br />
Maybe you'd like to use [[Linux Server Scripts|some shell scripts]] to handle ''sauerbraten_unix'' for you,<br />
switching between different setups made easy and including a random start map selection.<br />
<br />
* on Windows : In case your in doubt : copy your sauerbraten.bat to sauerbraten_myconf.bat and edit with notepad/wordpad/equivalent<br />
<pre><br />
@ECHO OFF<br />
REM -- default call<br />
REM bin\sauerbraten.exe -w1024 -h768 %1 %2 %3 %4 %5<br />
REM -- full fledged call<br />
REM bin\sauerbraten.exe -w1600 -h1200 -b24 -z24 -a4 -f3 %1 %2 %3 %4 %5<br />
REM -- minimalistic call<br />
REM bin\sauerbraten.exe -w800 -h600 -b8 -z16 -a0 -f -lpindakaas<br />
REM -- my call<br />
bin\sauerbraten.exe -w800 -h600 -b8 -z16 -a0 -f -lpindakaas<br />
</pre><br />
Later you might want to change the last line to your systems optimal settings.<br />
It often pays to not have any settings in sauerbraten.bat itself.<br />
Instead you could just call<br />
<pre><br />
bin\sauerbraten.exe %1 %2 %3 %4 %5<br />
</pre><br />
and add appropriate parameters to a range of links (*.lnk) - say on your Desktop -- like "Medium-Resolution Sauer", "minimal sauer", "EyeCandy", ...<br />
<br />
* On Mac: Launch Sauerbraten and choose some options, then click Play. To change other options you need to go to /Users/yourusername/Application Support/sauerbraten/autoexec.cfg and set options there using [[Scripting Guide|CubeScript]].<br />
<br />
<span id="download"></span><br />
==Downloads== <br />
Click on the [https://sourceforge.net/project/showfiles.php?group_id=102911 appropriate download link] and select your mirror to download the installation file. Official clients exist for Windows 32-bit, UNIX, and Mac OS X 10.3 through 10.6 32-bit. Please pick a local mirror.<br />
<br />
<span id="unpacking"></span><br />
==Unzipping== <br />
* There is an installer wrapper for Windows, execute and follow the well known set of dialogs.<br />
* On UNIX un-tar to your favourite location (say /usr/local/sauerbraten), chmod the binaries +x if required.<br />
* Mac OS X: Double-click on the DMG, then move Sauerbraten(.app) to /Applications/ or wherever you keep your applications.<br />
<br />
<span id="autoexec"></span><br />
==Basic Configuration== <br />
Manage your [[configuration]] via autoexec.cfg. If the file does not exist in your base installation folder then create it. Two lines are necessary:<br />
<pre><br />
name "unnamed"<br />
team "none"<br />
</pre><br />
<br />
Name is capped off at 15 characters, team at 4.<br />
<br />
The engine first looks for config.cfg at launch. This is written at engine quit, so first time users will skip this step. If config.cfg is found, it is executed.<br />
If and only ''if'' the engine doesn't find config.cfg, it executes defaults.cfg, then autoexec.cfg. When a map is loaded, it's CFG file (if it exists) is loaded.<br />
<br />
For a more complex setup you might like to try the [http://www.quadropolis.us/flexinode/list/2 scripts on quadropolis], which might help your scripting needs, although simple settings simply require a ''COMMAND VALUE'' line CubeScript (used by Sauerbraten too, though syntax (and of course command set) have evolved (and still are evolving)) can be used for a wide range of complex functions. The pre-gui-release [http://quadropolis.us/node/263 meATpAk] and the post-gui-release [http://www.quadropolis.us/node/435 QCSP] script packs aim at empowering even non-scripters to use these powers to their benefit.<br />
<br />
Also check out the [[Scripting Guide]] pages of this wiki.<br />
<br />
<span id="firstrun"></span><br />
===First Time=== <br />
* Windows 32-bit: Run the sauerbraten.bat<br />
* UNIX: Run the ./sauerbraten_unix script from the base installation folder<br />
* OS X: Click the Sauerbraten(.app) launcher and click Play<br />
There are some external docs till this wiki contains that info too :<br />
[http://members.iinet.net.au/%7Epassarello/newbieguide.html Passa's (Win32) NewbieGuide] and [http://www.quadropolis.us/node/249 MeatROme's "Getting Started" Guide]<br />
<br />
When you run the game you will start up in the default map (2006-12-04 : metl4),<br />
the default mode is <tt>0</tt> - which stands for <tt>ffa/default</tt>.<br />
Let's try out some stuff:<br />
* press ESC -- the menu will pop up in front of your player. Select the "load map.." option<br />
* select a map and explore it, do this with a couple of maps<br />
* now open your console (need help? : [[Using the Console]]) and enter <tt>mode 4;map curvedm</tt><br />
* you've just chosen the <tt>instagib</tt> mode on map curvedm<br />
* select a mode/map combination via the menu ("multiplayer", "vote...", ...)<br />
* now go into the multiplayer menu, select <tt>update server list from master server</tt> and select an appropriate server from the list<br />
* if your first on the server you'll automatically set your current mode/map as the game on the server else you'll join whatever game is going on<br />
<br />
<span id="introRUN"></span><br />
=Game Modes= <br />
<span id="introSP"></span><br />
==A Look At Single Player== <br />
The single player (SP) modes of Sauerbraten enable you to play offline against a range of monsters. Start your SP game via the menu or set your mode and an appropriate map by hand. Beware that the so-called <tt>Episode 1</tt> does not currently contain monsters. It is still WiP! The single maps for basic SP (<tt>mode -2</tt>) ''do have'' monsters, though; and you can play (almost) any map in DMSP (<tt>mode -1</tt>) against a horde of monsters matching your <tt>skill</tt> level.<br />
<br />
In the basic SP mode (<tt>mode -2</tt>) which works more or less like in every other FPS -- you can pick up items only once and monsters stay killed; progress is controlled with respawn-points. Touching a respawn-point will set your next spawn to that location. If you get fragged by the monsters you will respawn inside the map, having lost all armour and some ammo, ut at least your previous incarnation has cleared the way a little. Your score is calculated as seconds you took to complete the map.<br />
Deaths, monsters left, accuracy, and a basic modifier for skill setting all get taken into account.<br />
<br />
The SP DeathMatch mode (DMSP (<tt>mode -1</tt>) will work on any map - but some just won't cut it -- and will pit you against a number of monsters (10x skill) spawning at random points. If you die in this mode the ordeal repeats - either you beat the horde or you don't -- it's a DeathMatch!<br />
<br />
<span id="introMP"></span><br />
==A Look At MP== <br />
The integrated server browser is available via the "multiplayer.." menu, be sure to regularly update from master server.<br />
The list is sorted by ping for your convenience.<br />
A "'''P'''" next to the number of players indicates a ''private server''.<br />
A "'''L'''" next to the number of players stands for ''locked server''.<br />
For details see the [[Multiplayer Guide#master|mastermodes section]] of the [[Multiplayer Guide]].<br />
<br />
<span id="introRPG"></span><br />
==Eisenstern== <br />
Note: The below information may be outdated and may not apply to the most recent release. Eisenstern has only been included in CTF Edition and Trooper Edition.<br />
<br />
You can have a look at what's cooking by running with a -grpg parameter included. So far only some NPC models are visible and the action menu is visible and ready for use. Attacking and trading has been implemented along with an inventory and monetary system, but there is no AI, so nothing fights back. Stay tuned for further progress and perhaps look at [[Eisenstern Modelling]].<br />
<br />
<span id="help-yourself"></span><br />
=Help On Finding Help= <br />
<br />
==Grrr!== <br />
While getting to know a new piece of software it is often the case that you might need help with an aspect you (personally) don't find intuitive. This is perfectly natural and nothing to be ashamed of, but the way you go about ''asking for help'' can be! So here's some help on getting help:<br />
<br />
==You'll see!== <br />
First thing to do is try finding a help resource, try a [http://www.google.com Google search], try a lot of [http://www.google.com/help/refinesearch.html different combinations] - try news- and code-searches too! Try searching this wiki, or the forums.<br />
<br />
Your local manual is accessible via the README.html in your installation folder; the documentation is also available from [http://sauerbraten.org/README.html sauerbraten.org].<br />
<br />
==Tutorials== <br />
The Cube/Cube 2 community is the place to find guides and tutorials. Check out [http://www.quadropolis.us/taxonomy/term/21 the guides on Quadropolis], or use one of the wiki pages below:<br />
<br />
* [[Mapping and Editing]]<br />
* [[Cubescript Tutorial|CubeScript Tutorial]]<br />
* [[Scripting Guide]]<br />
* [[Modding Guide]]<br />
<br />
==See?!== <br />
The game is pretty straightforward to jump into, so some people seem to overlook the manual -- don't make that mistake! But in the end a lot of Sauerbraten know-how comes through actively experimenting with the engine; even more so since it is still under development and you might find something that you think should work differently ask in the forum or on IRC about it -- maybe it's a bug? Help the project if you can! Familiarize yourself with the different aspects that make up the game.<br />
From OGZ files to CFGs, from /data/ to /packages/base/.<br />
<br />
=Watch! Listen... and Learn!= <br />
Even if we first off -- as always -- hint at RTFM.<br />
RTFM = Read The Fine Manual<br />
Even if we hint at R-ing TFM it seems impossible to stress it hard enough,<br />
Don't be a [http://www.slash7.com/pages Help Vampire].<br />
<br />
Another suggestion is to read the following article about ''asking smart questions'',<br />
it's not associated with this project but is a general article about how to go about getting help on the interwebs.<br />
Do ''not'' contact the authors about Sauerbraten -- they're only trying to help you find help (in general), not for this project specifically.<br />
<br />
* [en] : [http://www.catb.org/%7Eesr/faqs/smart-questions.html#before How To Ask Questions The Smart Way]<br />
* [de] : [http://www.lugbz.org/documents/smart-questions_de.html#before Wie man Fragen richtig stellt]<br />
* [pt] : [http://www.istf.com.br/?page=perguntas Como Fazer Perguntas Inteligentes]<br />
* [pl] : [http://rtfm.killfile.pl/ Jak mądrze zadawać pytania]<br />
<br />
The next step for you would be to contact the community of this project;<br />
either by posting in the [http://cubeengine.com/forum.php cube forum]<br />
or by visiting the IRC-Channel #sauerbraten on irc.quakenet.org. Good luck!</div>Adminhttp://cubeengine.com/wiki/HomeHome2014-12-12T15:16:52Z<p>Admin: </p>
<hr />
<div>Welcome to the [http://www.cubeengine.com/ Cube 2: Sauerbraten] project wiki. You can visit our project page on SourceForge [http://sourceforge.net/projects/sauerbraten/ here] .<br />
<br />
[[File:logo_320x160.png]]<br />
=Help=<br />
[[The Readme]]: The first place you should look for information on setting up the game.<br />
[[Install Guide]]: This describes the installation process.<br />
[[Beginners Guide|Beginners' Guide]]: How to get up and running.<br />
[[FAQ]]: View and get the answers to some commonly asked questions.<br />
[[Performance Guide]]: Things you can try to make Sauerbraten either run faster or look better.<br />
<br />
=Gameplay= <br />
[[Singleplayer Guide]]: How to play games offline.<br />
[[Multiplayer Guide]]: How to play games online or host your own server.<br />
<br />
=Editing= <br />
[[Mapping and Editing]]: Itching to create? Follow these steps.<br />
[[Distributing Maps]]: After you finish slaving over your map, you need to distribute it.<br />
[[Cooperative Editing]]: Creating with others can be fun and rewarding, but there are important principles.<br />
[[Scripting Guide]]: A look at the possibilites of scripting, with examples.<br />
[[MD3 Export From Blender Tutorial|Static MD3 Export From Blender]]: A tutorial for exporting static MD3s from Blender.<br />
[[Blender Animated Md3 Export|Animated MD3 Export with Tags from Blender]]: A slightly more difficult tutorial for exporting multiple animated and tagged MD3s from Blender.<br />
[[Hudguns with Hands|Hudguns with Hands via Blender]]: A more complex yet powerful tutorial on adding personal hudguns and hands.<br />
[[Blender to MD5 to Sauerbraten|MD5 from Blender to Sauerbraten]]: It just got easier.<br />
[[Mr Fixit|Mr. Fixit Blend File]]: For educational purposes.<br />
[[Importing md2 and md3 files|Importing MD2 and MD3 files]]: How to import existing models into Sauerbraten.<br />
[[Creating Ragdolls]]: Information on the ragdoll editor used to create ragdolls for skeletal models.<br />
<br />
=Projects= <br />
[[Eisenstern Modelling]]: Information on 3D modeling in the Sauerbraten RPG branch. Unfortunately, the Eistenstern project has been discontinued. There is a group working on the project [https://sourceforge.net/projects/eisenstern/ on SourceForge] . The official design notes can be found [http://eisenstern.com/eisenstern_design_notes.html on the Sauerbraten website] .<br />
[[Wiki Guidelines]]: For contributing and expanding the Cube Wiki.<br />
[[Modding Guide]]: Like Sauerbraten? Learn how to add features.<br />
[[Videos]]: A page for collecting video material.<br />
<br />
=Engine= <br />
Disclaimer: the information stated here (below the "Engine" and "Producing Content" headings) are suggestions. The engine's complete license is ZLIB, which you should read before changing any part of the game, executable, installer, readme, or any other included media. You should also read the license of any media you are planning to use in any way.<br />
The Sauerbraten game is freeware. You may:<br />
<br />
* freely distribute the Sauerbraten archive/installer ''unmodified'' on any media.<br />
* re-compress using different archival formats suitable for your OS (e.g., ZIP, TGZ, RPM, DEB or DMG), but any changes beyond that require the explicit permission of Wouter van Oortmerssen (aka Aardappel) or any other copyright-holder.<br />
* play Sauerbraten for any purpose as long as you don't blame the author(s) for any damages incurred.<br />
<br />
Media (textures, sounds, models, etc.) will have its own specific license. Some media will be [http://www.gnu.org/philosophy/free-sw.html free] to use for any purpose, but if there is no license it is for the official Sauerbraten release distribution ''only''. The source code is free to use, but the downfall of this is that many people unfamiliar with the history and style of the engine think the game's executable and bundled data are also free to use. As restated below, '''nothing but the engine source code is necessarily ZLIB'''. Any changes you make to the engine need to be clearly recorded in an included text file -- read the ZLIB license below for more details.<br />
<br />
==Producing Content== <br />
If you want to produce new content with the Sauerbraten engine/game, you have to be aware that the source code may be open source, but the game and the media it consist of have their individual licenses and copyrights. This means that you have roughly three options:<br />
<br />
* You may produce new content for the Sauerbraten game, for example as a map (OGZs, CFGs, textures, etc.). Contributing content to the original game is most welcome, and the most productive way of working with Sauerbraten.<br />
* If you want to create your own gameplay beyond what you can do with a map, the best way to do this is as a mod (same as above, but with new executable application that incorporates your gameplay) that requires an existing install of Sauerbraten, and installs only the new files you created in parallel to and without modifying the existing files.<br />
* If you insist on making a standalone game based on Sauerbraten, do realize that only the source code is yours to use freely (if you abide by the ZLIB license below), not the media. You ''cannot'' simply redistribute the entire Sauerbraten package with your modified files, as the majority of game media is not yours to use freely (because it is made by many authors with a variety of licenses and copyright restrictions). Unless you have explicit permission from the authors, or the readme file says explicitly that it may be used for any purpose, it will be illegal to include said media in your standalone game based on the Sauerbraten engine. If a file has no specific license, it is for the Sauerbraten game's distribution only. Therefore, if you wish to produce a standalone game, be prepared to make many of the game's maps, models, textures, sounds, etc. from scratch yourself.<br />
<br />
In this sense Sauerbraten is similar to games like Quake (its code is open source, but its media is not): it is a game that is meant to be added to, not copied and used as a template. Sauerbraten is not meant to be a quick game creation kit, it is a game and an engine.<br />
<br />
If you wish to use the Sauerbraten source code in any way, read the ''src/readme_source.txt'' file and the [http://www.gzip.org/zlib/zlib_license.html ZLIB license] carefully.</div>Admin