Home

Sandie edited this page Jul 14, 2014 · 78 revisions
Clone this wiki locally

SabiCube is a single-player total conversion of Cube2-Sauerbraten with focus on adding rpg/adventure elements. This package includes the first three levels of the game ZetaProject, and a test-map for the new features. The goal is to make the gamebuilding process as fun as playing a game, with intuitive menus and guides to help anyone make their own open-source rpg/adventure game, without prior knowledge of programming or 3D-modeling.

Quick-start
Editing
Scripting
Hotkeys
Edit Hotkeys
Pickup items
Weapons
barrel
platform
Executabale items
Monsters
Wooden-crate
triggers and doors
Transferring weapons
Savegames
Installing
Gameplay
License

Quick-start:

  1. place the sabecube folder in your home-dir
  2. open the folder and execute sabicube_unix
  3. From the main menu select "Create new map".
  4. Name your map.
  5. select a texture package
  6. once loaded, click F1 for edit-mode, F2 for textures and/or F3 for editing menu and last but not least, remember to save your map!

For a more in-depth explanation of the individual components, please follow the guide below or have a look at the cfg-files for the included game ZetaProject.

Editing:

Once you have loaded a map click [F1] for editmode (edit can be disabled when starting a game). Use your mouse to look around and WASD to move, just like when playing the game, and althou there's no "speedrun" in editmode, you can set floatspeed in the main editing menu. When you click on the ground, your cursor will select a square (hold down G and scroll to enlarge/minimize the size of the square), if you scroll, the selected part will follow, up to make a solid cube and down to make a hole.

For a full list of available editing hotkeys, use the keys/scroll-tab in the main editing menu (F3 in edit-mode).

Editing of mapmodels and textures are mostly done as in the original cube, but in SabiCube you can load textures inside the editor and all mapmodels are available and are easy to script. When you select "Create new map" from the main menu, you can select one of the predefined texture-packs, and other script basic stuff like inventory and other essential variables, and if you are making a map and suddenly decide you need some different textures, you can load a texture-package without having to leave the editor.

Scripting:

Whenever a map is loaded it executes a configuration-file. If your map is called foo, your cfg will be called foo.cfg (if you use the "Create new map" from the main menu, a cfg-file will be created along with the map) if no foo.cfg file is found, the map will use the default mapmodels and textures. If you create your own cfg-file, remember that the first 100 items of your mapmodels are used for pickups. You can call other cfg files from your foo.cfg, so if you want to script a npc or item, you can do so in a separate file. The path to the cfg file is /packages/base/foo.cfg, and from that file you can point to any file you want inside the SabiCube folder. If you want to use the default inventory in your game, you simply add the following line to your foo.cfg: exec /packages/base/inventory.cfg

Hotkeys:

ESC: menu
CTRL: crouch
SHIFT: run
LMB: attack
RMB: zoom
E: Activate/pickup
TAB: playermenu and inventory
1-0: hud-items
F12: Take screenshot

  • Since SabiCube 1.1 you can place items in the hud by clicking preview-image in the inventory.

Edit Hotkeys:

F1 : edittoggle
F2 : Textures menu
F3 : Main editing menu
F3 : Mapmodels menu
For a full list of available editing hotkeys, use the keys/scroll-tab in the main editing menu (F3).

Pickup items:

mapitems are numbered from 0 and up, where 0 (default) is a spinning question-mark, 1 is the next mapmodel in the list, in this case a brawndo-plant (I had to call it something).
To place a Brawndo-plant on your map, you first enter edit mode (F1) click where you want it to appear, open the edit menu (F3) and select consumables/brawndo, this will get you a brawndo-plant that player can pick up. Every item player picks up, will be available in the inventory, eatable items can be eaten when clicked and weapons can be equipped (if you have ammo for it).
If you want to change the name or model, these are defined in data/default_map_models.cfg and the inventory description in packages/base/inventory.cfg just remember these guidelines:
mapmodel 0-79 are reserved for pickupable items.
mapmodel 80-99 are reserved for ammo and guns.
mapmodel 100 is an exploding barrel (can be changed to another exploding item).
mapmodel 101 is a platform/elevator.

When picking up an item, it sends a item_pickup_x (where x is the mapmodel), so if you want to script what to do when a player pick up a model nr 4, it could look something like this:

item_pickup_4 [  
    // item nr 4 add 1, weight 1 
    inventorywrite 4 1 1
    // and echo a message to the screen  
    echo "you found a item nr 4"  
]

If you just want to use the existing inventory-items, you don't have to script pickup-able items

Weapons:

Weapons are no longer being picked up autocratically, the players mouse have to be hovering over them and clicking them like any other pickup-able item. Default weapon (crowbar) is the replacement of the original fist from Sauerbraten and will be equipped whenever a map is loaded. placing a weapon or ammo is just like a normal pickup-able item (BOX). You can't equip a weapon without having the appropriate ammo.

