count_stored war auf jeden Fall die richtige Idee.
1
2
3
4
5
2
3
4
5
on:use 	{ 	$perlen = count_stored ("self", 108); 	msg "Die sprechende Kiste hat $perlen Perle(n)!"; 	}
edited 1×, last 10.07.10 08:20:38 pm
on:use 	{ 	$perlen = count_stored ("self", 108); 	msg "Die sprechende Kiste hat $perlen Perle(n)!"; 	}
on:use {$perlen = count_stored ("object",Object_ID, Item_ID); msg "Die sprechende Kiste hat $perlen Perle(n)!";}
on:start { timer "self",3000,0,"fart"; } on:fart { play "fart.wav"; $id=create ("item",72); setpos "item",$id,getx("self"),getz("self"),getz("self")unit 1; }
on:start { timer "self",3000,0,"fart"; } on:fart { play "fart.wav"; $id=create ("item",72); $x=getx("unit",1); $y=gety("unit",1); $z=getz("unit",1); setpos "item",$id,$x,$y,$z; }
id=225 name=Lagerhaus group=building icon=gfx\warehouse\icons\icon_Lagerhaus.bmp model=gfx\warehouse\Lagerhaus.3DS health=1000 scale=1.5 mat=wood script=start on:create { 	$yaw_Lagerhaus=getyaw("self"); 	$x_Lagerhaus=getx("self"); 	$y_Lagerhaus=gety("self"); 	$z_Lagerhaus=getz("self"); } script=end id=226 name=Holzlager group=building icon=gfx\warehouse\icons\icon_Lagerhaus_Holzlager.bmp model=gfx\warehouse\Lagerhaus_Holzlager01.3DS health=500 scale=1.5 mat=wood editor=0 script=start on:build_finish { 	$id=create("object",226); 	setpos "object",$id,$x_Lagerhaus,$y_Lagerhaus,$z_Lagerhaus; 	setrot "object",$id,"self",$yaw_Lagerhaus,"self"; 	free "self"; } script=end	 id=227 name=Steinlager group=building icon=gfx\warehouse\icons\icon_Lagerhaus_Steinlager.bmp model=gfx\warehouse\Lagerhaus_Steinlager01.3DS health=500 scale=1.5 mat=wood editor=0 script=start on:build_finish { 	$id=create("object",227); 	setpos "object",$id,$x_Lagerhaus,$y_Lagerhaus,$z_Lagerhaus; 	setrot "object",$id,"self",$yaw_Lagerhaus,"self"; 	free "self"; } script=end
### Lagerhaus id=25 group=storage objectid=225 script=start 	lockbuilding 25; 	unlockbuilding 26; 	unlockbuilding 27; script=end ### Holzlager (Lagerhaus) id=26 group=storage objectid=226 buildspace=at object atobject=225 script=start 	lockbuilding 27; script=end ### Steinlager (Lagerhaus) id=27 group=storage objectid=227 buildspace=at object atobject=225 script=start 	lockbuilding 26; script=end
{ 		$tmp1=mapsize(); 		$tmp2=mapsize(); 		$x=1; 		$z=1; 		msg $tmp1,3; 		loop ("count",$tmp1){ 			loop ("count",$tmp2){ 				terrain $x,$z,2,-0.25; 				$x++; 			} 			$z++; 		} 		freevar $tmp1; 		freevar $tmp2; 		freevar $x; 		freevar $z; 	}
on:start { $map_tmp=mapsize(); $mapx=0; $mapz=0; loop("count",$tmp) { event "sink";	 $mapx++; } } on:sink { loop("count",$map_tmp) { terrain $mapx, $mapz, 3, -20; $mapz++; 	 } }
on:use { 		$map_tmp=mapsize(); 		$mapx=1; 		$mapz=1; 		loop("count",$map_tmp) { 			event "raise"; 			$mapx++; 		} 	} 	on:raise { 		loop("count",$map_tmp) { 		terrain $mapx, $mapz, 2, 5; 		$mapz++; 		} 	}
$map_tmp=$map_tmp-1;