Add Sandbox to Tutorials.ocf

alut-include-path
Martin Strohmeier 2017-03-28 16:09:35 +02:00
parent 52caf696e6
commit e62938b3e4
35 changed files with 2686 additions and 0 deletions

View File

@ -0,0 +1,3 @@
K-Pone - God's Hand (Original hand image comes from Icon_Hand)
eleazzaar - Teleporter, CC-BY 3.0 http://opengameart.org/content/painterly-spell-icons-part-4

View File

@ -0,0 +1,15 @@
Eine Karte zum Unfug treiben, ohne wenn und aber. Hier kannst du dich nach Lust und Laune austoben und kannst hier alles ausprobieren, was du möchtest.
Folgende Werkzeuge stehen dir hier zur Verfügung:
Landschaftsgenerator:
Erstelle eine Landschaft, wie sie dir gefällt. Du kannst jederzeit eine neue Landschaft generieren lassen. Du kannst auswählen, was du in der Landschaft vorfinden möchtest. Ob Wüste, Schneelandschaft oder Unterwasserwelt: Du entscheidest.
Materialpinsel:
Was Entwickler im Editor können, kannst du hier mit diesem Werkzeug erledigen. Die ganze Materialienpalette steht dir zur Verfügung.
Objekterzeuger:
Was fehlt, kannst du hiermit erschaffen, ganz egal, ob Gegenstände, Gebäuden oder Fahrzeuge.
Marker:
Ein praktisches, vielseitiges Hilfmittel. Kann als Respawnpunkt und als Teleporter benutzt werden.

View File

@ -0,0 +1,15 @@
A scenario to play around with all the cool stuff.
The following tools can be used:
Landscape Generator:
Create the landscape as you wish. You can choose what kind of things you want to have on the map. Desert, Snowlands or Underwaterworld, it's up to you.
Material Brush:
What developers can do in the editor can be done by you using this tool. You get the full palette of materials.
Object Creator:
Whatever is missing, you could create it using this tool, no matter if object, building or vehicle.
Marker:
A tool to mark the spot. Can be used for Respawns and Teleports.

View File

@ -0,0 +1,7 @@
[DefCore]
id=GodsHand
Version=5,2,0,1
Category=C4D_Object
Width=64
Height=64
Offset=-32,-32

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -0,0 +1,35 @@
/*
God's Hand, a tool to create objects.
@author: K-Pone
*/
local Name = "$Name$";
local Description = "$Description$";
func Initialize()
{
}
func ControlUse(object clonk, x, y)
{
var objdef = clonk.ObjectSpawnDefinition;
if (objdef == Marker)
{
var marker = clonk->PlaceNewMarker();
if (marker) marker->SetPosition(clonk->GetX() + x, clonk->GetY() + y);
}
else
{
clonk->CreateObject(objdef, x, y);
}
Sound("UI::Click", true, nil, clonk->GetOwner());
}

View File

@ -0,0 +1,2 @@
Name=Hand Gottes
Description=Erzeugt zeugs. Was du willst, wo du willst.

View File

@ -0,0 +1,2 @@
Name=God's Hand
Description=Creates things. What you want, where you want.

View File

@ -0,0 +1,52 @@
func InitializeMap(proplist map)
{
if (!MapGenPreset) MapGenPreset = "FlatLand"; // For the initial map on scenario start
// These were set in the MapGen UI
Resize(MapGenSizeWidth ?? 80, MapGenSizeHeight ?? 50);
if (MapGenPreset == "FlatLand")
{
Draw("Earth", { Algo = MAPALGO_Rect, X = 0, Y = MapGenSizeHeight / 2, Wdt = MapGenSizeWidth, Hgt = MapGenSizeHeight / 2 + 1 } );
}
else if (MapGenPreset == "Skylands")
{
var islands =
{
Algo = MAPALGO_Turbulence,
Op = { Algo=MAPALGO_RndChecker, Wdt=5, Hgt=2, Ratio = 10 }
};
Draw("Earth", islands);
}
else if (MapGenPreset == "Caves")
{
Draw("Earth", { Algo = MAPALGO_Rect, X = 0, Y = 0, Wdt = MapGenSizeWidth, Hgt = MapGenSizeHeight } );
for (var i = 0; i < 3; i++)
{
var tunnels =
{
Algo = MAPALGO_Polygon,
X = [Random(MapGenSizeWidth),Random(MapGenSizeWidth)],
Y = [Random(MapGenSizeHeight),Random(MapGenSizeHeight)],
Wdt = Random(10) + 3,
Empty = true,
Open = true
};
Draw("Tunnel", tunnels);
}
}
return true;
}
global func PostMapGen()
{
// This is called after the map is generated. Should be used to place environment objects.
}