barrel:

Enter edit mode (F1) click where you want it to appear, open the edit menu (F3) and select Explodable barrel. Once you have placed it, you can click it, and then use your scroll-wheel to select any model from the mapmodel-list, if you want an explodable gas-canister or fuel-truck.

platform:

Enter edit mode (F1) click where you want it to appear, open the edit menu (F3) and select Platform.

Executabale items:

Keypads npc's and other items that shouldn't be picked up when a player activates them, are defined the same way as pickup-able items.
So if you want a npc, you first enter edit mode (F1) click where you want your npc to appear, open the edit menu (F3) and select npc. Scripting an executable item, is very similar to a pickup-item:

item_activate_166 = [
    showgui npc166
]
newgui npc166 [
    guitext "Hi there"
    guibar
    guibutton "Hi" [closegui]
]

You can make a very simple quest, by combining items, npc and gui:

item_activate_166 = [
    showgui npc166
]
newgui npc166 [
    guitext "Do you have any Mushrooms?"
    guibar
    // if player have Mushrooms (inventory item 2)
    // NOTE! if you use the github version
    // the correct syntax is : (inventoryread 2)
    if (> (inventory2read) 1) [ // if you use the github version, the syntax is: (inventoryread 2)
        guibutton "sure... here you are" [
            // from inventory item 2 subtract 1 (weight 1 for carryweight)
            inventorywrite 2 -1 1
            // player gain 25 expirience points
            setplayerexp 25
            cleargui
        ]
        guibutton "Sorry, but I need them all" [
            cleargui
        ]
    // if player doesn't have any
    ] [
        guibutton "sorry... I dont have any" [
            cleargui
        ]
    ]
]

Monsters:

There are currently 16 types of monsters (start counting at 0). to place a monster, first enter edit mode (F1) click where you want it to appear, open the edit menu (F3) and select monsters. type 10 is a wooden crate that player can destroy. When a monster is killed, it sends a monster_dead_x (where x is the type), so if you want to script what to do when a player kills a type 12, it could look something like this:

monster_dead_11 = [
    // killing a rat will give the player 10 points exp.
    setplayerexp 10
    // either echo a statement or a sound (or both)
    sound 72 // Damn I'm good...
    echo "You have killed a rat"
]

If you simply want to use the existing monsters and their default values, you just have to include the file packages/base/triggers.cfg, or select triggers in the "Create new map" menu.

Wooden-crate:

Monster type 10 is a wooden crate that doesn't move or do damage, but player can destroy it, very useful for removing planks barring a door, or a crate that gives you ammo or similar items when destroyed. Scripting a wooden crate is done like this:

monster_dead_10 = [
    // first we make a random number from 1-11
    x = (+ (rnd 10) 1)
    // then we add x amount pistolammo to players inventory
    getpistolammo $x
    // last thing is echoing a message to the player via text or sound
    echo (concatword "you found " $x " pistol-ammo")
]

triggers and doors:

Can be controlled by a executabale item or by proximity. To place a proximity trigger, you just place a trigger/door and choose "auto-close" (or "once"). This will place a door that opens autocratically when the player approach it. To use a switch or other model to control the trigger/door, follow the guide "Adding executabale items". A closed door with tag 3, can be opened with "trigger 3 1", and closed again with "trigger 3 0".

Transferring weapons:

! NOTE ! since SabiCube 1.1, ammo should be transferred using the savegame command.

At the moment, ammo is not automatic transferred, but if you update the inventory with the current ammo, you can reassign it when the next map is loaded. Have a look at the way ZetaProject use triggers to transfer ammo from map to map:

level_trigger_4 = [ // exit first map
    inventoryoverwrite 87 (getpistolstat)
    inventoryoverwrite 88 (getshotgunstat)
    inventoryoverwrite 89 (getriflestat)
    inventoryoverwrite 90 (getglstat)
    inventoryoverwrite 91 (getchaingunstat)
    inventoryoverwrite 92 (getrlstat)
    map second_map_name
]
level_trigger_13 = [ // enter second map
    // NOTE! if you use the github version
    // the correct syntax is : getpistolammo (inventoryread 87) and so on...
    getpistolammo (inventory87read)
    getshotgunammo (inventory88read)
    getrifleammo (inventory89read)
    getglammo (inventory90read)
    getchaingunammo (inventory91read)
    getrlammo (inventory92read)
]

Savegames:

Since version 1.1 was released, SabiCube have implemented automated savegames, this is done using the savegame command. The savegame command have three arguments:

savegame int string string

Where int is the current journal status, the first string is the mapname and the last string is the gamename. The command loops through player-inventory and saves it along with character-stats in a file called mapname.sav

