看板 mud_sanc 關於我們 聯絡資訊
※ 引述《doall (狂人)》之銘言: : 總共60格。 : 低→高:(除了X,Y有所改變之外,Z方位亦改變1格) : §§:瀑布、﹋:水、=:橋 : 4_1_17 :祭壇 : 有人要給建議嗎?? 你可能打算用 auto_exits.c 去做,那要注意一點,就是各個 「一般房間」(x_x_x.c)理論上只有 long 會不一樣,其它的程 式段應該都是一樣的。 在這情況下,那些相同的程式段,最好也挪到 auto_exits.c, 房間檔應該會簡化到底下.. inherit __DIR__"auto_exits.c"; void create() { ::create(); // <= 呼叫 auto_exits.c 裡頭的 create set("short",WHT+"西大道"+NOR); set("long",@LONG   銀白雪花依然飄落,似乎終年不停。道旁頂了層白的銀杏,隨著 冷冽的風艱難的晃著頭。在南北兩方好似各有著一條青磚小道,因著 兩旁高大的建築顯得相當狹小。 LONG ); reset(); } auto_exits.c 則在最前頭新增底下內容... inherit ROOM; 在檔案結尾處新增底下內容... void create() { mapping room_exit=([]); int limit_num; int *coor; string *other; ::create(); seteuid(getuid(); other = ({"",""});//""內分別輸入enter and out的檔案位置,若無,請保持空白 //north = 1, south = 2, east = 4, west = 8, up = 16, down = 32 //limit_num = 出口代表數字之總和。 limit_num = 63; set("light",1); coor = getcoordination(); room_exit = set_exit(coor[0],coor[1],coor[2],other[0],other[1],limit_num); set("exits",room_exit["exits"]); set("coordinate","("+coor[0]+","+coor[1]+","+coor[2]+")"); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.231.120.132
doall:原來可以這樣做ㄛ??可是不在X_Y_Z.c裡面呼叫getcoordination 12/06 16:32
doall:會不會抓到的檔名是auto_exits.c??? 12/06 16:34
doall:來試試看好了! 12/06 16:37
doall:似乎不行...因為我在x_y_z.c中又寫了限定要判斷哪些出口 12/06 16:40
doall:還有enter and out的出口 12/06 16:41
doall:除非可以在後面再傳回other和limit_num的值 12/06 16:45