|
沙发

楼主 |
发表于 2020-11-29 10:38:53
|
只看该作者
剧本实例:2p—蛇怪之穴
制作联机对战剧本分两个步骤
绘制地图
打开地图编辑器绘制地图。2p—蛇怪之穴的地图已在资源包中,具体是<data>/multiplayer/maps/2p_Caves_of_the_Basilisk.map。
作为一种习惯,多人对战时地图集中放在<data>/multiplayer/maps目录下。
编写剧本脚本
联机对战脚本一般只需要一个*.cfg。2p—蛇怪之穴的脚本已在资源包中,具体是<data>/multiplayer/scenarios/2p_Caves_of_the_Basilisk.cfg。
多人对战时剧本必须集中放在<data>/multiplayer/scenarios目录下。为什么“必须”?——打开<data>/_main.cfg,它当中有这么几行:- .....................
- {core/}
- #ifdef MULTIPLAYER
- {multiplayer/}
- #endif
- {campaigns/}
- ....................
复制代码 {multiplayer/}指就是<data>/multiplayer/,也就是说编辑器形成multiplayer.bin时它默认收集<data>/multiplayer/下的[multiplayer]块。
[multiplayer]对应的bin文件是multiplayer.bin。
<data>/multiplayer/scenarios/2p_Caves_of_the_Basilisk.cfg
- # 要没意外,对战剧本翻译统一使用wesnoth-multiplayer.mo
- #textdomain wesnoth-multiplayer
- # multiplayer是关卡块标签,它的作用类似单机关卡中的[scenario]标签
- # [multiplayer]和[scenario]块中内容也是几乎一样的。
- [multiplayer]
- # 定义一宏,该宏实现功能是在(X, Y)坐标处放置一只HP=1石化部队
- #define UNIT_PETRIFY TYPE NAME_STRING X Y
- [unit]
- # cityno=0指示是流浪部队
- cityno=0
- type={TYPE}
- name={NAME_STRING}
- heros_army=203
- x={X}
- y={Y}
- unrenamable=yes
- random_traits=no
- [status]
- petrified=yes
- [/status]
- [modifications]
- [trait]
- id=remove_hp
- name=_ "statue"
- [effect]
- # 总HP比平常小100%,但它会确何HP至少是1,因而会被置为1
- apply_to=hitpoints
- increase_total=-100%
- [/effect]
- [effect]
- # 该部队移动力置0
- apply_to=movement
- set=0
- [/effect]
- [/trait]
- [/modifications]
- [/unit]
- #enddef
- id=multiplayer_Basilisk
- name= _ "2p — Caves of the Basilisk"
- map_data="{multiplayer/maps/2p_Caves_of_the_Basilisk.map}"
- description= _ "These caves were once the lair of Chak’kso Ney’yks, a legendary Elder Basilisk. The petrified forms of his victims remain as monuments to his savage power."
- random_start_time="no"
- {DEFAULT_SCHEDULE}
- {DEFAULT_MUSIC_PLAYLIST}
- [side]
- [ai]
- villages_per_scout=8
- [/ai]
- # 势力编号。它必须从1始,逐1增
- side=1
- controller=human
- # 强制指定集团,意味着游戏大厅中不能更改担当该势力的集团
- leader=3
- user_team_name= _ "teamname^North"
- fog=yes
-
- # 在(21,4)坐标处放置一个城市,该城市属于side=1,城市编号1,城市序号127(它和武将被统一编号)
- {ANONYMITY_LOYAL_MERITORIOUS_CITY 1 1 21 4 127 0}
- [+artifical]
- # 城市一开始“空闲武将”
- service_heros=3,7,8,9,13,15,16,35,36,37,39,45,46,47,63,83,86,87,88,94,97,99,101,102,107,108,118,120,122
- # 属于该城市的经济区
- economy_area=(16,4),(16,5)
- # 该城市辖区(左上角x坐标,左上角y坐标,宽度,高度)
- district=(14,1,15,11)
- [/artifical]
- [/side]
- [side]
- [ai]
- villages_per_scout=8
- [/ai]
- side=2
- controller=human
- # 强制指定集团,意味着游戏大厅中不能更改担当该势力的集团
- leader=139
- user_team_name= _ "teamname^South"
- fog=yes
- [village]
- x=11
- y=19
- [/village]
-
- {ANONYMITY_LOYAL_MERITORIOUS_CITY 2 2 21 21 130 0}
- [+artifical]
- service_heros=6,14,20,21,22,23,24,25,26,27,28,29,30,41,100,115,116,139,156,182,183,187,188,191,193
- economy_area=(26,19),(26,20)
- district=(14,14,15,11)
- [/artifical]
- [/side]
- [side]
- side=3
- color=black
- # 存在这个势力目的是为显示那些石化部队
- # controller=null使得这个势力被置空
- controller=null
- leader=203
- # allow_player=no使得游戏大厅II中不会显示这个势力信息
- allow_player=no
- no_leader=yes
- hidden=yes
- # 以下放置四只石化部队
- # wmllint: local spelling Turin
- {UNIT_PETRIFY "horseman1" "" 22 12}
- [+unit]
- facing=sw
- description=_ "He had lived there for ages upon ages, in the depths of the water, preying upon the various fish and frogs and merfolk that entered his domain. It was his lake, no other's, and though it was not large, he was its master. Then, the Basilisk came, and looked into the Serpent's eyes. And the Serpent had not died, but it was no longer alive. Thus the new lord of the lake had arrived.
- (inscribed by Turin)"
- [/unit]
- # wmllint: local spelling Fynmiir
- {UNIT_PETRIFY "footman1" "" 25 14}
- [+unit]
- facing=sw
- description=_ "A brave hero of Wesnoth's Golden Age, this great rider and commander of men came to this evil place while on a raid against the orcs. Caught unaware by the foul creatures, many of his fellows were killed, but he fought valiantly, slaying many a foe. But alas! The foul Basilisk turned him to stone even as he slew the last orc. Now all that is left is a stark reminder of his once great bearing and strength.
- (inscribed by Fynmiir)"
- [/unit]
- # wmllint: local spelling Rilhon Eloralduil Paterson
- {UNIT_PETRIFY "bowman1" _"Rilhon" 20 12}
- [+unit]
- description=_ "This brave warrior, known as Rilhon among the Naga, heard tell of a fabulous treasure that had been lost in these watery caves- a spear whose head was said to have been fashioned from the tooth of Chak'kso Ney'yks, an Elder Basilisk slain long ago by the Elvish hero, Eloralduil. According to the legend, the weapon rested somewhere on the bottom of this very lake (Ruaskkolin Lake, named for a well-known Sea Serpent who made it his home). Having prepared himself for battle with the Serpent, Rilhon met with two rather large surprises. The first was the petrified form of Ruaskkolin the Serpent. The second was the very-much-alive Chak'kso Ney'yks, who was, oddly enough, in possession of all of his teeth.
- (inscribed by Paterson)"
- [/unit]
- # wmllint: local spelling MJQ
- {UNIT_PETRIFY "mage1" "" 17 11}
- [+unit]
- facing=sw
- description=_ "Through waves and rocky channels
- blue and white
- she pulled and pushed the tides
- and taught the fishes how to speak to planets
- silver green
- with magic
- running from her spirit into skins of kelp and shells of snails
- a twisting of her tail and hands
- she sent her songs to run on pin-tipped legs about the sands
- and now
- and now the strangest pause
- for years and years
- she hasn't moved her eyes
- (inscribed by MJQ)"
- [/unit]
- [/side]
- # 此个cfg中自定义了UNIT_PETRIFY宏,别的cfg不会用上该宏。
- # 作为一种习惯,退出这cfg前最好删掉本文件定义且别的文件不会用的宏
- #undef UNIT_PETRIFY
- [/multiplayer]
复制代码 |
|