View File

@ -0,0 +1,8 @@
[DefCore]
id=Marker
Version=5,2,0,1
Category=C4D_StaticBack | C4D_IgnoreFoW
Width=20
Height=20
Offset=-10,-10
Picture=0,0,64,64

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,55 @@
/*
Marker
@author: K-Pone
*/
local Name = "$Name$";
local Description = "$Description$";
local markerindex;
local respawnmarker = false;
func Initialize()
{
this.Visibility = VIS_Owner | VIS_God;
SetGraphics(nil, Dummy);
}
func SetIcon(number)
{
markerindex = number;
SetGraphics(Format("%d", number), Icon_Number, 1, GFXOV_MODE_Base);
SetObjDrawTransform(350, 0, 2000, 0, 350, 2000, 1);
SetClrModulation(RGBa(255, 255, 255, 160) , 1);
}
func GetIndex()
{
return markerindex;
}
func IsIndex(index)
{
return index == markerindex;
}
func IsRespawnMarker() { return respawnmarker; }
global func GetMarkerForIndex(index, plr)
{
return FindObject(Find_ID(Marker), Find_Owner(plr), Find_Func("IsIndex", index));
}
global func GetNextFreeMarkerIndex(plr)
{
for (var i = 0; i <= 9; i++)
{
if (GetMarkerForIndex(i, plr)) continue;
return i;
}
return nil;
}

View File

@ -0,0 +1,2 @@
Name=Marker
Description=Ein einfacher Marker oder Wegpunkt

View File

@ -0,0 +1,2 @@
Name=Marker
Description=A simple Marker or Waypoint

View File

@ -0,0 +1,7 @@
[Head]
Title=Sandbox Reloaded
Icon=17
[Landscape]
SkyScrollMode=2
Secret=false

View File

@ -0,0 +1,38 @@
/*
Sandbox Reloaded
@author: K-Pone
*/
func Initialize()
{
if (!MapGenSizeWidth) MapGenSizeWidth = 80;
if (!MapGenSizeHeight) MapGenSizeHeight = 50;
if (!MapGenPreset) MapGenPreset = "FlatLand";
}
func InitializePlayer(int plr)
{
var crew = GetCrew(plr);
crew->ShowSandboxUI();
crew->CreateContents(GodsHand);
crew->CreateContents(SprayCan);
crew->CreateContents(Teleporter);
GiveAllKnowledge();
crew.MaxContentsCount = 8;
}
func GiveAllKnowledge()
{
var i, id;
while (id = GetDefinition(i++))
{
SetPlrKnowledge(nil, id);
}
}

View File

@ -0,0 +1,14 @@
[DefCore]
id=SprayCan
Version=6,0
Category=C4D_Object
Width=9
Height=3
Offset=-4,-2
Vertices=4
VertexX=-4,4,-4,4
VertexY=1,1,-2,-2
VertexFriction=40,40,40,40
Value=5
Mass=10
Rotate=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

View File

