The function to return the index of a single tile within an autotile
(given by at_index) is (at_index-1)*48 + col-1 + (row-1)*8
(where row, col, and at_index are again NOT zero-indexed)
=end
=begin
The following array lists systematic keys which are based on adjacent
walls (where 'W' is the wall itself):
1 2 3
4 W 6
7 8 9
e.g. 268 is the key that will be used to refer to the autotile
which has adjacent walls north, east, and south. For the Castle Prison
tileset (autotile #1), this is 67.
(It's a bit unwieldy, but it works.)
=end
Autotile_Keys = [
12346789,
2346789,
1246789,
246789,
1234678,
234678,
124678,
24678,
1234689,
234689,
124689,
24689,
123468,
23468,
12468,
2468,
23689,
2689,
2368,
268,
46789,
4678,
4689,
468,
12478,
1248,
2478,
248,
12346,
2346,
1246,
246,
28,
46,
689,
68,
478,
48,
124,
24,
236,
26,
8,
6,
2,
4,
0 ]
# many autotiles handle multiple situations
# this hash keeps track of which keys are identical
# to ones already defined above
Duplicate_Keys = {
123689 => 23689,
236789 => 23689,
1236789 => 23689,
34689 => 4689,
14689 => 4689,
134689 => 4689,
14678 => 4678,
34678 => 4678,
134678 => 4678,
146789 => 46789,
346789 => 46789,
1346789 => 46789,
23467 => 2346,
23469 => 2346,
234679 => 2346,
123467 => 12346,
123469 => 12346,
1234679 => 12346,
12467 => 1246,
12469 => 1246,
124679 => 1246,
124789 => 12478,
123478 => 12478,
1234789 => 12478,
146 => 46,
346 => 46,
467 => 46,
469 => 46,
1346 => 46,
1467 => 46,
1469 => 46,
3467 => 46,
3469 => 46,
4679 => 46,
13467 => 46,
13469 => 46,
14679 => 46,
34679 => 46,
134679 => 46,
128 => 28,
238 => 28,
278 => 28,
289 => 28,
1238 => 28,
1278 => 28,
1289 => 28,
2378 => 28,
2389 => 28,
2789 => 28,
12378 => 28,
12389 => 28,
12789 => 28,
23789 => 28,
123789 => 28,
1247 => 124,
2369 => 236,
147 => 4,
247 => 24,
14 => 4,
47 => 4,
1478 => 478,
3478 => 478,
4789 => 478,
134789 => 478,
14789 => 478,
13478 => 478,
34789 => 478,
1234 => 124,
1247 => 124,
1249 => 124,
12347 => 124,
12349 => 124,
12479 => 124,
123479 => 124,
1236 => 236,
2367 => 236,
2369 => 236,
12367 => 236,
12369 => 236,
23679 => 236,
123679 => 236,
12368 => 2368,
23678 => 2368,
123678 => 2368,
12348 => 1248,
12489 => 1248,
123489 => 1248,
1689 => 689,
3689 => 689,
6789 => 689,
13689 => 689,
16789 => 689,
36789 => 689,
136789 => 689,
12689 => 2689,
26789 => 2689,
126789 => 2689,
23478 => 2478,
24789 => 2478,
234789 => 2478,
12 => 2,
23 => 2,
27 => 2,
29 => 2,
123 => 2,
127 => 2,
129 => 2,
237 => 2,
239 => 2,
279 => 2,
1237 => 2,
1239 => 2,
1279 => 2,
2379 => 2,
12379 => 2,
14 => 4,
47 => 4,
34 => 4,
49 => 4,
147 => 4,
134 => 4,
347 => 4,
349 => 4,
149 => 4,
479 => 4,
1347 => 4,
1479 => 4,
1349 => 4,
3479 => 4,
13479 => 4,
16 => 6,
36 => 6,
67 => 6,
69 => 6,
136 => 6,
167 => 6,
169 => 6,
367 => 6,
369 => 6,
679 => 6,
1369 => 6,
3679 => 6,
1367 => 6,
1679 => 6,
13679 => 6,
78 => 8,
89 => 8,
18 => 8,
38 => 8,
138 => 8,
789 => 8,
178 => 8,
189 => 8,
378 => 8,
389 => 8,
1789 => 8,
3789 => 8,
1378 => 8,
1389 => 8,
13789 => 8,
1468 => 468,
3468 => 468,
13468 => 468,
2467 => 246,
2469 => 246,
24679 => 246,
2348 => 248,
2489 => 248,
23489 => 248,
1268 => 268,
2678 => 268,
12678 => 268,
148 => 48,
348 => 48,
489 => 48,
1348 => 48,
1489 => 48,
3489 => 48,
13489 => 48,
168 => 68,
368 => 68,
678 => 68,
1368 => 68,
1678 => 68,
3678 => 68,
13678 => 68,
234 => 24,
247 => 24,
249 => 24,
2347 => 24,
2349 => 24,
2479 => 24,
23479 => 24,
126 => 26,
267 => 26,
269 => 26,
1267 => 26,
1269 => 26,
2679 => 26,
12679 => 26,
}
复制代码
[LINE]1,#dddddd[/LINE]此贴于 2008-7-22 7:29:01 被版主darkten提醒,请楼主看到后对本贴做出回应。 [LINE]1,#dddddd[/LINE]版务信息:版主帮忙结贴~作者: yuscvscv 时间: 2008-7-17 10:12
提示: 作者被禁止或删除 内容自动屏蔽作者: 轮回者 时间: 2008-7-17 18:30
这似乎是国外的脚本吧,问下原始地址在哪?作者: dongdongok 时间: 2008-7-17 20:35
我没原始地址,这个也是在这里找到的,那时是为了要个全地图都是黑的,只有走到的地方显示出地图,然后就有人发出这个脚本拉,可不知道怎么用啊?作者: 荆芥 时间: 2008-7-17 20:41
这不是有注释么~
不过是全英文。。。。。。。
=begin
============
Fog of War - version 1.0 (2005-10-26)
============
by Wachunga
0.8 - original release
0.85
- added colour parameter to map names
- fixed bug where map grids overlapped
0.9
- switched over to a tilemap (from a sprite)
- now more compatible with minimap scripts (but they'll have to take
extra tilemap into account)
1.0
- switched over to an autotile instead of using a custom tileset
* edges looks nicer, but gradual fading had to be removed
* colour parameter no longer possible (set by autotile)
- move event (including jumping and speed changes) bug fixed
- teleportation bug fixed
- some optimization
- made compatible with Cogwheel's Pixel Movement script
(see http://www.rmxp.net/forums/index.php?showtopic=24716 for details)
Note:
There's no need to add the autotile via the database. Just place the file in
the autotile folder, import it, and change the FOW_AT_NAME constant to
the appropriate filename. To change the colour of the fog of war, create a
new autotile.
To indicate a map is to have fog of war (i.e. its tiles are dark until
the player gets within visual range), include <FoW> in its name. You may
also optionally specify a range between 0 and 3. This may also be
included in the map name, as in this example:
"your-map-name <FoW><2>" (range is 2)
The ranges work as follows:
range = 0 reveals just the square on which the player stands
range = 1 is the same as range 0 plus four adjacent tiles
i.e. @
@P@
@
range = 2 is the same as range 1 plus eight additional tiles
i.e. @
@@@
@@P@@
@@@
@
range = 3 (default) is the same as range 2 plus twelve additional tiles
i.e. @
@@@
@@@@@
@@@P@@@
@@@@@
@@@
@
=end
[LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~作者: dongdongok 时间: 2008-7-19 21:48
这注解也看不懂,不知道怎么弄的. [LINE]1,#dddddd[/LINE]版主对此帖的评论:『恶补英文,或者使用翻译器就看得懂了...』,积分『-0』。这些被扣积分的一半会用于对本帖正确答案的悬赏。