In the ZetaProject game-menu (located in packages/data/menus.cfg), you can see how to loop through your savegames, and how to present them as a list (I have simplified it for clarity):

newgui zetaproject [
    // not a savegame but a predefined start-file
    guibutton "Start new game" [exec packages/base/zetaproject/start.cfg] "action"
    guitext " " 0
    guibar
    guilist [
        guilist [
            guitext "Savegames:" 0
            savegames = ""
            // looping through all .sav-files in packages/savegame/zetaproject
            loopfiles cursavegame "packages/savegame/zetaproject" "sav" [
                // do we have more than zero savegames?
                if (< (indexof $cursavegame) 0) [
                    // add savegame to list
                    savegames = (concat $savegames $cursavegame)
                ]
            ]
            // for every savegame found, we make a button
            looplist cursavegame $savegames [
                guibutton $cursavegame (concatword "mode -3;map "$cursavegame) "action"
            ]
        ]
    ]
]

The savegames does not currently support player-position and trigger/monster-states, but are still very usefull when traveling from map to map, all you have to do is add it to your exit-trigger like this:

level_trigger_4 = [ // exit trigger
    savegame 2 mapname gamename
    map mapname
]

Once the new map is loaded you can then update inventory:

level_trigger_13 = [
    exec packages/savegame/zetaproject/mapname.sav
]

Installing:

Just as the original Cube, SabiCube require that libsdl-mixer and libsdl-image are installed. These two should be available in the repository of every respectable linux-distro, and if you are on a deb-based distro like Ubuntu, you can install them with:

sudo apt-get install libsdl-mixer1.2 libsdl-image1.2 

SabiCube is tested on 64-bit (Kubuntu) and 32-bit (KXStudio), and we have provided a binary for both, so in most cases it is enough to simply place the sabicube-folder in your home-dir and execute sabicube_unix.

If that doesn't work, try launching sabicube_unix in a terminal:

./sabicube_unix

If you need to compile SabiCube, you have to install sdl-image/dev and sdl-mixer/dev, you'll most likely find them in your package-manager. if you are on a deb-based distro like Ubuntu, you can install the necessary packages using a terminal:

sudo apt-get install autoconf libtool libsdl1.2-dev libsdl-image1.2-dev  libsdl-mixer1.2-dev build-essential

cd into the src dir and run the following:

make && make install

I highly recommend placing the sabicube-folder in your home-dir. if you want to place it somewhere else than in your home-dir, you have to update the file sabicube_unix line 12. so if you place it in /home/USERNAME/myawesomegame, the line should read:

SAUER_OPTIONS="-q${HOME}/myawesomegame"  

Compiling on win and osx, should be possible, but since I use neither, I can't help you there. If you manage to compile it for either of the above systems, please send me the binary so I might include it in the next release.

Gameplay:

Pressing [CTRL] will cause the player to crouch, player will un-crouch when releasing it. To interact with a door, npc or console use the [E] button on your keyboard Your crosshair will show a hand when hovering over an item or npc that can be activated or otherwise engaged
Use [TAB] to view the playermenu with inventory, stats and log.
When clicking an eatable item in the inventory, you eat one, some have healing properties, some poison. When clicking a weapon in the inventory, you equip it.
Killing monsters gains experience, and when you have enough experience, you get skill-points to assign. Combustible things can be blown up (from barrels to fuel-trucks) and wooden crates can be destroyed (some have loot).
The left corner of the hud is a health-bar(red) and a energy-bar (green). While holding down [SHIFT] and moving, the player will run. Running requires energy, energy slowly regenerates while not running.
Traders are found on some maps (from third map and on).
You can trade your loot for more ammo, bandages or other essential equipment (quest-items can not be sold).

License:

Everything I make is GPL. You should have received a copy of the license, if not, you can view it online here: http://www.gnu.org/licenses/gpl.html I have done my best to make sure that textures and models in SabiCube doesn't infringe on any copyright, but in the case that any does, please let me know, and I'll remove them.

Contributers:
Sandie Sandgreen: coding/scripting, maps, models, textures, hud and documentation
Bill H. Soerensen: coding

Artwork: Gui cursor from Sauerbraten Enhanced Edition
Milky-way background by NASA
player/npc-models by TiZeta (animations by Sandie)
skeleton model by ScoutingNinja (animations and sword by Sandie)
Textures by PhilipK, Trak, Noctuna, Nieb, Lunaran, Luckystrike, Johnston, ikbase, blikjebier

The original Cube 2 Sauerbraten is licensed under ZLIB, and created by:
by Wouter "Aardappel" van Oortmerssen
Lee "eihrul" Salzman
Mike "Gilt" Dysart
Robert "baby-rabbit" Pointon
John "geartrooper" Siar
Quinton "Quin" Reeves and others
www.sauerbraten.org