http://cubeengine.com/w/index.php?title=Special:NewPages&feed=atom&hideredirs=1&limit=500&offset=&namespace=0&username=&tagfilter=Cube Wiki - New pages [en]2024-03-28T14:08:00ZFrom Cube WikiMediaWiki 1.31.7http://cubeengine.com/wiki/AuthAuth2016-08-27T16:47:53Z<p>Admin: /* Rules */</p>
<hr />
<div><br />
== Rules ==<br />
<br />
# no sharing the authkey with anyone, ever<br />
# only use the authkey to kick cheaters and griefers, not for personal disputes, grudges, clan stuff, etc.<br />
# don't get into disputes with other authkey holders, instead report them to eihrul<br />
# auth is a privilege, and if you behave in a way that is not respectful to the community for any reason (regardless of whether you are using auth at the time), that privilege can be taken away</div>Adminhttp://cubeengine.com/wiki/Wiki_RefactorWiki Refactor2014-12-12T15:59:35Z<p>Admin: </p>
<hr />
<div>Unfortunately, for too long everyone has been going around and doing their own thing their own way on this wiki, which has resulted in an unprofessional finish to the documentation and guides within. I am currently in the progress of moving pages around and cleaning up their content, and everyone's help would be greatly appreciated here.<br />
<br />
=What you can do= <br />
There are many things you can do to help in this goal, most of which is keeping a watchful eye. Be on the lookout for [[broken links]] which appear red like this one.<br />
<br />
==Contributors== <br />
If you see broken links, please correct them. While I can clean up this wiki, I can only do so much. Your help is required to help make this wiki prosper, for without you, there is no wiki. Also take a look at the [[Wiki Guidelines|guidelines]] which will help us maintain some continuity.<br />
<br />
==Readers== <br />
If you notice any broken links as mentioned, please leave a note in the page's discussion.<br />
<br />
=Working Together= <br />
If we all work together we can make this wiki a great alternative to the static documentation already included with the game, I look forward to seeing some great content.</div>Adminhttp://cubeengine.com/wiki/Wiki_GuidelinesWiki Guidelines2014-12-12T15:59:35Z<p>Admin: </p>
<hr />
<div>=Wiki Guidelines= <br />
<br />
From Aardappel's [http://cubeengine.com/forum.php?action=display_thread&thread_id=939&start=20 post] on the forum:<br />
<br />
''Do not be afraid to re-factor things. So far it seems people just add to the wiki, and leave what is there in place. One of the ideas behind a wiki is that it's easy to reorganize the soup of data. If you add something that makes the structure of the document less than ideal, do not be afraid to restructure other people's text into a different set of pages and links. Do not be afraid to even delete other people's text, once you conclude it has become redundant. The original structure was just me making some example pages, it may not be ideal for the current content anymore.<br />
<br />
Feel free to post to this page's discussion board if you have major changes in mind, or certain conventions.<br />
<br />
Don't let pages grow to huge amounts of text, wikis are best when they are small sections of text per page, but heavily linked.<br />
<br />
In that same way, one of the goals of the wiki is to function as a FAQ, so if we get the thousandth post on the "your server did not reply to ping" message we can point people to exactly one wiki page that has all the firewall tutorials you could ever wish for.<br />
<br />
Some stuff on the wiki is straight out of the main documentation. Duplication is not good: it means if I update the main documentation the wiki instantly contains outdated information. Since the wiki is more for FAQs and tutorials, and the docs more for hardcore factual reference, it is good to have each section of the wiki refer to pages in the docs where the exact command reference related to the topic can be found.<br />
<br />
If you know of topics that have been discussed on this forum before, it is really helpful to find these threads, and make a wiki page out of the most explanatory posts. In fact, maybe I should be typing this post in the wiki rather than on the forum, it is getting rather long...<br />
<br />
If additional people want editing access, apply for it at the bottom of this wiki page.''<br />
<br />
=Formatting= <br />
To ensure readability, editors of this wiki should follow the basic rules outlined here.<br />
<br />
==Italics== <br />
* Directory paths and file names should be ''<nowiki>//``italicized``//</nowiki>''.<br />
* Large block quotes should be in ''<nowiki>//italics//</nowiki>''. If possible, link to the original source.<br />
<br />
==Code== <br />
* Code/script listings but also one-liners in a reference should be [[www:wikitext code|formatted]] as <span style="font-family: monospace,helvetica,sans-serif;"><nowiki>{{``Code``}}</nowiki></span>.<br />
* In-text code like variables should be in <span style="font-family: monospace,helvetica,sans-serif;"><nowiki>{{``Code``}}</nowiki></span>.<br />
* Sauerbraten shell output should be formatted in <tt><nowiki>{{``Code``}}</nowiki></tt>.<br />
* Code should be without quotes or a slash, so instead of "/getmap", <tt>getmap</tt> would be appropriate.<br />
==Other== <br />
* Create page names properly. They are the page title, and should be written like one. For example: ''multiplayer+guide'' should be written as a proper title: ''Multiplayer Guide''.<br />
* Use headings properly, in large blocks of text, these help with the [[<tt>toc</tt>]] tag. The page name is the title, write a short introduction if need be, then use the first level heading =''Like So''=. Then subheadings, ==''Two''== and ===''Three''===.<br />
* Try to keep spacing through the article consistent with the layout for easy reading when, for instances where people are skimming.<br />
* Do not use horizontal lines to separate text, use headings.<br />
* Use the '''<nowiki>**``bold``**``** and __``__``underlined``__</nowiki>__ stuff only to highlight extremely important information.<br />
* Dashes should be shown as two hyphens: -- not — (em dash), – (en dash), or - (hyphen).<br />
* Spelling and grammar should be kept to AmE (American English) or BrE (British English) when possible.<br />
* Quotes should be straight -- not curved or "smart".<br />
* Ellipses should be the three simple dots: ... without spaces or a fourth dot.<br />
* Ctrl+C is the Windows and Linux key style for key commands, but on a Mac, the equivalent combination should be written Command-C.<br />
* Windows should be referred to as Windows, not Win32 or Windoze. Mac OS X should be Mac OS X (or OS X), not MacOS or OSX. Linux is tricky.<br />
=Special Considerations= <br />
==FAQ Page== <br />
Unlike the other pages on the wiki, the [[FAQ|Frequently Asked Questions]] page is intended to be a quick stop for commonly asked questions with quick simple answers. If you need more than one or two paragraphs to explain an answer, consider using a separate page and linking to it from the FAQ. This keeps the page concise, and reduces the loading time for the page regulars, especially useful if they don't want to read a large block of text.</div>Adminhttp://cubeengine.com/wiki/VideosVideos2014-12-12T15:59:34Z<p>Admin: </p>
<hr />
<div><span style="font-size: 18px; line-height: 27px;">'''Editing'''</span><br />
<br />
Tutorials by Dr. Penny de Byl, Senior Lecturer (Computer Games and Graphics Programming), University of Southern Queensland, Toowoomba, Australia.<br />
<br />
# [http://www.youtube.com/watch?v=S8e96rE0ae8 Getting Started]<br />
# [http://www.youtube.com/watch?v=ToWQ5j21-j0 Extending Walls & Adding Textures]<br />
# [http://www.youtube.com/watch?v=oezgLy4fpzA Skyboxes]<br />
# [http://www.youtube.com/watch?v=n1gjbGlYpPo Height Maps]<br />
# [http://www.youtube.com/watch?v=SPrJhhBoHrU Grid Sizes & Cube Deformations]<br />
# [http://www.youtube.com/watch?v=owvUezhj7u8 Materials: Air, Water, Lava...]<br />
# [http://www.youtube.com/watch?v=LFYkU7vWqps Adding Lighting & Shadows]<br />
# [http://www.youtube.com/watch?v=krE8PU-_vIA Adding Static Models]<br />
# [http://www.youtube.com/watch?v=khyjiT2W6Cg Saving & Loading]<br />
# [http://www.youtube.com/watch?v=y93g5GBFU50 Adding Monsters]<br />
<br />
flow(tron) has started posting videos on [http://cubvid.com CubeVid]<br />
<br />
# [http://cubevid.com/video/30/Editing+101 Editing 101] Copy and paste and moving the selection box (about a minute).<br />
<br />
=Other= <br />
<br />
A [http://www.youtube.com/results?search_query=sauerbraten&search_type=&search=Search YouTube search for sauerbraten] videos.</div>Adminhttp://cubeengine.com/wiki/Using_the_ConsoleUsing the Console2014-12-12T15:59:34Z<p>Admin: </p>
<hr />
<div>==Using commands on the console== <br />
From your local documentation (''README.html'') you can always find out which commands the engine will react to!<br />
<br />
Single commands you enter into your console.<br />
Open your console with the / key. Or use a short script that is bound to the BACKQUOTE key:<br />
<pre><br />
bind BACKQUOTE [saycommand /]<br />
// for some language layouts, this is unusable, so bind your own:<br />
bind CARET [saycommand /]<br />
</pre><br />
While entering the first word on the console and you're to lazy to type in a full command, say <tt>thirdpersondistance</tt>, you can auto-complete it with the TAB key. This also works for the map names in the <tt>map</tt> command, by the way.<br />
<br />
Everything following a command we call parameters or arguments. Some commands take parameters, some don't, some even behave differently depending on which way you call them. For example the <tt>fov</tt> command will -- by itself -- output the current FOV value, called with an integer parameter it will try to set your current field of view. If you passed an illegal value here, so something outside the allowed range, it will also output which values it accepts. Other commands like this include <tt>particlesize</tt>, <tt>crosshairsize</tt> and <tt>skill</tt> (among others).<br />
<br />
Most commands will not output anything if they are called correctly. A noteable exception is the <tt>fullscreenshader</tt> command. This will output the succesfully activated shader -- but conversely nothing if it fails. Since some shading FX are subtle to spot and still some graphics cards can't display them. So it's probably for the best this way around.<br />
<br />
Another important feature of the console is the command history; by pressing the up arrow you can jump back to previous commands.<br />
<br />
==Tired of typing?== <br />
So, you got the hang of the console? Now you find yourself typing the same stuff again and again -- and you're tired of it? Then it's a good time for a script!<br />
<br />
For example: Say as an editor you've repeatedly had to tune your light entities to get the ambience of your map ''just right''. Well, you could of course execute three seperate <tt>entproperty</tt> commands -- which can be done pretty quickly with the help of the command history -- but that's not the end of your laziness, right? Right!<br />
<br />
So you want to have that yellow light entity with properties 64 256 256 192 be about half as bright?<br />
<pre><br />
loop i 3 [entproperty (+ $i 1) -128]<br />
</pre><br />
and you're done.<br />
<br />
The <tt>loop</tt> will evaluate the body (the stuff inside <tt>[</tt> <tt>]</tt>) 3 times. Each iteration runs with an incremented value of <tt>i</tt>. In the first loop it is <tt>0</tt>, but since we want to modify <tt>entproperty 1</tt> to <tt>entproperty 3</tt> we need to increment it still further -- this is done inside the <tt>(</tt> and <tt>)</tt> where we use the <tt>+</tt> operator to result in the sum of <tt>i</tt> and <tt>1</tt>. So. the above line is the same as typing<br />
<br />
<pre><br />
entproperty 1 -128<br />
entproperty 2 -128<br />
entproperty 3 -128<br />
</pre><br />
<br />
In our above example the light entity would end up having the attributes <tt>64 128 128 64</tt>.</div>Adminhttp://cubeengine.com/wiki/The_ReadmeThe Readme2014-12-12T15:59:34Z<p>Admin: </p>
<hr />
<div>=Cube 2: Sauerbraten= <br />
==Links== <br />
First of all, welcome to Cube 2: Sauerbraten! To start off, if you are looking for help with the game itself, refer to the Documentation below. Here are some places of interest on the internet, which are related to Sauerbraten.<br />
* Cube and Cube 2 Engines: Start Page for the Cube Engine series.<br />
* Cube 2: Sauerbraten: The Sauerbraten FPS (First Person Shooter) Homepage.<br />
* Quadropolis: Online Cube Engine community, with user made maps, mods, and scripts.<br />
* Sauerbraten IRC Channel: Online public chat with Cube developers, supporters and fans, via the QuakeNet IRC Network.<br />
* Cube Forums: If after reading the documentation and wiki you still have any questions, you can try searching the forums. If your question isn't answered there, you can try posting to a relevant thread, or creating your own, being sure to supply a good description of your problem, and your operating system/hardware/software setup, while refraining from wild accusations.<br />
==Documentation== <br />
Cube 2: Sauerbraten is multiplayer/singleplayer FPS freeware game project, and soon an RPG game project. The sourcecode for the engine used in these games is Open Source (ZLIB licence, read the "License" section below carefully before starting ANY kind of project based on this engine).You will want to read (in roughly this order):<br />
* Game: Information on gameplay.<br />
* Config: How to run the game, configure it for your machine, and extend it with scripts.<br />
* Editing Tutorial: A guide to making maps.<br />
* Editing Reference: Map making reference.<br />
* Models: How to put models into the game.<br />
* History: For seeing latest changes.<br />
<br />
==Credits== <br />
===Programming=== <br />
* Wouter "Aardappel" van Oortmerssen: A lot of the general code, and the original concept and design. (website)<br />
* Lee "Eihrul" Salzman: ENet networking library, *nix ports, and a lot of the general code, especially rendering/lightmaps/physics related. (website).<br />
* Mike "Gilt" Dysart: General programming, especially editing/physics related.<br />
* Robert "a-baby-rabbit" Pointon: GUI and particle rendering code, MacOSX porting. (website)<br />
===Additional Code=== <br />
* Julian Mayer: Mac OS X ports.<br />
* Adrian "driAn" Henke: MD3 code.<br />
* Jerry Siebe: Geometry rendering optimisations.<br />
===Level Design=== <br />
* Kurt "kdoom" Kessler: A bunch of DM/capture maps, k_rpg1.<br />
* Shane Nieb: demomap, nmp* maps.<br />
* John "metlslime" fitzgibbons: metl* maps.<br />
* MitaMan: singleplayer episodes<br />
* With additional maps by: Aardappel, driAn, Gilt, voot, Bryan "KillHour" Shalke, staffy, sparr, JCDPC, ZappaZ, RatBoy, Fanatic, rocknrol, KaiserTodretter, BlikjeBier, wurfel, aftasardem, Lazy [HUN], Gregor Koch, Junebug, Gabriele "Blindabuser" Magurno, MeatROme, TUX, Mayhem, mIscreant, schmutzwurst, Kal, DairyKing, Hero, WahnFred, and others.<br />
===Art and Content=== <br />
* John "Geartrooper" Siar: Mr. Fixit, Ironsnout, RPG characters, monsters, new hudguns and vweps.<br />
* MakkE: Mapmodels, old hudguns, items.<br />
* Dietmar "dcp" Pier: Mapmodels, old hudguns.<br />
* DarthVim: Old hudguns.<br />
* Shane Nieb: Old hudguns, skyboxes.<br />
* Sock: The egyptian & tech texture sets (website).<br />
* Iikka "Fingers" Keranen: The ikbase ik2k texture sets (website).<br />
* Lunaran, Gibbie, Gregor Koch, Jésus "aftasardem" Maia, MitaMan, and philipk: Normalmapped texture sets.<br />
* Additional art by: metlslime (textures), Than (textures), Remedy Entertainment Ltd (textures), Seth & Ulrich Galbraith (GPL models), Brian "EvilBastard" Collins, Conrad, Magarnigal, Psionic, James Green, Andreas Möller, Ryan Butts & Jeramy Cooke (md2 models), KaiserTodretter (items), Tentus (mapmodels), Kurt Kessler (mapmodels), Philip Klevestav (textures), leileilol/OpenArena (GPL bullet hole decal).<br />
===Sounds and Music=== <br />
* Marc "Fanatic" A. Pullen: Soundtrack.<br />
===Other=== <br />
* Kristian "sleepwalkr" Duske: website / messageboard, hosting, master server.<br />
* Quinton "quin" Reeves: Community, documentation, wiki, and development help. (website).<br />
* Pushplay: Documentation help.<br />
* The SDL team: For their libraries.</div>Adminhttp://cubeengine.com/wiki/Suggested_Modelling_ToolsSuggested Modelling Tools2014-12-12T15:59:33Z<p>Admin: </p>
<hr />
<div>[http://www.blender.org Blender]<br />
A free, powerful, cross platform open source modeling suite.<br />
To export md3´s you will need Python 2.4 installed and [http://www.planetgargoyle.com/openarena/tools/blendermd3.zip these python scripts] (if link remains broken mirrored by geartrooper : [http://johnny3d.promail.ca/blendermd3.zip blendermd3.zip]).<br />
Blender´s md2 script is a bit broken unfortunately, you will need to export your md2 as an .obj from blender, import it into Misfit, export as md2,<br />
import it to q2modeller, then export it as md2 once again from there.<br />
<br />
[http://http://www.swissquake.ch/chumbalum-soft/ Milkshape3D]<br />
A low cost, simple low polygon modeller for Windows, exports md2 and md3 fine. Does not support vertex weights. Fine for everything exept characters (due to no vertex weighting animation might be hard to do).<br />
<br />
[http://makke.snieb.com/q2mdlr9b.zip Q2Modeller]<br />
Native tool to model md2s for windows. Can be emulated easily on Linux too. A bit aged by now, but can be handy to make custom vweaps from existing vweaps.<br />
Also used as a "clean up" for incorrect md2s you might encounter using other programs.<br />
<br />
[http://www.misfitcode.com/misfitmodel3d/ Misfit Model 3D]<br />
A free cross platform 3D modeling program that imports md2 and animations. Misfit supports bone animation and conversion to vertex animations. After exporting the md2 load it up and export as md2 again in q2modeller to have the proper headers for your file.</div>Adminhttp://cubeengine.com/wiki/Singleplayer_GuideSingleplayer Guide2014-12-12T15:59:33Z<p>Admin: </p>
<hr />
<div>until then look at [[Beginners Guide#introSP]] or try the [http://www.quadropolis.us/node/418 bots by quin], to play some easy DM offline.<br />
<br />
You can try finding some SinglePlayer maps (for Sauerbraten and others) in [http://quadropolis.us/taxonomy/term/12+80 this listing].<br />
<br />
The Singleplayer mode of Cube2 (Sauerbraten) has been even put up for a discussion about [http://cubeengine.com/forum.php?action=display_thread&thread_id=1965 No More SP?] .. but (for now) .. we will still have the SP modes; but further development/enrichment of it's features is not a priority, or even planned.<br />
<br />
A lot of development ''has been going on'' inside the [http://www.bloodfrontier.com/ BloodFrontier] project though.</div>Adminhttp://cubeengine.com/wiki/Sharing_ContentSharing Content2014-12-12T15:59:33Z<p>Admin: </p>
<hr />
<div>If you have created any sort of content for Sauerbraten, chances are you will want to distribute it. There are standards for this and certain procedures can help ensure your creation works well. This text covers basic cross-platform caveats and general structure of the form in which your content is best presented to your audience. Not following such guidelines can get your content flagged or even deleted, so paying attention pays off.<br />
<br />
On Quadropolis.us, you should follow [[@http://www.quadropolis.us/node/226|their packaging guide]], which shares a common root with this document.<br />
<br />
==Quick Info== <br />
As always, this is phrased in Sauerbraten terms. Your specific copy might have slightly different foldernames and/or requirements; where appropriate we will mention some of these in detail.<br />
<br />
Place your own content and the below into a ZIP-file. ZIP is essentially universal.<br />
Make sure it can be extracted directly into the player's home folder -- ''not'' their installation folder! Read up on [[FAQ#sauerbraten_home|FAQ: homeDIR]]: game-HOME-dir VS game-INSTALL-dir on the [[FAQ]].<br />
* ''./packages/base''/ = base package: folder_a_single_map.ogz<br />
# ''mapname.ogz'' (or mapname.cgz, mapname.bgz -- depending on the game)<br />
# ''mapname.cfg''<br />
# ''mapname.txt''<br />
# ''[[Map Screenshot|mapname.jpg]]'' -- this should be 256 by 256 -- which will be displayed in the GUI menu, assuming it's made menu selectable by the user or some of your own scripting.<br />
* '''''.''/'''''packages/yourname''/ = personal package folder<br />
# map/pack/misc. CFG files<br />
# texture image files<br />
# skybox-folder with appropriate images<br />
<br />
==Creating a ZIP== <br />
You should always package your content into a ZIP file. Don't just use your favorite file compressor! ZIP is the most widely available file compression and packing format, and is easily (de-)compressed on all target platforms. Even with popularity aside, ZIP often gives better compression on the already well compressed data used with Sauerbraten. Maps, for example, are already saved with ZIP compression, therefore other packers (e.g. RAR) will go to lengths to try compress the files even further, often resulting in overhead (making the file larger than the ZIP).<br />
<br />
You could ask, "Why ZIP a map at all?" But the beauty of packing your files up like this is that you can include a read-me with your file(s). Including a read-me is seen as good practice, and allows you to include licensing information (Creative Commons etc), contact information, detailed map description/information and maybe even something about yourself.<br />
<br />
But the true benefit is that users simply go to their game-HOME and unpack right into that folder -- again, this way of unpacking a ZIP is most widely available on the target platforms -- if you put (as people still often do) your installation-files into an extra subdirectory inside your ZIP people will have to go into that subfolder and move the files from there one up and then delete your subfolder... spare them this and anything like it; you'd like them all to work simple and all the same yourself!<br />
<br />
Therefore, a minimalistic distribution file would be a ZIP containing a OGZ map file and a CFG map config inside ''packages/base'' and a ''README_mapname.txt'' either inside ''packages/yourname'' or on the top-level. Be sure to have something of your own and unique in the filename, not that "someone careless" simply overwrites your ''readme.txt'' file, call it ''readme_myProject_2020apr01.txt''.<br />
<br />
You could also use *.html, but not *.pdf, *.rtf and ''especially'' not *.doc. To [http://www.catb.org/%7Eesr/faqs/smart-questions.html#asking quote] Eric Raymond: "Never, ever expect hackers to be able to read closed proprietary document formats like Microsoft Word or Excel. Most hackers react to these about as well as you would to having a pile of steaming pig manure dumped on your doorstep. Even when they can cope, they resent having to do so.")<br />
<br />
More importantly however, always package what is required, not everything used (i.e. repackaging core Sauerbraten textures used in your map is wrong, not to mention a violation their license).<br />
<br />
==Creating a Read-Me== <br />
Many people make the mistake of calling their READMEs README.txt. This results in people overwriting other people's READMEs, and the whole thing gets confusing fast. Therefore, an easy solution is to call it README_mapname.txt, where mapname should be replaced with an identifying name.<br />
<br />
===Information your README should include:=== <br />
* '''Your identification''': Self explanatory but it's up to you if you want to include your real life information or just your pseudonym in the Sauerbraten community (or both).<br />
* '''Description of content''': A title or short sentence giving (at least an indication) of what to expect. If your release is "beta" (i.e. not final) you should say so here!<br />
* '''Date or Version''': Often forgotten and always sorely missed, the date can give an indication as to which release of Sauerbraten was the design target, saving users troubleshooting time. For example even some maps in the 2006-04-26 release gave "old map format" errors, and things like this can happen in the future.<br />
<br />
===Optional information your README could include:=== <br />
* '''Background information''': Tell the story behind the map, talk about the usage of the script, give location of further documentation and/or explain your intentions/reasoning if required for your package.<br />
* '''Credits''': You should note everybody and anybody who has in some way contributed to your package enough to earn a mention here, and it is considered proper etiquette within any collaborative community. Include the source of any packages you used (include a URL) and of course don't forget all those that gave you critique on the way to finishing your package.<br />
* '''Known issues''': A list of any issues or caveats users may encounter that you are aware of (for example platform independencies).<br />
* '''Contact information''': Methods to contact you will make it possible for feedback and bug information to reach you, however this might also lead to more spam reaching your inbox.<br />
<br />
==Frequently Asked Questions== <br />
===What goes into the ZIP and what does not?=== <br />
Your ZIP should include a subdirectory structure so it can be unpacked into the main Sauerbraten directory. A simple checklist would be:<br />
* Map file (OGZ) in "packages/base/file.ogz" inside the ZIP<br />
* Map config file (CFG) in "packages/base/file.cfg"<br />
* Your package data in "packages/mydata/" (mydata usually being your pseudonym within the Sauerbraten community)<br />
* Scripts can be placed inside the root directory, the data folder or your package folder.<br />
<br />
Using third-party package data (like a skybox from Quadropolis) should only be included if:<br />
# You have written permission from the original author<br />
# You really need to be independent from possible changes on the original data<br />
<br />
If both apply, create a folder in "/packages" for holding your package data but be sure to adapt all paths (in your CFG's) to this new folder. If you don't have the author's permission, the best way to do it is to provide a download link to the required third-party package and put it into the node-description on quadropolis and inside your README. Creating two versions of your package is also a viable solution, one including the whole data set (requires author's permission!) and another with just the additions you have created (since some people might already have or even have a newer version of that third-party package!).<br />
<br />
In some cases, you will not need the author's permission, depending on the license they have used for their package, however if you do use their package, send them an email to let them know anyway. This can be useful in situations where the author is no longer active in the Sauerbraten community and is hard to get in touch with.<br />
If you do not know the license or can't contact the author you have to assume it's copyrighted and you may not use in your package!<br />
<br />
===How do I get my package into the next release of Sauerbraten?=== <br />
If your work is of a high standard and useful in the development of Sauerbraten, it will. Shouting at the developers in all capital letters will make you seem immature, and repeated requests will make you somewhat of an annoyance, reducing your chances of ever getting something into Sauerbraten. Maturity is extremely important. For more information, read eihrul's [[Map Inclusion Standards and Quadropolis|here]].<br />
<br />
===How can I ensure everybody will enjoy my work?=== <br />
Well, actually you can't, but that's just aesthetics for you! More seriously though, there are some known issues with platform dependencies with Sauerbraten. Safest bet is to package all data in (preferably) PNG for images, OGG for music and WAV for sounds.<br />
<br />
Also ensure that all filenames are lower-case! Some operating systems are case sensitive, meaning that Texture.JPG is different to texture.jpg, causing all sorts of problems with your package. This applies to all files included with the package. Don't forget to make sure that your map does not begin with a capital letter so that TAB completion works!<br />
<br />
Windows, by default, doesn't show file extensions. This can cause problems with other operating systems (as mentioned above). You can fix this by following these instructions:<br />
* Open Windows Explorer/My Computer<br />
* Click on the Tools menu<br />
* Select Folder Options<br />
* Click on the View tab<br />
* Make sure "Hide extensions for known file types" is not checked<br />
* Press OK<br />
<br />
Don't forget to rename all your package files with lowercase letters (including the extension) after changing the setting!<br />
<br />
Remove all the _DS_store stuff when zipping on a Mac, the Thumbs.db files if coming from Windows, linux usually has no such files.<br />
They can often double the size of the file since they contain un-delete data and/or imagery - they can also give attackers insight into your system - removing them is really worth finding out how.<br />
**This paragraph could be enhanced by descriptions of what to do on each system - community members: please post something on pastebin and then link to it on the talk:-page here : Thank You!'''<br />
<br />
==Common Mistakes== <br />
Many people make the same mistakes when packaging their files, over and over again. To prevent this happening to you, make sure you don't make any of the same mistakes here:<br />
* '''Including garbage with your package''': Other than including content already distributed with Sauerbraten, many users include rubbish such as thumbs.db (created by Windows when Thumbnail view is used) and CVS folders. Windows users in particular should make sure hidden and system files are set to visible so this doesn't happen (thumbs.db is invisible otherwise).<br />
* '''Giving maps extremely common names/existing names''': There are probably more than ten maps titled 'castle' on Quadropolis (for example), and this becomes a problem when they start overwriting each other. Also, don't name your new map 'metl4'.<br />
* '''Copyright violations''': Including other user's content without permission is wrong (unless of course they provide it under a license which allows that). Expanding on this, modifying existing maps and then republishing them on Quadropolis is also a copyright violation, unless you have the author's permission (highly unlikely).<br />
== == <br />
==When You're Done== <br />
If you've gotten to this point and covered all the bases above, then congratulations, but how do you go about distributing your content, you ask? The most common method is to post it on [http://www.quadropolis.us/ Quadropolis], which is the semi official site for Cube Engine related maps, mods, and other content. Be sure to register a username and read their user's guide and packaging guide before posting.<br />
<br />
Good luck creating!</div>Adminhttp://cubeengine.com/wiki/Scripting_TutorialScripting Tutorial2014-12-12T15:59:33Z<p>Admin: </p>
<hr />
<div>=Basics= <br />
<br />
==Configuration== <br />
You are already writing CubeScript when you edit your <tt>autoexec.cfg</tt>.<br />
<br />
<pre><br />
name "my name"<br />
</pre><br />
<br />
This is a primitive CubeScript block. Its parts are a ''command'' and and a ''parameter'', or an ''argument''.<br />
<br />
<tt>name</tt> will take one argument. It will then try to set your player's name to the value of the argument; restraints of the current engine build apply (such as the maximum length).<br />
<br />
==Ingame== <br />
When you've found out about more commands, via the documentation, even just having glanced at their names, will be helpful to you with coming up with some on-the-fly scripting.<br />
<br />
Learn to use the console. Try out combining calls on-the-fly. One of the first CubeScript structures useful for this can be<br />
<br />
<pre><br />
loop I N BODY<br />
<br />
// for example as in<br />
loop a 3 [ entproperty (+ $a 1) +42 ]<br />
</pre><br />
<br />
Stuff gets saved to <tt>config.cfg</tt>, you can copy snippets of useful CubeScript to some file for later use.<br />
<br />
==After a session== <br />
Regularly paste your personal scripting -- stuff you aliased on the fly that was saved to ''config.cfg'' -- into your autoexec.cfg -- that way they'll always be up-to-date once the engine fires up!<br />
<br />
And don't forget to be quick about moving ''config.cfg'' to something like ''my_config.cfg''; to compare to working backups and/or salvage scores and scripting/values from it!<br />
<br />
=Keybindings= <br />
Remember: <tt>editbind</tt> will override a <tt>bind</tt> when in edit mode.<br />
<br />
Beware of binding keys that are already bound by the default configuration -- unless you're sure you know what you're doing. Check ''data/defaults.cfg'' for this.<br />
<br />
=Aliases= <br />
You define blocks of actions by defining an alias for them.<br />
<br />
<pre><br />
//old style:<br />
alias aNAME $aVALUE<br />
//new style:<br />
aNAME = $aVALUE<br />
</pre><br />
<br />
==The modifier alias== <br />
if you look at the [[Scripting Tutorial#modifier-demo|modifier demo]] you'll see some powerful ways to control your setup. Before you do look at it you might like to understand the way it works, from the bottom up. The details of ''where'' exactly something occurs have been omitted, as this is trivial to reconstruct.<br />
<br />
<pre><br />
bind MOUSE4 [ universaldelta +1 ]<br />
bind MOUSE5 [ universaldelta -1 ]<br />
</pre><br />
<br />
<tt>universaldelta</tt> is now our handle on the scrollwheel of our mouse. This in turn gets bound to an internal <tt>modifier</tt> alias, you change this modifier by binding keys to certain settings, these in turn need to be defined as special aliases to be parsed.<br />
<br />
<pre><br />
// echo 5 or 1, depending on _RCTRL, our flag<br />
bind "O" [ if ( = $_RCTRL 1) [ echo 5 ] [ echo 1 ] ]<br />
<br />
// set the _RCTRL flag while key "right control" is being pressed, off when released.<br />
bind "RCTRL" [ _RCTRL = 1; onrelease [ _RCTRL = 0 ] ]<br />
<br />
// initialize the _RCTRL flag before ever parsing $_RCTRL<br />
// the CubeScript block for bind "O" hasn't been parsed at this point yet...<br />
// ...someone would need to press that key first<br />
"_RCTRL" = [0]<br />
</pre><br />
<br />
This code will make your right control key be a sort of x1 / x5 switch,<br />
for the 'O'-key just a simple echo,<br />
<br />
<pre><br />
bind "M" [ domodifier 128 ]<br />
<br />
delta_game_128 = [<br />
echo (concat "DG_128:" (if (= $_RCTRL 1) [echo (* 5 @arg1) ] [echo (* 1 @arg1)]))<br />
]<br />
</pre><br />
<br />
try pressing M and turning your wheel, now RCTRL+M and MW -- are you getting the hang of it?<br />
<br />
Now look at the [[Scripting Tutorial#modifier-demo|modifier demo]] and find out, why your x1 / x5 doesn't work in editmode and how you can quickly make it work.<br />
<br />
==Common errors== <br />
A common cause for errors is forgetting spaces around the equals sign in CubeScript's mathematical operations' style! In both variants the <tt>$aVALUE</tt> represents any valid CubeScript block. Examples:<br />
<br />
Want to handle a script with a simple parameter toggle?<br />
<br />
<pre><br />
my_value = 1<br />
bind N [ my_value = 5; onrelease [ my_value = 1 ] ]<br />
my_script = [ if (= $my_value 1) [ echo regular ] [ echo modified ] ]<br />
bind M [ my_script ]<br />
</pre><br />
<br />
<span id="modifier-demo"></span><br />
==Modifier demo== <br />
Want to handle a script with +X/-X input via mousewheel?<br />
<br />
<pre><br />
delta_game_42 = [echo we got $arg1 as param "(game)"]<br />
delta_edit_42 = [echo we got $arg1 as param "(edit)"]<br />
bind KP_5 = [domodifier 42]<br />
editbind KP_5 = [domodifier 42]<br />
</pre><br />
<br />
<span id="parameter-demo"></span><br />
==Parameter demo==<br />
To clarify parameter passing -- usage of a zero value or no value at all shouldn't confuse your scripts!<br />
<br />
<pre><br />
param_script = [<br />
info = ""<br />
loop p 4 [<br />
cax = (+ $p 1)<br />
can = (concatword "arg" $cax)<br />
cav = (getalias $can)<br />
if (= $cav 0) [ cav = "(null)" ]<br />
info = (concat $info " " (concatword $cax ":") $cav)<br />
]<br />
// echo "1:" $arg1 "2:" $arg2 "3:" $arg3<br />
if (= $arg1 1) [<br />
echo "yes :" $info<br />
] [<br />
echo "no :" $info<br />
]<br />
]<br />
<br />
param_script 0 1 2 3<br />
param_script 1<br />
param_script 4 3 2 1<br />
param_script<br />
</pre><br />
<br />
<br />
=Triggering Action= <br />
<br />
For SP maps you can have trigger entities do scripting commands whenever the player touches the entity.<br />
<br />
The basic concept is to create aliases like<br />
<br />
<pre><br />
level_trigger_123 = [ echo "You triggered #123" ]<br />
</pre><br />
<br />
This would be executed when the player crosses the space of any trigger-entity with first param 123.<br />
<br />
<span id="trigger101"></span><br />
==Triggers== <br />
Sauerbraten can trigger special [[Scripting Guide|scripting]] for you, when an SP player crosses the space of one of your trigger entities. Note that triggers only work in SP mode!<br />
<br />
Historical development associates a carrot model with triggers, but any mapmodel can be used (or none at all).<br />
<br />
Each trigger has it's index -- <tt>entproperty 0</tt>. You may have multiple entities with the same index though.<br />
<br />
Triggering another trigger will ''not'' always do exactly what you want ATM, development toward that angle is under way!<br />
<br />
See this: [http://cubeengine.com/w/files/MapTriggerTest.zip MapTriggerTest.zip] [6.7K] '' A map and its CFG.'' to learn how to implement a basic secret's counter. There is also a secret's counter in "Episode 1" and other maps contain other scripting that you might like to use. You should also check out stuff you liked in somebody else's map and in their CFG to work out how they did it. To see how to trigger doors look at the map "door_demo" included with sauerbraten.</div>Adminhttp://cubeengine.com/wiki/Scripting_SyntaxScripting Syntax2014-12-12T15:59:32Z<p>Admin: </p>
<hr />
<div>==The basic command structure== <br />
Commands consist of the command itself, followed by any number of arguments separated by white space. You can use <tt>""</tt> to quote strings with white space in them (such as the actions in bind/alias), and wherever a command is required you can also use <tt>;</tt> to sequence multiple commands in one.<br />
<br />
You can evaluate aliases and expressions. You can substitute the value of an alias as an argument by prefixing it with a "<tt>$</tt>" sign, i.e.:<br />
<pre><br />
echo "The current value of x is $x"<br />
</pre><br />
You can even substitute the values of console variables this way, i.e <tt>$fov</tt> gives the current FOV value. Some values though will not be returned in this way, noteably <tt>name</tt> and <tt>team</tt>. A solution for this is to work with buffer aliases to later access the value when needed. Some aliases are set automatically, for example $arg1 to $argN are set if you supply arguments when you execute an alias. But beware, these should not be tested for emptiness since they may contain values of preceding calls of other aliases!<br />
<br />
There are two alternatives to <tt>""</tt> for quoting a string: <tt>()</tt> and <tt>[]</tt>. They work in the same way as <tt>""</tt>, with the difference that they can be nested infinitely, and that they may contain line feeds (useful for larger scripts). <tt>()</tt> is different from <tt>[]</tt> in that it evaluates the commands contained in it ''before'' it evaluates the surrounding command, and substitutes the results. <tt>()</tt> bracketed strings are called expressions, and <tt>[]</tt> bracketed strings may be thought of as blocks.<br />
<br />
An alternative to <tt>$x</tt> is <tt>@x</tt>, which uses an alias as a macro. The difference is that <tt>@x</tt> can be subtituted inside <tt>[]</tt> or <tt>()</tt> forms before they have ever been evaluated (at parse time), which makes them useful for composing strings or creating code on the fly. The <tt>@x</tt> form will be substituted using the value of <tt>x</tt> at the time the enclosing <tt>[]</tt> is evaluated. You can add more <tt>@</tt> prefixes to move up more levels of <tt>[]s</tt>, so <tt>@@x</tt> will move up two levels of <tt>[]s</tt> and so on. Example:<br />
<pre><br />
x = 0; if $cond [x = 1; [x = 2; echo @@x]]<br />
</pre><br />
will echo 0, since it uses the value of <tt>x</tt> at two levels up.<br />
<br />
The form <tt>@(body)</tt> is similar to <tt>@x</tt>, except that body contains commands executed at parse time. The result value after body executes is substituted in for <tt>@(body)</tt>. You may use multiple <tt>@</tt> prefixes as with the <tt>@x</tt> form. Example:<br />
<pre><br />
@(result "Hello, World!")<br />
</pre><br />
will substitute itself with ''Hello, World!''<br />
<br />
An overview of especially useful commands can be found on the [[Scripting Commands]] page.<br />
The possibilities of flow control for CubeScript are listed on the [[Scripting Flow Control]] page.</div>Adminhttp://cubeengine.com/wiki/Scripting_MenusScripting Menus2014-12-12T15:59:32Z<p>Admin: </p>
<hr />
<div>==Menu configuration and personalization==<br />
The games menus are completely organized in data/menus.cfg.<br />
Providing yourself with a backup of a working copy - you can edit it to fit your needs.<br />
<br />
If you think that is too much of a hassle, <br />
then there are several menu translations and ScriptPAKs that further modify your menu on [http://www.quadropolis.us/flexinode/list/2 quadropolis scripts].<br />
<br />
Caution : The water-edition (2006-09-12) is the last to use the ''2D style menus'',<br />
the gui-edition (2006-12-04) is the first to use the ''3D style menus''.<br />
Be sure to check your local documentation ... code here is for the new GUI-style only!<br />
<br />
----<br />
<br />
The respective commands for menu construction are:<br />
<br />
<pre><br />
newgui S<br />
</pre><br />
Creates a new menu with name N. All following menuitem/gui* commands will apply to this menu<br />
<br />
<pre><br />
// for 3D style check documentation - multiple types available : radio, button, slider, image, text, ...<br />
// as an example of a simple menu :<br />
newgui about [<br />
guitext "Sauerbraten engine"<br />
guitext "by Wouter van Oortmerssen"<br />
guitext "with contributions from Eihrul, Gilt and others"<br />
guitext "(for a full list of contributors see the readme)"<br />
guitext "http://sauerbraten.org/"<br />
]<br />
</pre><br />
See data/menus.cfg for further examples. If the block starts with the special character "^", then this will be evaluated as a command when being displayed. This allows you to create menu items that depend on changing gamestate. Also usable for dynamic stuff (as seen in menus.cfg) is the <tt>getalias</tt> command. For a really dynamic usage of the GUI menus check-out [http://www.quadropolis.us/node/435 QCSP - the 'Q' CubeScript PAK].<br />
<br />
<pre><br />
// 3D style<br />
showgui N<br />
// error in documentation :<br />
showgui servers<br />
// not "showservermenu" as the docs still say from 2D times :-P<br />
</pre><br />
Displays the menu with name N previously defined, and allows the user to pick an item with the mouse cursor. Upon clicking the highlighted item, the associated action will be executed. Pressing ESC will cancel the menu.<br />
<br />
----<br />
<br />
To show you how easy things can be done : some examples<br />
<br />
* [[Script Demo - Map Menu|how-to add my own favourite maps to the menu]]<br />
<br />
* sure you can switch your team by menu,<br />
but what about more options? What about switching between complete identities?<br />
[[Script Demo - Persona Menu|a persona switcher via menu]]<br />
<br />
* An even less elaborate example,<br />
If you're annoyed at "e" toggling editmode just about every time you get hectic during a game ...<br />
... then try out something like this :<br />
[[Script Demo - Keyboard Switch|keyboard layout switcher]]</div>Adminhttp://cubeengine.com/wiki/Scripting_GuideScripting Guide2014-12-12T15:59:32Z<p>Admin: </p>
<hr />
<div>=Introduction= <br />
Your local documentation (''README.html'') holds all the commands you can use. It is probably the best reference for the release you're using.<br />
<br />
With scripting you can achieve a more personalized Sauerbraten experience. In most cases some simple copy/paste will do the trick. But this guide aims at showing some easy techniques to empower gamers and mappers alike.<br />
<br />
Any files you find in your game directory (and sub-directories) ending in .cfg contain CubeScript. Check them out to see what the engine already does via scripting... and how!<br />
<br />
=CubeScript Topics= <br />
==Documentation Revisited== <br />
The basic command structures of CubeScript are explained on the [[Scripting Syntax]] page. Some introductory words on selected commands can be found on this [[Scripting Commands]] summary. For programming you should be aware of the [[Scripting Flow Control|flow control possibilities]].<br />
<br />
==Getting Started== <br />
Do your first steps with:<br />
* [[Using the Console]]<br />
* [[Scripting Tutorial]]<br />
* [[CubeScript Tutorial]]<br />
* [http://rknigh21.110mb.com/cubescript_1.html rknigh21's CubeScript Tutorial]<br />
<br />
==Map Configuration== <br />
Scripting for maps is explained on the [[Map Config and Scripting]].<br />
<br />
==Menu Personalization== <br />
Scripting for menus is explained on the [[Scripting Menus]].<br />
<br />
=CubeScript 101= <br />
==What happens at startup== <br />
Following files get executed:<br />
<pre><br />
if config.cfg doesn't exist:<br />
only then do we execute data/defaults.cfg<br />
this will - at regular quit of engine -<br />
be written into config.cfg<br />
<br />
if config.cfg exists:<br />
execute it<br />
<br />
execute data/menus.cfg<br />
<br />
if autoexec.cfg exists:<br />
execute it<br />
</pre><br />
<br />
==What happens on map load== <br />
<pre><br />
data/default_map_settings.cfg is executed<br />
if they exist<br />
packages/ ..PATH-to-package.cfg is executed<br />
packages/ ..PATH-to-Map.cfg is executed<br />
</pre><br />
<br />
==What can I do with scripting myself?== <br />
Whatever you can describe as a combination of CubeScript blocks.<br />
<br />
==<tt>autoexec.cfg</tt> and <tt>config.cfg</tt>== <br />
The engine automatically saves your [[configuration]] in <tt>config.cfg</tt>. To automatically run scripting on engine start you need only place them in <tt>autoexec.cfg</tt>.<br />
<br />
==The scripting newbie== <br />
To find out about what you can do, you'll need to know your way around the documentation at least; anything you can break down into single CubeScript commands can be made into a CubeScript Block and thus speed up your everyday use of the engine.<br />
<br />
Without being a programmer you might find a lot of this stuff too complicated for your taste, but do not despair! There are some examples on these pages to help you achieve a lot of goals and there are also quite a few scripts ready for download on [http://www.quadropolis.us quadropolis].<br />
<br />
But if you really want to get the most out of the engine it is suggested that you at least try getting familiar with some basics of the scripting capabilities! Try reading the page on [[Scripting Tutorial]] to see what fundamental know-how this is and how easy it is. Always referr to your local documentation to find basic CubeScript commands and how to use them, anything you want to be executed in sequence can be put inside a CubeScript block - like so:<br />
<pre><br />
// The fullscreen command only works on Linux, OS X, and other UNIX systems.<br />
doARecalc = [<br />
fullbright 0<br />
fullscreen 0<br />
calclight 2<br />
savemap<br />
fullscreen 1<br />
]<br />
</pre><br />
You can then execute this block simply by calling <tt>doARecalc</tt> ... for example via the console, or from other CubeScript blocks. Another example of a minimal CubeScript to handle a repetitive task: [[Scripting Commands#prettyscreenshot]] or from Quadropolis: [http://www.quadropolis.us/node/276 Pretty Screenshot]</div>Adminhttp://cubeengine.com/wiki/Scripting_Flow_ControlScripting Flow Control2014-12-12T15:59:31Z<p>Admin: </p>
<hr />
<div>=CubeScript control flow=<br />
<br />
Any more complex scripting than simply binding static commands to keys or defining the most simple of menus will require your script to change it's runtime behaviour in response to the state of the game. This is called ''control flow'', the classic possibilities available in most languages also exist in CubeScript.<br />
<br />
==mathematical operations==<br />
<pre><br />
+ A B<br />
- A B<br />
* A B<br />
div A B<br />
mod A B<br />
</pre><br />
(add, substract, multiply, divide, modulo): these all work like the integer operators from other languages. Example:<br />
<pre><br />
echo x squared is (* $x $x)<br />
</pre><br />
<br />
==value comparison==<br />
<pre><br />
= A B<br />
< A B<br />
> A B<br />
strcmp A B<br />
</pre><br />
(equals, lessthan, greaterthan, stringcompare): comparison operators that return 1 for true and 0 for false.<br />
<br />
==value passing==<br />
<pre><br />
result V<br />
</pre><br />
Normally the result of a [] block is the result of the last command in the block. If you want the result to be a particular variable or value, you can use e.g. "result $i" etc.<br />
<br />
==forks in execution==<br />
<pre><br />
if cond true false<br />
</pre><br />
executes the true or false part depending on wether cond is "0" or something else. Example:<br />
<pre><br />
if (< $x 10) [ echo "x is" $x ] [ echo "x is too big" ]<br />
</pre><br />
==repetition==<br />
<pre><br />
loop I N body<br />
</pre><br />
evaluates body N times, and sets the alias I from 0 to N-1 for every iteration. Example:<br />
<pre><br />
loop i 10 [ echo $i ]<br />
</pre><br />
<br />
<pre><br />
while cond body<br />
</pre><br />
evaluates body while cond evaluates to true. Note that cond here has to have [], otherwise it would only be evaluated once.<br />
Example (same result as the "loop" example):<br />
<pre><br />
i = 0; while [ (< $i 10) ] [ echo $i; i = (+ $i 1) ]<br />
</pre><br />
==string manipulation==<br />
<pre><br />
concat S...<br />
</pre><br />
concatenates all the arguments and returns the result<br />
<br />
<pre><br />
concatword S...<br />
</pre><br />
same as concat but without spaces between the elements.<br />
<br />
<pre><br />
format F V1..Vn<br />
</pre><br />
substitutes the V values into the format string F and returns the result. The format strings %1 through %9 are substituted with V1 through V9, respectively, and may be used multiple times. %% will generate a single % character. Example:<br />
<pre><br />
format "%1 bottles of %2 on the %3, %1 bottles of %2!" 99 beer wall<br />
</pre><br />
<br />
<pre><br />
at S N<br />
</pre><br />
grabs the Nth word out of string S and returns the result<br />
<br />
<pre><br />
listlen L<br />
</pre><br />
returns the number of items in the list L<br />
<br />
==game state specifics==<br />
<pre><br />
onrelease A<br />
</pre><br />
only executes A if the command is executed on the release of a key/button (must be in an action in a bind or an alias in a bind).<br />
<br />
<pre><br />
paused B<br />
</pre><br />
wether the game is paused or not (default 0, default key F1 toggles).<br />
<br />
<pre><br />
$editing<br />
</pre><br />
true when in edit mode</div>Adminhttp://cubeengine.com/wiki/Scripting_CommandsScripting Commands2014-12-12T15:59:31Z<p>Admin: </p>
<hr />
<div>=Command Reference= <br />
<br />
The following is an excerpt of commands available to you for scripting,<br />
refer to your local documentation to find out all commands available.<br />
On this page you will find commands and examples of usage to help get you into CubeScript.<br />
Almost all commands can be used in scripting, although a map-cfg cannot override persitent values - including among others <tt>watersubdiv</tt>, <tt>waterlod</tt>, <tt>maxparticledistance</tt> and <tt>fov</tt> among others.<br />
You can't override them in a map-cfg - a message will be output to your console in such cases -<br />
you can only set them manually. It counts as a manual setting if used via the menu!<br />
<br />
<pre><br />
exec C<br />
</pre><br />
Executes all commands in config file C.<br />
<br />
<pre><br />
history N<br />
</pre><br />
Executes the Nth command in the command line history. For example, binding "history 0" to a key allows you to quickly repeat the last command typed in (useful for placing many identical entities etc.)<br />
<br />
<pre><br />
saycommand P...<br />
</pre><br />
This puts a prompt on screen where you can type stuff into, which will capture all keystrokes until you press return (or esc to cancel). You may press tab to autocomplete commands/aliases/variables, and up/down keys to browse the command history. If what you typed started with a "/", the rest of it will be executed as a command, otherwise its something you "say" to all players. default key = T for talk, ` for commands. If P is prefix to insert to the buffer, (default key ` inserts a /).<br />
<br />
The following example will prepare one of three messages to be output via <tt>say</tt>, but don't be fooled, you can execute anything else besides <tt>say</tt> with this too.<br />
It binds the key '''K''' to prepare the command onto the console upon release of the key.<br />
You will only see a beautified display - for example : ''GREET #2''<br />
But if you confirm the command, it will execute the prepared '''saycommand'''.<br />
<pre><br />
// ----------------<br />
// greetings :<br />
// ----------------<br />
<br />
GMSG0 = "Hi! Let's Get It On!"<br />
GMSG1 = "Hello! Get Ready To Be Cubed"<br />
GMSG2 = "Hi There! Let's Fight Some..."<br />
<br />
// change MAXC if you add/remove greetings above<br />
GMSG_MAXC = 2<br />
// the first index to use (default : 0)<br />
GMSGCOUNT = 0<br />
<br />
// ----------------<br />
// beautification :<br />
// ----------------<br />
<br />
CCOL = ":^L0"<br />
// JAT : sic! ::<br />
JAT = " "<br />
// :: JAT : sic!<br />
J4U = (concatword $JAT ";")<br />
<br />
// ----------------<br />
// functionality :<br />
// ----------------<br />
<br />
// bogus alias, to allow for pretty command call<br />
GREET = []<br />
<br />
greeting = [<br />
GMSGCOUNT = (+ $GMSGCOUNT 1)<br />
if (> $GMSGCOUNT $GMSG_MAXC) [GMSGCOUNT = 0]<br />
CIN = (concatword "#" $GMSGCOUNT)<br />
CVN = (concatword "$" GMSG $GMSGCOUNT)<br />
// this is what to output - it will look pretty<br />
// and even ignores any surplus hitting of keys by the user ;)<br />
CSC = (concat GREET $CCOL $CIN $J4U say @$CVN ";foo = bar")<br />
onrelease [saycommand [/@@CSC]]<br />
]<br />
<br />
bind K [greeting]<br />
</pre><br />
<br />
<pre><br />
weapon a b c<br />
</pre><br />
Tries to select weapons a, b & c, in that order, if they have ammo ( 0 <nowiki>=`` fist, 1 ``=`` sg, 2 ``=`` cg, 3 ``=`` rl, 4 ``=`` rifle, 5 ``=</nowiki> gl ). If none of the 3 indicated have any ammo, it will try the remaining weapons for one with ammo (in order 3/2/1/4/0) (the fist needs no ammo). You can use the weapon command with 0 to 3 arguments. examples:<br />
<br />
<pre><br />
// close up selection :<br />
weapon 2 1 0<br />
<br />
// far away selection :<br />
weapon 4 3 2<br />
<br />
// medium distance selection :<br />
weapon 3 2 1<br />
<br />
// humiliate selection :)<br />
weapon 0<br />
<br />
// just switch to anything with ammo :<br />
weapon<br />
</pre><br />
<br />
In any selection, it will skip whichever weapon you have currently selected, so executing a weapon command repeatedly toggles between the two best weapons with ammo within a given selection. default keys 0 to 4 select the corresponding weapons, with sensible default alternatives, middle mouse button is a simple weapon switch.<br />
<br />
<pre><br />
alias N A<br />
N = A<br />
</pre><br />
Binds name N to commands A, after which you can use N as a shortcut for A. You may re-bind N as often as you like, call it recursively etc. You may use N = A as a shortcut for alias.<br />
<br />
<pre><br />
forward<br />
backward<br />
left<br />
right<br />
</pre><br />
Move you in said direction (defaults to cursor keys).<br />
<br />
<pre><br />
attack<br />
</pre><br />
Fires the current weapon. default = left mouse<br />
<br />
<pre><br />
jump<br />
</pre><br />
Triggers a jump. default key space & right mouse.<br />
<br />
<pre><br />
fov N<br />
</pre><br />
Sets your FOV to 10..150.<br />
<br />
<pre><br />
setfullscreenshader Name<br />
</pre><br />
Sets your favourite fullscreen shader. Active permanently once set. Use without name argument to turn it off. Current example shaders: invert, gbr, sobel, bloom<br />
<br />
<pre><br />
screenshot<br />
</pre><br />
Writes out "screenshotN.bmp", where N is the number of milliseconds since cube was launched (default key = F12).<br />
A little modified example :<br />
<span id="prettyscreenshot"></span><br />
<pre><br />
// do a pretty screenshot (hiding HUD and all)<br />
MPscreenshot = [<br />
phh = $hidehud<br />
phs = $hidestats<br />
phg = $hudgun<br />
hudgun 0<br />
hidestats 1<br />
hidehud 1<br />
sleep 2 screenshot<br />
sleep 3 [hudgun $phg; hidestats $phs; hidehud $phh;echo SCREENSHOT made]<br />
]<br />
</pre><br />
<br />
<br />
<pre><br />
hidehud b<br />
</pre><br />
Turns on/off the entire hud display, which includes rendering stats, ammo, and echoed text. (default = 0)<br />
<br />
<pre><br />
crosshairsize n<br />
</pre><br />
Sets the size of your crosshair, 0 being off (default = 3)<br />
<br />
<pre><br />
keymap K N A<br />
<br />
// for players using a german keyboard the following keymappings can be added to data/keymap.cfg<br />
keymap 223 SZ<br />
keymap 252 UE<br />
keymap 246 OE<br />
keymap 228 AE<br />
</pre><br />
<br />
Sets up the keymap for key code K with name N and default action A. You should never have to use this command manually, use "bind" instead. But in case you do need it (to make use of previously un-bind-able keys (like above)) take a look at [[Configuration Hints#toc4|Internationalization]]<br />
<br />
<pre><br />
// for people uncomfortable with using "BACKQUOTE":<br />
bind CARET [saycommand /]<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Script_Demo_-_Persona_MenuScript Demo - Persona Menu2014-12-12T15:59:31Z<p>Admin: </p>
<hr />
<div>open menus.cfg and look for a line reading<br />
<pre><br />
newgui main<br />
</pre><br />
<br />
this is where it all begins!<br />
<br />
Then locate the line defining the quit menuitem<br />
<pre><br />
guibutton "quit"<br />
</pre><br />
and place a new line above it :<br />
<pre><br />
guibutton "Persona" "showmgui mypersona"<br />
</pre><br />
<br />
then move to the end of the file and enter some lines to define this menu to be shown :<br />
<pre><br />
bteam = "GWAR"<br />
pnlist = "Mutilator _ Anihalator _ InH4L3 BRTH ExH4L3 BRTH Frodo RING Mithrandir RING Batou PP#9 Ichikawa PP#9 Morgoth _ Spawn634 _"<br />
<br />
genpersonas = [<br />
loop i (div (listlen $arg1) 2) [<br />
j = (* $i 2)<br />
k = (+ $j 1)<br />
pn = (at $arg1 $j)<br />
pt = (at $arg1 $k)<br />
ct = $bteam<br />
if (strcmp $pt "_") [] [ct = $pt]<br />
mi = (concat "name" (concatword $pn ";team") $ct)<br />
guibutton $pn $mi<br />
]<br />
<br />
newgui mypersona [<br />
genpersonas $pnlist<br />
]<br />
</pre><br />
<br />
The whole thing works by taking always two elements from the list, the second being interpreted as team, if it isn't an underscore. The first will be your new name, this is displayed in the menu. The team will default (in case of an underscore) to what bteam is set to.</div>Adminhttp://cubeengine.com/wiki/Script_Demo_-_Map_MenuScript Demo - Map Menu2014-12-12T15:59:30Z<p>Admin: </p>
<hr />
<div>When using the <tt>complete</tt> function of the <br />
* <tt>map</tt>, <br />
* <tt>sp</tt>, <br />
* <tt>dmsp</tt>, <br />
* <tt>ffa</tt>, <br />
* <tt>insta</tt> and <br />
* <tt>capture</tt> <br />
aliases you always use an up-to-date list of maps (=*.ogz files).<br />
This means they will auto-complete even your ''just saved'' mapname.<br />
The console uses TAB-completion for all commands and aliases, the <tt>complete</tt> command gives you TAB-completion on the first argument as files of the configured extension - ogz's in packages/base for the aforementioned aliases.<br />
<br />
The menus ''do not auto-update'' themselves;<br />
these lists are editorial only - meaning they are a selection made by a human.<br />
You can easily add your favourite creations, downloads and coop-edit maps by adding them to the map name lists in <tt>data/menus.cfg</tt>.<br />
<br />
Look for the line reading<br />
<pre><br />
newgui maps<br />
</pre><br />
<br />
insert after the line with <tt>rpgmaps = "</tt> (line 49 in 2006-12-04 release)<br />
<pre><br />
personalmaps = "my_personal_favourite_map_nr_1 my_personal_favourite_map_nr_2 my_personal_favourite_map_nr_3"<br />
</pre><br />
and inside the <tt>newgui maps</tt> block<br />
<pre><br />
guitab personal<br />
guilist [<br />
guilist [ genmapitems $personalmaps ]<br />
showmapshot<br />
]<br />
</pre><br />
<br />
The whole block should look (something) like this<br />
<pre><br />
newgui maps [<br />
guilist [<br />
guilist [<br />
genmapitems $mainmaps<br />
guibutton "thor" "map thor" "map"<br />
]<br />
showmapshot<br />
]<br />
guitab more<br />
guilist [<br />
guilist [ genmapitems $moremaps1 ]<br />
guilist [ genmapitems $moremaps2 ]<br />
showmapshot<br />
]<br />
// my personal maps here ::<br />
guitab personal<br />
guilist [<br />
guilist [ genmapitems $personalmaps ]<br />
showmapshot<br />
]<br />
// :: my personal maps here<br />
guitab old<br />
guilist [<br />
guilist [ genmapitems $oldmaps ]<br />
showmapshot<br />
]<br />
guitab capture<br />
guilist [<br />
guilist [ genmapitems $capturemaps ]<br />
showmapshot<br />
]<br />
guitab rpg_test<br />
guilist [<br />
guilist [ genmapitems $rpgmaps ]<br />
showmapshot<br />
]<br />
]<br />
</pre><br />
<br />
Assuming the maps you entered truely exist in packages/base your menu modification will work.</div>Adminhttp://cubeengine.com/wiki/Script_Demo_-_Keyboard_SwitchScript Demo - Keyboard Switch2014-12-12T15:59:30Z<p>Admin: </p>
<hr />
<div>in autoexec.cfg (create in base game dir if it doesn't exist):<br />
<pre><br />
bind e []<br />
</pre><br />
to disable edittoggle at game engine start.<br />
then modify data/menus.cfg:<br />
<pre><br />
newgui keyswitcher [<br />
guibutton "normal" [exec gamekeys.cfg]<br />
guibutton "editor" [exec editkeys.cfg]<br />
]<br />
</pre><br />
Do not forget to add a "showgui"-line for your new menu too (in data/menus.cfg, e.g. in the main menu).<br />
Then all you have to do is copy data/defaults.cfg to gamekeys.cfg and editkeys.cfg (in base folder), remove all non-keybind lines<br />
and then edit them to match your needs.<br />
Remember to keep the edittoggle bind for editkeys.cfg and in gamekeys.cfg to bind to an empty string (like in autoexec.cfg above).</div>Adminhttp://cubeengine.com/wiki/Performance_GuidePerformance Guide2014-12-12T15:59:30Z<p>Admin: </p>
<hr />
<div>A key part of a good gaming experience is performance. You want the most framerates you get out of a game. It can improve it's quality by several magnitudes<br />
<br />
=Steps to Increasing Performance= <br />
Things you can change that either affect your performance or your visual quality, in order of importance:<br />
<br />
==Player Models== <br />
If you are using an Intel GMA chipset, then certain player models will be much faster to render than others. Use the "Ogro" player model, which can be selected in the ''options'' menu, or you may choose him from the Sauerbraten console by typing <tt>/playermodel 2</tt>.<br />
<br />
Also, if you are using an Intel GMA chipset, turn off stencil shadows by going to the ''options'' menu, then under the ''gfx'' tab make sure the ''stencil shadows'' option is off. You may alternatively shut these off from the Sauerbraten console by typing ''/dynshadow 0''.<br />
<br />
==Resolution== <br />
Your resolution has the largest effect on performance. Change it in the ''options'' menu under the ''res'' tab, or force it explicitly on the command-line with ''sauerbraten.bat'' (Windows) or ''sauerbraten_unix'' (Linux/BSD/etc) in the base game folder (the <tt>-w</tt> and <tt>-h</tt> options, try <tt>-w640 -h480</tt> for example). If you have an extremely low framerate, lowering the resolution will have immediate effects.<br />
<br />
==Video RAM== <br />
If you are using an older video card with 64 MB or less of video RAM (skip this section if you have more), then before you do anything else, first try enabling S3 texture compression (if your 3D card supports it) with the console command <tt>/texcompress 128</tt>. However, if your card does not support S3 texture compression, then add the following line to your ''autoexec.cfg'' file: <tt>maxtexsize 128</tt><br />
<br />
Texture compression should be tried first. However, if that fails, the <tt>maxtexsize</tt> variable will limit the size of textures to be no larger than 128 by 128, scaling them down if necessary. Either one will use much less video RAM. If a map uses more textures space than you have available video RAM, then you will notice huge slowdowns.<br />
<br />
==Shaders== <br />
Unless you have the latest and greatest card, shaders will hurt your framerate. Turn them off either by going to the ''options'' menu and under the ''gfx'' tab ensuring the ''shaders'' checkbox is off, or by adding the flag ''-f0'' to your command line.<br />
<br />
Note that if your card doesn't support them, they will be turned off automatically already. You can also selectively turn off some shaders by making sure the ''low detail'' option is checked next to the ''shaders'' option in the menus described above, or by setting the ''shaderdetail'' console variable with values 0 through 3 (i.e. ''/shaderdetail 1''), with lower values meaning fewer fancy visual effects. Using a low ''shaderdetail'' value can make shaders perform quite well on low end cards.<br />
<br />
==Antialiasing== <br />
While <tt>-a4</tt> (on the command line, may also be modified by graphics drivers) will look fantastic, especially at the lower resolutions, for max performance it should be left at the default (<tt>-a0</tt>).<br />
<br />
==Fullscreen Shaders== <br />
Do not turn full screen shaders like bloom on (in the menu) unless you have one of the latest cards.<br />
<br />
==VSync== <br />
Turn off vertical sync (in your graphics driver options) for slightly less hiccup in framerate (at the cost of potential visual tearing).<br />
<br />
==Color Depth== <br />
Changing to <tt>-b16</tt> (16 bits per pixel) can give you quite a performance boost (but mainly only on older hardware). If you use ''-b16'', be sure to use ''-z24'' too (a 24 bit depth buffer won't hurt your performance, but setting it to 16 will lead to bad visuals, flickering lines, sparks, and possibly even compromised depth perception which is noticable when trying to shoot). Most graphics card automatically change to 16 bit depth buffering when using 16 bit colour depth, so make sure you use ''-z24'' to prevent this.<br />
<br />
==Water== <br />
If water shaders are slowing you down, go to the ''options'' menu and then under the ''gfx'' tab try turning off the ''reflection'' and ''refraction'' checkboxes in the ''water'' options. You may also toggle these off from the console with <tt>/waterreflect 0</tt> and <tt>/waterrefract 0</tt>.</div>Adminhttp://cubeengine.com/wiki/Multiplayer_GuideMultiplayer Guide2014-12-12T15:59:29Z<p>Admin: </p>
<hr />
<div>=Introduction= <br />
Before you start to play online you should have taken some time to setup your game.<br />
<br />
==Settings== <br />
Apart from having appropriate graphics settings for your computer -- to maximize the games speed while balancing visuals -- refer to the [[Performance Guide]] for this -- you should also have a unique name so that others can recognize you.<br />
<br />
<span id="OER"></span><span id="etiquette"></span><br />
==Ogros' Etiquette Reference== <br />
The ogros have an evolutionary history, a society -- hence some etiquette:<br />
* End-of-match: the traditional shorthand gg can mean anything from good game to gross gore. Say it, it's traditional!<br />
* Team killing: When joined up into teams, it's considered polite to mumble "tk" after TKing as soon as the situation permits.<br />
* Voting: if a vote was called, but you prefer playing as is, say so too! If you are master talk to players about which maps they'd like to play!<br />
* Kick/ban/locked/mastermode: masters shouldn't abuse their powers, players shouldn't nag masters -- just accept it if a master allows you as a spectator only!<br />
* Join/disconnect: it would be polite to annouce yourself on join with at least saying "hi", and "bye" before leaving.<br />
<br />
==Finding a Game== <br />
Go to the multiplayer menu, and ''update from the master server''. You will then see the current online games.<br />
<br />
The server browser displays enough basic information about a respective game to help you choose the right server for yourself. Take note of indicators for private and locked mastermodes (where it shows "P" or "L" next to number of players).<br />
<br />
=Game Modes= <br />
The game runs in a range of different modes. Internally they are mapped to the indexes [-2 .. 0 .. 13], with modes less than zero being the [[Singleplayer Guide|Singleplayer]] modes. The modes all have their own little special flavor, so you have -- in theory -- 16 different games instead of just one -- though technically, 15 games and a cooperative editing mode. The Trooper Edition (March 5, 2009) has brought some new ones.<br />
<br />
The current multiplayer modes are 0-13, with the special <tt>mode 1</tt> - for coop-edit.<br />
Singleplayer modes all have a negative index - also don't forget your aliases (like <tt>sp</tt>, <tt>ffa</tt>, <tt>insta</tt>, ...)<br />
<br />
<br />
For completeness we'll list the SinglePlayer modes here too, which of course aren't available during a multiplayer game.<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| <br />
| name <br />
| description <br />
|-<br />
| -5 <br />
| SlowMo-SP <br />
| slow-motion singleplayer -- speed changes according to your health <br />
|-<br />
| -4 <br />
| SlowMo-DMSP <br />
| slow-motion singleplayer deathmatch -- speed changes according to your health <br />
|-<br />
| -3 <br />
| DemoPlayback <br />
| this mode is used to playback demos -- see [[Demo Recording]] <br />
|-<br />
| -2 <br />
| SP <br />
| basic singleplayer <br />
|-<br />
| -1 <br />
| DMSP <br />
| singleplayer deathmatch <br />
|}<br />
<br />
Of course all (legal) modes are available via the voting menu.<br />
<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| <br />
| name <br />
| description <br />
|-<br />
| 0 <br />
| ffa <br />
| Your basic FPS-game mode. With items spawning, respawning, and players just fragging away. FFA stands for free-for-all. <br />
|-<br />
| 1 <br />
| coopedit <br />
| Cooperative editing in-game, for more information on this mode, refer to the [[Cooperative Editing]] <br />
|-<br />
| 2 <br />
| ffa/duel <br />
| same as ffa/default <br />
|-<br />
| 3 <br />
| teamplay <br />
| basic teamplay mode <br />
|-<br />
| 4 <br />
| instagib <br />
| Your classic 1-shot-1-kill type of game, no items spawn in this mode - it's just movement and aiming that can keep you alive longer than your enemy. Players respawn right away after being fragged. Your only weapons are a rifle with 100 shots, and your fist - which does for quick frags when up close to your enemy, since it's "rate of fire" is more rapid. <br />
|-<br />
| 5 <br />
| instagib-team <br />
| teamplay instagib. <br />
|-<br />
| 6 <br />
| efficiency <br />
| You spawn with a random subset of ammunition, thus giving you a temporary assignment (especially in team mode) or simply forcing a certain tactical approach on you. Players respawn right away after being fragged. <br />
|-<br />
| 7 <br />
| efficiency team <br />
| teamplay efficiency. <br />
|-<br />
| 8 <br />
| capture <br />
| This is a completely different approach to your regular capture: For starters, frags are not counted at all. The goal is to keep certain bases under your control for as long as possible. Your team is continously awarded points for each base it has currently captured - the more bases you hold for a longer time the more your teams score will increase. If your team manages to capture all bases on the map the match is ended, otherwise it ends after the 15 minute timelimit. When you have been fragged you will stay in limbo for 10 seconds before attempting to spawn next to one of your teams bases, preferrably the one closest to your enemies. This mode is akin to the Domination mode found in Unreal Tournament. <br />
|-<br />
| 9 <br />
| instacapture <br />
| capture with instagib <br />
|-<br />
| 10 <br />
| regencapture <br />
| like capture but without a respawn timer and the bases you own regenerate your health, armour and ammo when you stand close <br />
|-<br />
| 11 <br />
| tactics <br />
| tactics <br />
|-<br />
| 12 <br />
| tactics-team <br />
| <br />
| teamplay tactics <br />
|}<br />
<br />
<span id="vote"></span><br />
==Changing Modes and Maps== <br />
When playing online you can change the current mode and current map being played by voting for a new game. This is done either via the menu or by simply typing the command to the console (which is easier to show here).<br />
<br />
<pre><br />
/insta curvedm<br />
</pre><br />
Or in full..<br />
<pre><br />
/mode 4; map curvedm<br />
</pre><br />
<br />
This will vote for an ''instagib'' match on the map ''curvedm'' ("Curves That Kill").<br />
<br />
The predefined aliases of release 2006-12-04 are:<br />
<pre><br />
sp = [ mode -2; map $arg1 ]<br />
dmsp = [ mode -1; map $arg1 ]<br />
ffa = [ mode 0; map $arg1 ]<br />
coop = [ mode 1; map $arg1 ]<br />
insta = [ mode 4; map $arg1 ]<br />
capture = [ mode 12; map $arg1 ]<br />
</pre><br />
<br />
<span id="master"></span><br />
==Master Mode== <br />
The MASTER is in control of the game.<br />
<br />
MasterMode can be set to :<br />
* 0 : OPEN - no special features<br />
* 1 : VETO - if the MASTER votes, the vote is automatically accepted<br />
* 2 : LOCKED - future connects go into SPECTATOR<br />
* 3 : PRIVATE - future connects are disabled<br />
<br />
Only the MASTER is able to move SPECTATORS back into the game or KICK people.<br />
A kicked player will not be allowed to reconnect until the server goes empty thus emptying the ban-list or until the master issues the command <tt>clearbans</tt> manually.<br />
<br />
The master has a range of commands at his disposal :<br />
* <tt>setmaster 1|0</tt> : claim or relinquish MASTER<br />
* <tt>mastermode 0|1|2|3</tt> : set the mastermode (see above)<br />
* <tt>spectator B N</tt> : with 1 for on, 0 for off will set/unset SPECTATOR for player N.<br />
* <tt>setteam N T</tt> : forcibly sets player N on team T<br />
* <tt>kick N</tt> : kick a player by name or client-id (visible for MASTER on score-table)<br />
<br />
If you are MASTER you will see the clients ID behind their names on the scoreboard,<br />
other players will see your name in green so they know who is MASTER.<br />
<br />
The MASTER should use his powers wisely.<br />
Don't kick people randomly and don't switch map/mode without a good reason - especially if the other players are busy enjoying the current game. Even though you can use your VETO power to overrule everybody else. If you abuse your powers, chances are the players will change to another server to free themselves from your oppressive rule.<br />
<br />
==Team Modes== <br />
All multiplayer ogros/ironsnouts are either enemies or teammates.<br />
The red ones are enemies,<br />
the blue ones are on your team.<br />
In ''capture'' mode this is also true for the radar blips.<br />
Team names are just that, even if you are on ''team red'' your team-mates show up in blue!<br />
<br />
Currently the two default teams are ''good'' and ''evil''.<br />
<br />
[[File:ogros.jpg]]<br />
<br />
In certain cases you will be auto-assigned to a team,<br />
so be sure not to be too fixed on certain playernames ... shoot the red guys!<br />
<br />
<tt>SP:SinglePlayer .. you'll never '''fight''' one of these in a multiplayer match</tt><br />
<br />
Note : the ogro will be replaced by ironsnout in the release after 2007-05-13 ("spring").<br />
<br />
<span id="hosting"></span><br />
=Server Hosting= <br />
<br />
==Setup== <br />
If you want to host your own server you should be sure to have setup your network accordingly.<br />
To enable access from a WAN (read internet) your routing needs to forward the games ports (see below); for LAN gaming see the following section about [[Multiplayer Guide#LAN|local network gaming]].<br />
<br />
==Player VS. Speed== <br />
A home DSL connection upstream is rumoured to be sufficient to host a 6-player-server, this is currently standard for a server without stating another number in the passed parameters ("-cX" for X players), it used to be 4 before we got a good overhaul on the network code, which slimmed down the packets nicely. Another feat brought to you by the dilligent team of developers behind your favourite multiplayer fps game!<br />
<br />
<span id="config"></span><br />
==Configuration== <br />
For a complete list of parameters always check the documentation: [http://sauerbraten.org/docs/config.html docs/config.html] under section ''command line options'',<br />
also read up on stuff you can do in [http://sauerbraten.org/docs/game.html docs/game.html] (bottom).<br />
<br />
Take note of the possibility to set a master-password, which will give you MASTER even though somebody else already is. Because you know the servers master-password. Use comand line param ''-pS'' for this, where "''S''" is your password, this is never sent to any clients.<br />
<br />
If you are unsure as how to setup your network &amp; firewall correctly, there are some useful hints in the following paragraphs. We can't explain every little detail about this complex subject and encourage you to use the rest of the documentation for additional help!<br />
<br />
<span id="registration"></span><br />
==Public or Private?== <br />
If you do not want your server to be registered on the masterserver then simply point it to a non-working masterserver, most common would be ''-mlocalhost''. By default the official masterserver is contacted and will, if traffic is found possible, then add your server for everbody updating their serverbrowser menu.<br />
<br />
<span id="router"></span><br />
==Router and Ping Response== <br />
If you get a message like "''server did not respond to ping''" your ports aren't being forwarded correctly yet. On the forum a lot of router issues were resolved by pointing to portforward.com. Unfortunately a number of ISPs seem to hand out routers that are incapable of forwarding ports, if you have been given such a device you will, sadly, not be able to host a server.<br />
<br />
The UDP ports you need to forward (or DNAT) to your local box (running the server) are ''28785'' and ''28786''.<br />
<br />
<span id="LAN"></span><br />
==LAN Play== <br />
On your LAN the limit of players will probably only depend on the processing power of the hosting server. Use the "-cX" parameter to enable a maximum of X players, the default assumes a WAN setup, so is far lower than you'd like. The clients can use:<br />
<br />
<pre><br />
/lanconnect<br />
</pre><br />
<br />
To connect to this server easily.<br />
<br />
If you are preparing for a LAN-party you might want to take some time to distribute common keybindings and/or integrate this into the menu for all players.<br />
<br />
<span id="WAN"></span><br />
==Internet Play== <br />
If you are playing on the internet you should be aware that sometimes players might be cheating.<br />
This is a problem that arises with every game to some degree, open source makes this issue maybe even more relevant.<br />
<br />
The way to protect from cheaters, or simply keeping "your" game under control - is using a MASTER.<br />
The MASTER player will be colourized in the SCORE table, so you can contact this player in case you have any issues with the current game.<br />
<br />
Voting can be forced by the MASTER (requires mastermode 1 (VETO)), the MASTER can also set the game to be LOCKED (future connects go directly into SPECTATOR) or even set the game to PRIVATE mode, which bans all future connects. See the [[Multiplayer Guide#master|MASTER description]] for details.<br />
Regular voting works by somebody calling a mode and map - which will be output on every players console.<br />
<br />
<br />
If you agree you should simply call the same mode/map combination (e.g. via the multiplayer menu or by typing in manually). As soon as more than 50% of the players have agreed the game will switch to the desired mode/map combination.</div>Adminhttp://cubeengine.com/wiki/Mr_FixitMr Fixit2014-12-12T15:59:29Z<p>Admin: </p>
<hr />
<div>=Mr. Fixit= <br />
<br />
This is the Mr. Fixit *.blend file released upon request for learning purposes. Download it here; [http://cubeengine.com/w/files/mr_fixit.zip mr_fixit.zip]. Any questions please direct them to<br />
geartrooper on irc.quakenet.org #sauerbraten or on the Sauerbraten forums, or at ironantknight [at] gmail [dot] com.</div>Adminhttp://cubeengine.com/wiki/Modding_GuideModding Guide2014-12-12T15:59:29Z<p>Admin: </p>
<hr />
<div>The top place to look for published mods is, of course, on [http://www.quadropolis.us Quadropolis].<br />
Use either the [http://www.quadropolis.us/flexinode/table/3 table] or the [http://www.quadropolis.us/flexinode/list/3 list] of available mods.<br />
Always remember -- the source is [http://www.gzip.org/zlib/zlib_license.html zlib license], the artwork under varying (but generally ''more'' restrictive) licenses.<br />
<br />
=Important DOs= <br />
# Read the license, this means every available one and check they allow you to do what you want to do. In very short: you can use the source; but any media is not distributable. Their license is soley for dot3labs to distribute with Sauerbraten (except where EXPLICITLY STATED OTHERWISE -- such as free for all non-commercial use; if there is no explicitly stated license, it is for the Sauerbraten distribution ONLY). Any derived work of yours will have to either be a "total conversion" (e.g. make models and maps from scratch with your own texture set and all) or be a "Client/Server mod" (e.g. small changes to either side of the game).<br />
# You should NEVER, ever, ever, ''ever'' run these modifications on the regular network; best approach is to edit the designated ports for your mod right away and never try to register modded servers on the Sauerbraten masterserver!<br />
# Read the todo list and all developer info you find lying around, it helps!<br />
# Keep a list of your changes; this is incredibly important and helpful.<br />
# Abide by the ZLIB license.<br />
# Take screenshots of your mod periodically and compare them to the ones on the [http://sauerbraten.org/ main page] . Does the mod look better or worse? Don't delete these, they'll look great as thumbnails on your "changelog" page.<br />
<br />
=Top 3 DON'Ts= <br />
<br />
# Don't copy content (textures, maps, models, etc.) without consent by the ''respective copyright holder'' (see appropriate readme's). Inquire on forum if in doubt.<br />
# Don't use the official network/port/masterserver for your mod. This means you need ''your own masterserver'' and should use ''different UDP ports'' than the regular game.<br />
# Don't forget open-source is free as in ''free speech'', not as in ''free beer''.<br />
<br />
See also:<br />
[[Building and Compiling]]<br><br />
[[How not to start a mod]]<br><br />
[[How to approach modding]]<br></div>Adminhttp://cubeengine.com/wiki/MD3_Export_From_Blender_TutorialMD3 Export From Blender Tutorial2014-12-12T15:59:28Z<p>Admin: </p>
<hr />
<div>A quick and easy guide for exporting static models from Blender to Sauerbraten. For this tutorial, [http://www.blender.org/ Blender 2.43] was used with this [http://johnny3d.promail.ca/blendermd3.zip md3 exporter script]. Having a UV mapped model we proceed by opening blender.<br />
<br />
[[File:screenshot.png|center]]<br />
<br />
<br />
Your panels' appearance may vary depending on your preference.<br />
Open the file containing your model with F1 or CTRL+O and enter front view with KEYPAD 1.<br />
<br />
<br />
<br />
For this Coin model it will need to float above the ground. You can achieve this in Sauerbraten by editing the md3.cfg after exporting, which we will get to, or set the height in Blender as shown. Using both is best to achieve accuracy. Shown above is the coin model in edit mode with the model's Point of Origin at the crosshairs. For any model, animated or not, the point of origin must be at 0,0,0 for proper exporting. Lets check the uvmap to ensure it is mapped correctly. TAB out of edit mode and press F with the coin selected to enter uv mode. Select the UV/Editor (shown on the right) by selecting it<br />
in the button panel's header (button bar at bottom right).<br />
<br />
[[File:screenshot2.png|center]]<br />
<br />
<br />
If you haven't already convert the model from quad faces to tris. F out of uv mode, TAB to edit mode, select all faces with A, and SPACEBAR->EDIT-><br />
CONVERT TO TRIANGLES. This is the proper format for faces in game engines.<br />
<br />
One last step remains before we can export. Blender's axis are different than most 3d apps and for Sauerbraten. If we export now the model will face in the wrong direction. Select all vertex with A. Then type Z to rotate on the z axis. Finally determine the exact amount with -90.<br />
<br />
[[File:screenshot3.png]]<br />
<br />
Another fact to be aware of is default objects in Blender such as a cube or a cylinder are very small when exported to Sauerbraten. This, too, can be remedied in Blender and/or Sauerbraten via cfg. For a relative scale above is shown the coin model and just to the right is the default camera.<br />
<br />
Now you are ready to export. TAB to object mode and with the model selected choose File->Export->Quake3(.Md3). Name the model tris.md3, choose the directory to export to and select Export Quake3 MD3.<br />
<br />
If you have read Sauerbraten/docs/dev/md3_sauer_howto.txt (its your sauerbraten md3 bible) you will know static models won't need an md3.cfg. This is fine but lets make one anyway to get a feel for the process. Open up any text editor and save it as md3.cfg. Edit it with the following lines;<br />
<br />
md3load tris.md3<br />
<br />
this will load the model into sauerbraten. Next we must call the skins and any masks you may have made. Also you will need the name of the mesh to apply the skin to which can be found by selecting the model in Blender and in the buttons window (F9) look for the name in the Links and Materials panel designated in the OB: area. In the coin model's case it is Cylinder (second screenshot, right hand side). The next line will look like so;<br />
<br />
md3skin Cylinder ./skin.jpg<br />
<br />
Skin.jpg is the name of the texture which was applied to the coin model. Now lets adjust the size and specularity with;<br />
<br />
mdlscale 200<br />
mdlspec -1<br />
<br />
Save the file and your ready to test. A good practice for testing static md3's is to put the tris.md3, skin.jpg, and md3.cfg in the sauerbraten/packages/models/health slot after moving its contents temporarily. Fire up Sauerbraten and if all went well your model will be in the current map where any health boosts were placed. Next time we will examine exporting animated md3 files.<br />
<br />
-geartrooper</div>Adminhttp://cubeengine.com/wiki/Masks_on_ModelsMasks on Models2014-12-12T15:59:28Z<p>Admin: </p>
<hr />
<div>=Specular and Glow= <br />
<br />
A masks.jpg is an image that combines a glowmap and a specular map. To fit both into one image, they are essentially greyscale images in the red (specular) and green (glow) channel. The blue channel is unused, but might be used in the future for another type of map.<br />
<br />
Easiest way to grasp the concept would be to open an existing mask (for example ''/packages/models/boost/masks.jpg'').<br />
Open your "channels" window in either Photoshop or the GIMP, and have a look at the individual channels. Blue is black (unused) and the red and green channels will hold the specular and glow information. The brighter the values, the stronger the effect will be. With the specular map, you can control the shininess of the materials (and for example make the metal more reflective than the wood parts of a model) and the glow map will allow you to have certain parts of the model appear as if they emit light (for example lamps, LEDs, lava, flames). Note that the color, since the green channel only holds brightness values, will have to be controlled via the color map (usually referred to as the "skin").<br />
If your model doesn't need any glow, just keep the green channel empty (i.e. black).<br />
<br />
To use your mask, you have basically two options. On an MD2, you simply drop a file called "masks.jpg" into your model´s directory, and it will be used on the model. On an md3, you either use it without configuration, and add a "masks.jpg" like for an MD2, or you can assign different mask textures to the parts of your model, which then can have individual names. (see "md3 how-to" below for further info).<br />
<br />
You can also control the overall strength of the specular part with the "mdlspec" command in your model's *.cfg file. Be sure to keep the blue channel empty, for one day it might be used for a third type of map, and you don't want any unwanted results to appear on your model that day.</div>Adminhttp://cubeengine.com/wiki/Map_ScreenshotMap Screenshot2014-12-12T15:59:28Z<p>Admin: </p>
<hr />
<div>Making screenshot of your map that appears in the menu is simple:<br />
<br />
Take a clean screenshot of your map, to do this set '''<tt>hudgun 0</tt>''' and '''<tt>hidehud 1</tt>''' in the [[Using the Console|console]], then press '''F12''' to take the screenshot. The image will be saved in your Sauerbraten home folder. (Alternatively, you can use MeatROme's "[http://www.quadropolis.us/node/276 Pretty Screenshot]" script.)<br />
<br />
==Edit the Image and Rename It== <br />
1. Now open your screenshot in Photoshop or in [http://www.gimp.org/ The Gimp] (free). Select a rectangular portion of your image. Just hold down shift while using the marquee tool, it will restrict it to rectangular. Now crop the portion.<br />
<br />
2. Go Image>Image Size and resize it to 256x256 pixels. Chose "Cubic" ( called "bicubic" in Photoshop) as resampling method.<br />
<br />
3. Press Control-Alt-Numpad 0 to view it at it's actual size.<br />
<br />
Now you might want to tweak the brightness a bit if you feel it's necessary.<br />
Keep in mind, using the "brightness/contrast" command, if you increase the brightness, your image might get a washed out look. To counter this also raise the contrast a bit. Raising the contrast though can make the colors appear too saturated. Counter this with slightly decreasing the saturation a bit if necessary, until the image looks natural again.<br />
<br />
4. As a last step you might want to experiment with sharpening a bit. (resizing an image always decreases sharpness a bit).<br />
I recommend you use an "Unsharp Mask" filter, since it gives a milder result and enhances contrast and highlights a bit. Don't overdo this.<br />
<br />
5. Now save your image as ''mymapname.jpg'' and move it to the ''/packages/base'' folder.<br />
<br />
Final Notes: Don't overdo the tweaking. Also it might be a good idea to choose a prominent place of your map. Keep in mind the screenshot should be informational in nature, helping the players to learn wich map is wich better. So there´s really no need to get all artistic on it. Please refrain from adding text or paint filters, to help keep the look consistent.<br />
<br />
==Tips== <br />
* Take the screenshot at a higher <tt>fov</tt> (like 120) to get some more of the map onto the screen.<br />
* If you'd like to take a shot from a place where you can't stand on geometry to hold your camera still, then you can use '''<tt>gamespeed 10</tt>''' - that way you won't have the editing aspects on the screen and a reasonably easy time at getting the shot from the position/view-angle you've chosen!<br />
* If you wish to take screenshots in edit mode but have a lot of water, lava, clip, or other material, you can use '''<tt>showmat 0</tt>''' to make them look as if you weren't in edit mode.<br />
* Taking screenshots in edit mode will give you little sparkling entities, which may or may not be a problem depending on the map.<br />
* Press '''F1''' to toggle pausing the game (this only works in singleplayer).<br />
<br />
==Linux== <br />
<tt>screensauer.sh</tt><br />
<pre><br />
#!/bin/sh<br />
DD="/var/www/sauerbraten/maps"<br />
EP="-w1024 -h768 -a2 -f1 -b16 -z24"<br />
if [ -n "$1" ]<br />
then<br />
./sauerbraten.sh $EP -l$1<br />
#mogrify -gamma 1.6 -format jpg -quality 80 -size 400x300 -resize 400x300 screenshot*.bmp<br />
mogrify -gamma 1.6 -format jpg -quality 80 -size 256x256 -resize 256x256 screenshot*.bmp<br />
mkdir $DD/$1<br />
cp ./*.jpg $DD/$1/<br />
else<br />
echo -e "\ncall with \033[1mmap name\033[m to make \033[1mscreeners\033[m for\n"<br />
fi<br />
</pre><br />
<br />
Of course you'll have to modify <tt>DD</tt> (the destination directory) and the parameters passed to <tt>mogrify</tt>.<br />
Simply run<br />
<pre><br />
./screensauer.sh curvedm<br />
</pre><br />
if you wanted to create some shots for curvedm.</div>Adminhttp://cubeengine.com/wiki/Mapping_and_EditingMapping and Editing2014-12-12T15:59:28Z<p>Admin: </p>
<hr />
<div>=Introduction= <br />
<br />
Editing in Sauer is very intuitive, yet extremely powerful. There are a multitude of options for editing, and it is impossible to create a complete guide of ''everything'' you can do with it. Thus, experimentation is not only encouraged, to some degree it is required. Even the developers don't know everything that can be done with Sauer -- there are many possibilities to be discovered and thought of. As such, this guide will focus on the abstract concepts of editing, and will introduce you to some of the possibilities.<br />
<br />
Read the overview of [[Editing Methods]], then try the [[Videos|tutorial videos]]. Sauer also features [[Cooperative Editing]], allowing multiple users to edit the same map at the same time over a server.<br />
<br />
Additional background can be collected from viewing [[Script Demo - Map Menu]] about loading your personal maps from console and/or menu and [[Map Screenshot]] about how to go about creating the required image.<br />
<br />
=Map CFG Files= <br />
<br />
Each map's individual properties are determined by its CFG file. You can find examples in existing CFG files (just open them up in a text editor) and the [[Map Config and Scripting|map configuration page]] for the specific commands, and their uses. It is recommended that every map use a CFG, since many things are controlled by the configuration file. There are several CFGs that are executed in different situations, but all will be overridden by a maps CFG. To use a map-specific CFG, just name the CFG the same as your map file name.<br />
<br />
=Map Inclusion Standards and Quadropolis= <br />
''eihrul put this up on the Cube Engine Forums'' [http://cubeengine.com/forum.php?action=display_thread&thread_id=2250 here]'', and I thought it might be good to have a'' [[Map Inclusion Standards and Quadropolis|wiki page]] ''for it. Some minor editing has been done to make it conform to the wiki guidelines and to make it easier to read, but nothing beyond that. No information has been removed or changed, only slightly moved.<br />
-- LeftClicker''<br />
<br />
=Making Models For Sauerbraten= <br />
<br />
[[Suggested Modelling Tools]]<br><br />
[[MD3 Export From Blender Tutorial]]<br><br />
[[Blender Animated Md3 Export|Animated MD3 Export From Blender]]<br><br />
[[Masks on Models]]: specular and glow masks explained<br><br />
<br />
=Editing related links= <br />
* [http://www.quadropolis.us/node/30 General mapping tips] by makkE to keep you pointed in the right direction<br />
* excellent [http://www.cliffyb.com/art-sci-ld.html article] on mapping in general.<br />
* [http://www.lunaran.com/page.php?id=9 Lunaran] has a few articles on mapping under the "Lunaran's Deathmatch Encyclopedia" heading.<br />
* An [http://tutorials.moddb.com/239/lighting-in-game-environments-the-hows-a/ excellent article] on lighting in particular<br />
* Two excellent preview chapters of a book for mappers on [http://book.hourences.com/booklighting.htm lighting] and [http://book.hourences.com/bookgameplay.htm gameplay]</div>Adminhttp://cubeengine.com/wiki/Map_Inclusion_Standards_and_QuadropolisMap Inclusion Standards and Quadropolis2014-12-12T15:59:27Z<p>Admin: </p>
<hr />
<div>''eihrul put this up on the Cube Engine Forums'' [http://cubeengine.com/forum.php?action=display_thread&thread_id=2250 here]'', and I thought it might be good to have a wiki page for it. Some minor editing has been done to make it conform to the wiki guidelines and to make it easier to read, but nothing beyond that. No information has been removed or changed, only slightly moved.<br />
-- LeftClicker''<br />
<br />
There was a discussion on Quadropolis that I thought better to put on here: Who ultimately decides what maps are included in Sauerbraten? What does that have to do with the rating system on Quadropolis? I pretty much decide which maps go in Sauerbraten by myself at this point. I have been involved in the Cube Engine projects for some eight years now, so I have a good idea what mappers are capable of. I have also played Cube and Sauerbraten all this time, so I have a decent idea of what layouts/gameplay are huge errors. I have the advantage that I wrote a lot of the Cube 2 engine, so also have a huge understanding of the performance/technical problems with given maps as well, which are often overlooked.I feel I make fairly good decisions about which maps to include based on these factors, and in those cases where I make mistakes and players convince me so, I go back and change the map line-up, culling bad maps or adding overlooked ones.<br />
<br />
So if someone shows me a map, through whatever means, and I decide I like it, it gets included. It is that simple.<br />
<br />
That said, I am that most maligned element of the media: a map ''critic'', not a map ''creator''. So if I decide a map is not good enough to include, I can't tell you how to make it a better map -- I can only tell you why I didn't include.<br />
<br />
I nearly pooped out my soul last release (Trooper Edition) from how harsh I had to be in turning down some maps, which many people had clearly put a lot of effort, time and emotion into creating, but which were not ultimately good enough and I couldn't tell them how to make good enough. Professional game developers get paid to be that evil -- it's survival, if they don't do it, they are out of a job. I don't get that benefit; the opposite, I pay out money to keep the project running.<br />
<br />
So I decided, at the time, that I would no longer personally give any advice on what people need to do to improve their maps for inclusion. I'll tell you what you did wrong, but I won't tell you how to make it right, because I'm simply not that good on that aspect. Strict up or down answer. It is way too much unneeded stress for me to do otherwise.<br />
<br />
But that's where Quadropolis comes in. If you post your map there, you will get feedback from other mappers about what they think are the problems with your map and how they would improve on your map. And they are mappers, so they can tell you how they would actually do stuff, as opposed to me.<br />
<br />
If other mappers highly approve of your map, there is a strong probability I will also approve of it. If there are respected mappers who point out issues with your map, there is a strongly probability I will agree with them. If someone is just being harsh about your map out of spite or is being silly and unreasonable with demands, there is a strong probability I am also rolling my eyes reading their comments and ignoring them as much as you are.<br />
<br />
I don't so much care what the rating number is, because quality maps are quality maps regardless, and I ultimately make the judgement call of including them by actually looking at them myself.<br />
<br />
So if you think you make totally awesome maps that do not need review, and you think there's a strong chance that I would include it, then asking me directly about inclusion can work. The caveat is, I will just give you a yes or no answer with some points about obvious things you might have done wrong without much in the way of clues as to how you can fix them, so Quadropolis is a better bet for real feedback on your map and how to make it better.<br />
<br />
At the same time, other mappers are not infallible, and I think the Cube community at times suffers from raising the bar for quality ''too'' high, because they have been spoiled by the amount of maps we produce as a whole. So while some mappers might be bored with the appearance of certain maps, I might include them anyway, because I have decided that the quality of the map was sufficient, even though not exceptional. It doesn't mean I or others don't appreciate extremely awesome maps, it just means that not every map needs to be better than every map ever made before it.<br />
<br />
Likewise, I am much better pointing out performance issues with your maps, and that is the one issue on which you are possibly better asking me about, rather than taking other mappers' word for it, if you feel there is doubt about your map in that area.</div>Adminhttp://cubeengine.com/wiki/Map_Config_and_ScriptingMap Config and Scripting2014-12-12T15:59:27Z<p>Admin: </p>
<hr />
<div><span id="intro"></span><br />
=Introduction= <br />
Once you've created a *.cfg file for your map:<br />
* Start Sauerbraten<br />
* Enter edit mode by pressing the E key<br />
* and at the console, type <tt>newmap</tt><br />
* Before editing anything, type: <tt>savemap mapnamehere</tt><br />
* Be sure that the name you save your map as, is the same name as your map.cfg file you created earlier.<br />
* Finally, to put those new textures to work, at the console, type <tt>map mapnamehere</tt><br />
<br />
* This will reload your map, and load your configuration file as well.<br />
<br />
When you want to share your maps with own CFG with others you should package the content and distribute this package to everybody. Then they should simply need to extract to their own Sauerbraten folder, find everything in place (nothing overwritten) and ready to go. Then just meet on any server and load the map, it will look fine. If you use the coop-edit mode to transfer a map, then only the geometry is passed and the map name will be unknown to you -- there is no way any but default_map_settings.cfg will be loaded. So either get some free webspace to put your maps on, email them to your friends or get an account on [http://www.quadropolis.us Quadropolis] (the semi-official download site for Sauerbraten).<br />
<br />
<span id="basics"></span><br />
=Basic uses= <br />
<br />
Each map will first load default_map_settings.cfg and then any package CFG and last the specific map CFG. So a map called metl4.ogz will call metl4.cfg.<br />
<br />
The first need for such a specific map configuration file will most likely arise when you want to have a special skybox background. For this enter<br />
<br />
<pre><br />
loadsky "skyname"<br />
//loadsky "ik2k/env/iklake"<br />
//loadsky "socksy/mars"<br />
</pre><br />
<br />
Where skyname is the path to the 6 required images for a skybox. For example, <tt>loadsky "yourname/skyname"</tt> will try to load /packages/yourname/skyname_lf, skyname_rt, skyname_ft, skyname_bk, skyname_dn, and skyname_up.<br />
<br />
Second, the fog cut-off distance, and fog color can be applied. For this enter<br />
<br />
<pre><br />
fog 2500 // the fog value can be set from 1 to 100000 as needed<br />
fogcolour 16777215 //this is the max setting. This is also a hex parameter, 0XRRGGBB.<br />
</pre><br />
<br />
Third, you might want some ambient lighting. For this use <tt>ambient 15 '' Can be set from 1 to 255</tt> Be careful with the ambient option, as it reduces the texture contrast. To help converting RGB to HEX values, this [http://www.kenjikojima.com/java/RGBHexConverter2.html RGB & Hex Converter] popped up on the forum.<br />
<br />
<br />
<span id="cross-platform"></span><br />
==Cross-Platform== <br />
Beware that your filenames and CFG files must match in all spelling of filenames; especially capitalization has been problematic. For music OGG or MIDI are good formats for cross-platform friendliness,<br />
PNG textures also travel well.<br />
<br />
<br />
<span id="textures"></span><br />
=Textures= <br />
<br />
The first thing to understand here is, the default map configuration is already in place. Unless you want to add new textures to your map, you do not need this part of a map.cfg Sauerbraten has a very large texture list by default. For the beginner mappers, this shoudl do fine. For the ones that need to add new textures, do the following:<br />
<br />
To explain the meaning of this parameter(s), the line " texture 0 "dg/trail_in.jpg" " for example. The first number after the word texture, stands for the type of texture it will be used as. There are several different types, but for now we'll just use type 0. the part of the line in "" is telling the engine where the texture is located. You must name this directory yourself. When working with a new texture list, you should never add to an original Sauerbraten directory. Create your new directory withing the packages directory.<br />
<br />
Start your map after creating this part of the maps .cfg file. You do not want to retexture anything.<br />
The first thing to add to the texture list section of a map.cfg file, is :<br />
<pre><br />
texturereset<br />
</pre><br />
This tells the engine to reset from the default configuration, and use the map.cfg for the texture list.<br />
After you reset the texture list, you need to add your own. The first 2 slots are "reserved" for the engine, and must be in every map.cfg file you use new textures with :<br />
<pre><br />
texture 0 "ik2k/ik_sky_day_back.jpg"<br />
texture 0 "golgotha/water2d.jpg"<br />
</pre><br />
From this point on, you can add as many textures as you want ( up to 2^16 or 65,536 )<br />
You could also list the same texture more than once, to have rotated versions, by adding a number AFTER the texture name:<br />
<pre><br />
texture 0 "dg/trail_in.jpg" 0 // 0 = none, 1 = 90 CW, 2 = 180, 3 = 270 CW, 4 = X-axis flip, 5 = Y-axis flip<br />
</pre><br />
<br />
<span id="shaders"></span><br />
==Shaders== <br />
<br />
Shaders are post processing effects applied to textures. They are used to provide added realism and depth to flat textures.<br />
<br />
You define a shader with:<br />
<pre><br />
setshader x<br />
set*param index x y z w<br />
</pre><br />
<br />
You define textures to use as "maps" for the shaders using the following:<br />
<br />
<pre><br />
texture 0 "texturename" // default texture<br />
texture d "texturename" // decal texture<br />
texture n "texturename" // normal map<br />
texture s "texturename" // specular map<br />
texture g "texturename" // glow map<br />
texture z "texturename" // depth (parallax) map<br />
texture u "texturename" // undefined (currently used for sphere maps)<br />
</pre><br />
<br />
The following list was compiled from CVS sauerbraten after the 2006-12-04 "gui" edition release.<br />
Then the supported texture shaders were, check your local documentation and CFG files (data/stdshader.cfg):<br />
{| style="border: 1px solid #c6c9ff; border-collapse: collapse;" cellspacing="0" cellpadding="10" border="1"<br />
|-<br />
| ===shader=== <br />
| ===description=== <br />
|-<br />
| stdworld <br />
| null shader; no params; uses 0 only <br />
|-<br />
| decalworld <br />
| decal shader; no params; uses 0, d <br />
|-<br />
| glowworld <br />
| glow map shader; setpixelparam 0 r g b; uses 0, g <br />
|-<br />
| pulseworld <br />
| pulse shader; setvertexparam 1 x; uses 0 <br />
|-<br />
| pulseglowworld <br />
| pulsing glow map shader; setpixelparam 0 r g b, setvertexparam 1 x; uses 0, g <br />
|-<br />
| metalworld <br />
| sphere map shader; setpixelparam 0 r g b; uses 0, u <br />
|-<br />
| bumpworld <br />
| normal map shader; no params; uses 0, n <br />
|-<br />
| bumpspecworld <br />
| normal map shader with spec; setpixelparam 1 r g b; uses 0, n <br />
|-<br />
| bumpspecmapworld <br />
| normal, spec map shader; setpixelparam 1 r g b; uses 0, n, s <br />
|-<br />
| bumpspecmapglowworld <br />
| normal, spec, glow map shader; setpixelparam 0 r g b, setpixelparam 1 r g b; uses 0, n, s, g <br />
|-<br />
| bumpspecparallaxworld <br />
| normal, parallax map shader with spec; setpixelparam 1 r g b, setpixelparam 2 x y; uses 0, n, z <br />
|-<br />
| bumpspecmapparallaxworld <br />
| normal, parallax, spec map shader; setpixelparam 1 r g b, setpixelparam 2 x y; uses 0, n, s, z <br />
|-<br />
| bumpspecmapparallaxglowworld <br />
| normal, parallax, glow, spec map shader; setpixelparam 0 r g b; setpixelparam 1 r g b, setpixelparam 2 x y; uses 0, n, s, g, z <br />
|}<br />
<br />
preliminary copy from IRC log:<br />
<pre><br />
[19:40] <KaiserTodretter> bumpmaps are greyscale images that basically say what the heights of the different parts<br />
of a texture are<br />
[19:40] <KaiserTodretter> white being high spots and black being low spots<br />
[19:41] <KaiserTodretter> bumpmaps make a texture appear not flat and distorts the texture in a way that it actually looks 3D<br />
[19:42] <KaiserTodretter> normal maps are made from bumpmaps and are used to determined at what angles you will see the specularity of a texture<br />
[19:43] <KaiserTodretter> the specularity can either be a constant set in the map config or a specmap texture can be made to show what parts<br />
of the texture are shiney and what parts are dull<br />
[19:43] <KaiserTodretter> the last thing you can add is glowmaps<br />
[19:43] <KaiserTodretter> they dont actually 'emit' light to their surroundings<br />
[19:44] <KaiserTodretter> but they are lit up even if there is no light on them<br />
[19:44] <KaiserTodretter> you probably also noticed how as you move by certain textures you can see some shine on them<br />
and it changes as you move by<br />
[19:45] <KaiserTodretter> that is the spec and normal maps<br />
[19:45] <devoid> ok<br />
[19:45] <devoid> they make the "shine" effect ?<br />
[19:45] <devoid> ill experiment some more<br />
[19:46] <KaiserTodretter> the 'shine' itself comes from the specularity<br />
[19:46] <KaiserTodretter> however using normal maps with that will make the shine appear at the correct angles<br />
[19:46] <devoid> so, does it involve alot of work to make a set of such textures?<br />
or is it pretty easy if you got the hang of it ?<br />
[19:47] <KaiserTodretter> otherwise it will appear as if the texture is perfectly flat<br />
[19:47] <KaiserTodretter> some are time consuming<br />
[19:47] <devoid> well thx for the tips<br />
</pre><br />
<br />
<br />
<span id="sound"></span><br />
=Sound= <br />
use the commands<br />
<pre><br />
music package_path/file.ogg<br />
music package_path/file.mp3<br />
<br />
// and/or<br />
<br />
snd_index = registersound package_path/file.wav<br />
snd_index = registersound package_path/file.mp3<br />
<br />
level_trigger_42 = [<br />
sound $snd_index<br />
]<br />
// and/or<br />
<br />
// only WAVs allowed ATM, so do not add an extension!<br />
<br />
mapsound package_path/file_one<br />
mapsound package_path/file_two 255<br />
mapsound package_path/file_two 128<br />
mapsound package_path/file_two 100<br />
mapsound package_path/file_three 2<br />
<br />
</pre><br />
to add individual sound fx to your map.<br />
The '''mapsound''' fills indexed slots for usage with '''sound'''-entities.<br />
<pre><br />
// X R F<br />
newent sound 1 128 64<br />
</pre><br />
This would load the second slot (1st = 0) "X" onto that entity.<br />
At a radius of 128 you'd start/stop hearing it ... smaller than 64 and it'd be at full volume (see CFG).<br />
<br />
<span id="triggers"></span><br />
=Triggers= <br />
Defining trigger actions - for SP maps only - is a vast field.<br />
You can basically define any scripting action inside a trigger alias,<br />
this will be parsed when the player enters the space of the trigger entity.<br />
<br />
Read the section about [http://sauerbraten.org/docs/editref.html#entitytypes Entity Types] to understand what the tie-up with mapmodels is all about.<br />
<br />
You can start off trying out triggers with simple echo commands,<br />
then start scripting the action you'd like to happen.<br />
<br />
To see how doors work you can look at packages/models/doors/door_01/md3.cfg - and of course a map that has doors ;)<br />
A simplistic form of a ''secret's counter'' - can be found on the [[Scripting Tutorial#trigger101|Trigger 101]] page.<br />
<br />
Try finding out how maps do stuff if you want to start using triggers yourself.<br />
Then try "faking" the action by calling your script by hand.<br />
Finally select an index for this action, say 42,<br />
then you'll simply need to place this scripting inside a<br />
<pre><br />
level_trigger_42 = [<br />
// your code here<br />
]<br />
</pre><br />
alias and place triggers with tag 42 into the right places.<br />
To modify a placed triggers (default menu only has 0-8) tag :<br />
<pre><br />
entproperty 3 +30<br />
entproperty 3 +2<br />
entproperty 3 -1<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Linux_Server_ScriptsLinux Server Scripts2014-12-12T15:59:27Z<p>Admin: </p>
<hr />
<div></div>Adminhttp://cubeengine.com/wiki/Linux_Client_ScriptsLinux Client Scripts2014-12-12T15:59:26Z<p>Admin: </p>
<hr />
<div>=Linux Client Scripts=<br />
Running UNIX? Playing Sauerbraten? Often need to change between sets of options, like screen dimensions and shader settings? Here's a possible solution.<br />
<br />
This is an example of how you could possibly handle your changing needs to run Sauerbraten on your linux machine. Please be sure to check your local documentation for possible changes to the number or usage of the parameters passed to the binary; since this page may be outdated in that respect, but the basics are here for those of you not as fluent in shell-scripting, adaptations should be painless.<br />
<br />
You can have your game start in a random map every time, if you like :<br />
The following 2 scripts should be placed in your sauerbraten installation directory and made executable (chmod +x).<br />
Then run [[Linux Server Scripts#update_maplines|update maplines]] and modify [[Linux Server Scripts#run_sb|run sb]] in the section for<br />
<pre><br />
case $2 in<br />
</pre><br />
<br />
The values for your configurations 1-6 and * (for default) should correspond to :<br />
<pre><br />
SW ..... screen width ......... (-w)<br />
SH ..... screen height ........ (-h)<br />
PD ..... pixel depth .......... (-b)<br />
ZB ..... Z-buffer ............. (-z)<br />
FX ..... Shader FX ............ (-f)<br />
AF ..... Ansiotropic Filter ... (-a)<br />
WM ..... windowed mode ........ (-t)<br />
</pre><br />
<br />
You'll need to have '''bogosort''' installed for the map randomization to work and keeping the list up-to-date requires regularly running ''update_maplines''.<br />
<br />
=The Scripts= <br />
<span id="update_maplines"></span><br />
==<tt>update_maplines</tt>== <br />
<pre><br />
#!/bin/sh<br />
# if you require backups unremark the following line<br />
#mv maplines old_maplines_$(date +%Y%m%d%H%M%S)<br />
# simple version:<br />
#ls -1 packages/base/*.ogz | cut -d '/' -f 3 | cut -d '.' -f 1 > maplines<br />
# complex version:<br />
# change the two following values to match your SB install DIR and home DIR<br />
SBP1=/opt/games/sauerbraten<br />
SBP2=/home/ogro/.sauerbraten<br />
find $SBP1 -type f -name "*.ogz"|sed 's/^.*\/\([^.]*\).ogz$/\1/' > maplines<br />
find $SBP2 -type f -name "*.ogz"|sed 's/^.*\/\([^.]*\).ogz$/\1/' >> maplines<br />
</pre><br />
<br />
<span id="run_sb"></span><br />
==run_sb== <br />
<pre><br />
#!/bin/sh<br />
version=0.1<br />
RMN=$(bogosort -n --seed=$(timestamp $(date +%Y%m%d%H%M%S)) ./maplines | tail -n 1)<br />
CMD=""<br />
WM=0<br />
<br />
HTXT1="\033[36mSauerbraten Starter\033[m ver:\033[32m$version\033[m"<br />
HTXT2="call $0 with [mapname|-] [gFXindex] [-]"<br />
HTXT3="mapname from packages base for '-l', or '-' for a random map - see maplines and refresh_maplines for details."<br />
HTXT4="gFXindex must be valid in the case/esac block for"<br />
HELPTEXT="\n${HTXT1}\nby MeatROme\n${HTXT2}\n\n\n${HTXT3}\n${HTXT4} \$2.\n\n"<br />
# ---------------------------------------------------------------<br />
<br />
#<br />
# call with [-|mapname] [setup-index]<br />
#<br />
# like :<br />
# run_sb ........ random map, default setup<br />
# run_sb - 1 .... random map, alternative setup #1<br />
# run_sb cdf .... start with map cdf, default setup<br />
# run_sb cdf 2 .. start with map cdf, alternative setup #2<br />
<br />
#echo "Random Map would be $RMN"<br />
<br />
#<br />
# ---------------------------------------------------------------<br />
#<br />
# fullscreen : 1 2<br />
# windowed : 3 4<br />
# mini window : 5 6<br />
#<br />
# ---------------------------------------------------------------<br />
#<br />
<br />
case $1 in<br />
-) MLC="-l$RMN";;<br />
?) echo -e "$HELPTEXT"<br />
case $2 in<br />
[1-6])<br />
LOB=$(grep -n "$2)" $0|grep SW|cut -d ':' -f 1|tail -n 1)<br />
LOE=$(head -n $(echo "$LOB+6"|bc) $0|tail -n 1|cut -d ')' -f 2|tr -d '&;'|tr -d ' '|tr '\t=' ' ')<br />
echo -e "\033[1;32m$2:\033[m\n$LOE\n";;<br />
*);;<br />
esac<br />
exit;;<br />
*) MLC="-l$1";;<br />
esac<br />
<br />
if [ "$MLC" == "-l" ]<br />
then<br />
MLC="-l$RMN"<br />
fi<br />
<br />
# EDIT YOUR CONFIG HERE ::<br />
case $2 in<br />
1) SW=1024 && SH=768 && PD=16 && ZB=24 && FX=1 && AF=2 && WM=0;;<br />
2) SW=1024 && SH=768 && PD=16 && ZB=24 && FX="" && AF=0 && WM=0;;<br />
3) SW=1024 && SH=768 && PD=16 && ZB=24 && FX="" && AF=0 && WM=1;;<br />
4) SW=800 && SH=600 && PD=16 && ZB=24 && FX="" && AF=0 && WM=1;;<br />
5) SW=640 && SH=480 && PD=16 && ZB=24 && FX=1 && AF=2 && WM=1;;<br />
6) SW=640 && SH=480 && PD=16 && ZB=24 && FX="" && AF=0 && WM=1;;<br />
*) SW=1280 && SH=1024 && PD=16 && ZB=24 && FX=1 && AF=1 && WM=0;;<br />
esac<br />
# :: EDIT YOUR CONFIG HERE<br />
<br />
GEP="-w$SW -h$SH -b$PD -z$ZB -f$FX -a$AF"<br />
if [ "$WM" == "1" ]<br />
then<br />
GEP="$GEP -t"<br />
fi<br />
SEP="$MLC $GEP"<br />
<br />
CMD="./sauerbraten_unix $SEP"<br />
<br />
# ---------------------------------------------------------------<br />
<br />
echo -e "\nrunning SAUERBRATEN ...\n"<br />
echo $CMD<br />
$CMD<br />
echo<br />
echo ... finished.<br />
echo<br />
<br />
</pre></div>Adminhttp://cubeengine.com/wiki/Linux_client_scriptLinux client script2014-12-12T15:59:26Z<p>Admin: </p>
<hr />
<div>TO BE DELETED</div>Adminhttp://cubeengine.com/wiki/Install_GuideInstall Guide2014-12-12T15:59:26Z<p>Admin: </p>
<hr />
<div><br />
The first thing you need to do is [http://sourceforge.net/project/showfiles.php?group_id=102911 download the game] and any patches provided in the current edition (available from the same [http://sourceforge.net/projects/sauerbraten Sourceforge Project]. The packages are usually labeled in the format "<tt>sauerbraten_''YYYY_MM_DD_CODENAME_PLATFORM''</tt>" and patches "<tt>patch_''YYYY-MM-DD_PLATFORM''</tt>", where YYYY is the year, MM is the month, DD is the date, CODENAME is the edition name, and PLATFORM is the system the release is made for. Should you run into any problems after following these instructions, try consulting the [[Beginners Guide]], the [[FAQ|Frequently Asked Questions]], and the [[Performance Guide]].<br />
<br />
==Windows== <br />
* Run the provided installation executable.<br />
* Follow the instructions in the installer, take note of the installation directory as you do (usually "<tt>C:\Program Files\Sauerbraten\</tt>").<br />
* If there is a patch for this release, download it and follow the same method above to install it, making sure you use ''the same'' installation directory.<br />
* Go to your Desktop/Start Menu and run the "Sauerbraten" link.<br />
* ''Advanced Note'': If you want to play Eisenstern (the WiP RPG), copy this link to another location, naming it "Eisenstern", right click on it and select "Properties". In the "Target" box on the "Shortcut" tab, add "-grpg" to the end. It should look something like: <tt>"C:\Program Files\Sauerbraten\sauerbraten.bat" -grpg</tt><br />
<br />
==Linux/BSD== <br />
Getting the game running on a Linux or BSD based system requires a little knowledge of the command line. Please note these instructions are for a single user install, in most cases you may want to use the packaging system provided by your distribution (which is beyond the scope of this document).<br />
<br />
* Move the installation files to your home directory, if they aren't already.<br />
* Open up a console/terminal, you should be at a prompt that looks something like, <tt>[username@hostname:~]$</tt> or <tt>hostname:~$</tt> (in most cases, "<tt>~</tt>" is interchangable with "<tt>/home/username</tt>").<br />
* Type these commands (remembering to adjust for the release and platform):<br />
<pre><br />
tar -jxvf sauerbraten_YYYY_MM_DD_CODENAME_PLATFORM.tar.bz2<br />
cd sauerbraten<br />
<br />
</pre><br />
* To run the game, type: <tt>./sauerbraten_unix</tt><br />
<br />
If the previous step(s) fail, take note of the error:<br />
<br />
* ''"Cannot find shared object XXXXX"'': You don't have the necessary libraries installed, refer to your distribution's help/support for further information on how to install these.<br />
* ''"Segmentation fault"'': This could happen for a few reasons, one might be your platform doesn't support the precompiled binaries, try making some yourself (you will need the development libraries provided by your distribution).<br />
<pre><br />
cd src<br />
make clean all install<br />
cd ..<br />
</pre><br />
<br />
==Mac OS X== <br />
''<span style="font-style: normal;">Running the game on a Mac OS X based system requires little user input. The user downloads a DMG file, drags the Sauerbraten game to </span>/Applications/<span style="font-style: normal;"> or another location, and they double-click the icon to open it. The game creates the necessary preference files and creates autoexec.cfg in </span>~/Library/Application Support/sauerbraten/<span style="font-style: normal;">. Note that while it is technically possible to run the Cube 2: Sauerbraten: Trooper Edition or earlier applications unmodified on Mac OS X 10.3.x Panther, this can cause unusual bugs that should not be reported. In future releases Panther support will be dropped.</span>''</div>Adminhttp://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>Admin