2. Mit kleinen Scripts anfangen (z.b. kleine Nachrichten links auf dem Bildschirm bei Benutzen)
3. Im US Wiki mal auf mehreren Seiten nachlesen
4. Befehlsreferenz mal anschauen
5. Wenn du was konkret nicht verstehst fragen
Scripts
Scripting - Fragen/Probleme
random und if-elseif-else lösen.
music . Das zu nutzende Event ist on:use
play noch
stopsoundson:use {
if (random(3)==1) {
stopsounds;
play "Lied1.mp3";
} else {
stopsounds;
play "Lied2.mp3";
} else {
stopsounds;
play "Lied3.mp3";
}
}
Mein Problem
dialoge_erstellen
find oder
store oder sowas.on:use {
	$tmp=random(1,3);
	if ($tmp==1) {
		stopsounds;
		play "Lied1.mp3";
	} elseif ($tmp==2) {
		stopsounds;
		play "Lied2.mp3";
	} else {
		stopsounds;
		play "Lied3.mp3";
	}
	freevar $tmp;
}
on:use {
	$tmp=random(1,3);
	$tmp=join("Lied",$tmp,".mp3");
	stopsounds;
	play $tmp;
	freevar $tmp;
}
on:start {
$music=0;
}
/* Weil ich nicht weiß, welchen Wert $music Anfangs hat.
on:use {
$music++;
if ($music==1) {
stopmusic;
music "Lied1";
}
//Erzeugt einen möglichst eindeutigen String für
//das Cache-Verzeichnis
on:mkcachestring {
	local $alphabet,$length,$buffer,$result;
	global $cacheDir;
	$alphabet="4bcdefghijklmn0pqrstuvwyz";
	$length=length($alphabet);
	$result="";
	loop("count",5) {
		$buffer=random(1,$length);
		$buffer=extract($alphabet,$buffer,1);
		$result=join($result,$buffer);
	}
	$cacheDir=join("cache\clonkadv\",$result);
	freevar $alphabet,$length,$buffer,$result;
}
on:wantchangeM02 {
	if (fileexists($cacheDir)==0) { mkdir $cacheDir; }
	$tmp=join($cacheDir,"\map01.s2");
	savemap $tmp,1,1,1,1,1,1;
	$tmp=join($cacheDir,"\map02.s2");
	if (fileexists($tmp)==1) {
		loadmap $tmp,1,1,1,1,1,1;
	} else {
		loadmap "maps\clonkadv\map02.s2",1,1,1,1,1,1;
	}
}
on:start {
	event "mkcachestring";
}
on:wantchangeM01 {
	if (fileexists($cacheDir)==0) { mkdir $cacheDir; }
	$tmp=join($cacheDir,"\map02.s2");
	savemap $tmp,1,1,1,1,1,1;
	$tmp=join($cacheDir,"\map01.s2");
	if (fileexists($tmp)==1) {
		loadmap $tmp,1,1,1,1,1,1;
	} else {
		loadmap "maps\clonkadv\map01.s2",1,1,1,1,1,1;
	}
}
projectile