@ -0,0 +1,119 @@
/* Spray can */
local last_x, last_y, last_ldx, last_ldy;
local paint_col;
local paint_bg;
local max_dist = 50;
local brushmode = 1; // 1 = Draw Brush, 2 = Quad Brush, 3 = Eraser
func Construction()
{
SetColor(RGB(Random(256),Random(256),Random(256)));
}
// Impact sound
public func Hit()
{
Sound("Hits::GeneralHit?");
}
// Item activation
public func ControlUseStart(object clonk, int x, int y)
{
paint_col = clonk.SelectedBrushMaterial;
paint_bg = clonk.SelectedBrushBgMaterial;
brushmode = clonk.SelectedBrushMode;
return ControlUseHolding(clonk, x, y);
}
public func HoldingEnabled() { return true; }
public func ControlUseHolding(object clonk, int new_x, int new_y)
{
// Out of reach? Stop spraying. // Not for Gods like Sandboxers ;)
//if (Distance(0,0,new_x,new_y) > max_dist)
//{
//SetAction("Idle");
//return true;
//}
// Work in global coordinates
new_x += GetX(); new_y += GetY();
// (re-)start spraying
if (GetAction() != "Spraying") StartSpraying(clonk, new_x, new_y);
// Spray paint if position moved
if (new_x==last_x && new_y == last_y) return true;
var wdt = clonk.SelectedBrushSize;
var dx=new_x-last_x, dy=new_y-last_y;
var d = Distance(dx,dy);
var ldx = dy*wdt/d, ldy = -dx*wdt/d;
if (!last_ldx && !last_ldy) { last_ldx=ldx; last_ldy=ldy; }
if (brushmode == 1)
{
DrawMaterialQuad(paint_col, last_x-last_ldx,last_y-last_ldy, last_x+last_ldx,last_y+last_ldy, new_x+ldx,new_y+ldy, new_x-ldx,new_y-ldy, paint_bg);
}
else if (brushmode == 2)
{
DrawMaterialQuad(paint_col, new_x - (wdt / 2), new_y - (wdt / 2), new_x + (wdt / 2), new_y - (wdt / 2), new_x + (wdt / 2), new_y + (wdt / 2), new_x - (wdt / 2), new_y + (wdt / 2), paint_bg );
}
else if (brushmode == 3)
{
// Draw something to set BG Mat to sky (workaround for not being able to draw Sky via DrawMaterialQuad)
DrawMaterialQuad(paint_col, new_x - (wdt / 2), new_y - (wdt / 2), new_x + (wdt / 2), new_y - (wdt / 2), new_x + (wdt / 2), new_y + (wdt / 2), new_x - (wdt / 2), new_y + (wdt / 2), DMQ_Sky );
ClearFreeRect(new_x - (wdt / 2), new_y - (wdt / 2), wdt, wdt);
}
last_x = new_x; last_y = new_y;
last_ldx = ldx; last_ldy = ldy;
return true;
}
public func ControlUseStop(object clonk, int x, int y)
{
SetAction("Idle");
return true;
}
public func ControlUseCancel(object clonk, int x, int y)
{
SetAction("Idle");
return true;
}
private func StartSpraying(object clonk, int x, int y)
{
// Go into spray mode and place an initial blob
last_x = x; last_y = y;
last_ldx=last_ldy=0;
var r = Random(90), wdt = 2;
var ldx = Sin(r, wdt), ldy = Cos(r, wdt);
DrawMaterialQuad(paint_col, x-ldx,y-ldy, x-ldy,y+ldx, x+ldx,y+ldy, x+ldy,y-ldx, paint_bg);
SetAction("Spraying");
return true;
}
local ActMap = {
Spraying = {
Prototype = Action,
FacetBase = 1,
Length = 1,
Delay = 1,
Name = "Spraying",
Sound = "SprayCan::SprayCan",
NextAction = "Spraying",
}
};
func Definition(def) {
SetProperty("PictureTransformation",Trans_Rotate(-30,0,1,1),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,37 @@
material SprayCan
{
receive_shadows on
technique
{
pass SprayCan
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.000000 0.000000 0.000000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit Overlay
{
texture Overlay.png
tex_address_mode wrap
filtering trilinear
colour_op_ex modulate src_texture src_player_colour
}
texture_unit SprayCan
{
texture SprayCan.jpg
tex_address_mode wrap
filtering trilinear
colour_op_ex blend_current_alpha src_current src_texture
}
texture_unit Light
{
// apply lighting -- note this texture unit does not need an
// actual texture image: no hardware TIU will be used.
colour_op_ex modulate src_current src_diffuse
alpha_op_ex modulate src_current src_diffuse
}
}
}
}

View File

@ -0,0 +1,2 @@
Name=Sprühdose
Description=Lasse den kleinen Künstler in dir heraus!

View File

@ -0,0 +1,2 @@
Name=Spray can
Description=Let out the little artist in you!

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
TooltipObjectspawn=Objekte erzeugen
TooltipLandscapeBrush=Landschaft zeichnen
TooltipMarker=Marker
TooltipMapGen=Kartengenerator
TooltipTweaks=Cheats und anderes tolles Zeugs
GodsHandDisplayTT=Dieses Objekt wird mit der Hand Gottes platziert (zum Ändern \"Objekte erzeugen\" aufrufen und \"Hand Gottes\" als Ziel auswählen)
OSCatProductionResources=Rohstoffe
OSCatFoodstuff=Nahrungsmittel
OSCatLiquids=Flüssigkeiten
OSCatTools=Werkzeuge
OSCatWeapons=Waffen
OSCatExplosives=Sprengstoff
OSCatVehicles=Fahrzeuge
OSCatAnimals=Tiere
OSCatPlants=Pflanzen
OSCatGodTools=Götterspielzeug
OSHintTarget=Tipp! Du kannst hiermit einstellen, wo du Objekte erzeugen möchtest. Stelle dies auf \"Hand Gottes\" um auszuwählen, welches Objekt du mit der Hand Gottes erzeugen möchtest.
OSTargetClonk=Ziel: Clonk/Inventar
OSTargetGodsHand=Ziel: Hand Gottes
OSTargetClonkTT=Das Objekt wird (wenn möglich) im Inventar des Clonks erzeugt
OSTargetGodsHandTT=Das Objekt kann mit der Hand Gottes erzeugt werden
MatEarth=Erde
MatEarthSpongy=Erde (Schwammig)
MatEarthRoot=Erde (Rau)
MatSand=Sand
MatSandDry=Trockener Sand
MatIce=Eis
MatIce2=Eis (Anders)
MatSnow=Schnee
MatRock=Stein
MatRockSmooth=Stein (Weich)
MatGranite=Granit
MatOre=Erz
MatGold=Gold
MatCoal=Kohle
MatFirestone=Feuerstein
MatRuby=Rubin
MatAmethyst=Amethyst
MatAshes=Asche
MatBrick=Steinmauer
MatBrickSoft=Steinmauer (Schwach)
MatEverrock=Everrock
MatWater=Wasser
MatAcid=Säure
MatLava=Lava
MatDuroLava=Magma
MatOil=Öl
MatTunnel=Tunnel (Hintergrund)
MatTunnelBrick=Steinmauer (Hintergrund)
MatBgSky=Himmel
MatBgTunnel=Tunnel
MatBgBricks=Steinmauer
MBMaterialFg=Material
MBMaterialBg=Hintergrundmaterial
MBBrushSize=Pinselgröße
MBBrushMode=Pinselmodus
MBBrushModeBrush=Pinsel
MBBrushModeQuad=Quadrat
MBBrushModeErase=Radierer
MarkerNotSet=Marker nicht gesetzt
PlaceMarker=Marker setzen
RemoveMarker=Marker entfernen
GoToMarker=Teleport
MapGenButtonGenerate=Karte generieren!
MapGenSizeWidth=Kartenbreite
MapGenSizeHeight=Kartenhöhe
MapGenMapType=Kartentyp
MapGenTPCustom=Anpassen
MapGenTPFlatLand=Flachland
MapGenTPSkylands=Himmelsinseln
MapGenTPCaves=Höhlen
TweakInvincible=Unverwundbarkeit (Gott-Modus)
OptActivate=Aktivieren
OptDeactivate=Deaktivieren
TweakSkinChoose=Skin wechseln
OptSkin1=Abenteurer
OptSkin2=Steampunk
OptSkin3=Alchemist
OptSkin4=Farmer

View File

@ -0,0 +1,7 @@
[DefCore]
id=Teleporter
Version=5,2,0,1
Category=C4D_Object
Width=64
Height=64
Offset=-32,-32

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,34 @@
/*
Teleporter
@Author: K-Pone
*/
local Name = "$Name$";
local Description = "$Description$";
func Initialize()
{
}
func ControlUse(object clonk, x, y)
{
var gx, gy;
gx = clonk->GetX() + x;
gy = clonk->GetY() + y;
if (gx < 0 || gx >= LandscapeWidth() || gy < 0 || gy >= LandscapeHeight())
{
clonk->Sound("UI::Error");
return;
}
clonk->SetPosition(gx, gy);
clonk->Fireworks();
clonk->Sound("warp");
}

View File

@ -0,0 +1,2 @@
Name=Teleporter
Description=Fliegen war gestern. Teleportieren ist viel coolerer als wie alles andere.

View File

@ -0,0 +1,2 @@
Name=Teleporter
Description=Flying is lame. Teleporting is what the trendy kids do today.

View File

@ -0,0 +1,2 @@
DE:Sandkasten
US:Sandbox