青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當(dāng)自強(qiáng)而不息

Putting Together a Full Game(5)

 

Developing the Scripts

You control all The Tower’s game content, such as dialogue, through the use of scripts.
The Mad Lib Script system is in use here. A single action template, Game.mla,
contains a number of actions that will be useful in your project. More than 200 lines
in length, the game’s action template is a little too long to list here, so I highly suggest
that you open the action template while reading through this section.

The action template is split into the following six groups of actions:

■ Script flow. Much like a standard program, scripts execute actions starting at
the beginning of the script. The script flow continues until the end of the
script. Scripts also use conditional if...then checking (checking the status of
internal flags and variables) to change the flow of the script’s execution.

■ Character control. This includes adding, removing, moving, and setting the
character’s AI settings.

■ Item controls. These check whether items exist and add and remove items
in a character’s inventory.

■ Barriers and triggers. This group of actions enable you to add, enable, and
remove map triggers.

■ Sound and music. You can play various sound effects and songs using this
group of actions.

■ Miscellaneous. A group of actions that doesn’t fit into the previously listed
groups.

You use the preceding actions to construct the game’s scripts. Once you construct
the scripts, you can use them to control the flow of the game. You trigger the
scripts used by the game in six ways—the player talking to another character, the
player touching a map trigger, and a character reaching the last route point in an
assigned route, entering a level, starting combat, or ending combat.

You name the scripts that are called when the player talks to another character
according to the character’s identification number, which you append to the word
char. For example, character #2 has a script file named char2.mls that is executed
any time the player clicks that character with the mouse.

You place map triggers in each level by using the script actions. Whenever a trigger
is touched, a script executes. You name the map triggers by using the word trig followed
by the trigger’s identification number—such as trigger #4 using the script
filename of trig4.mls.

When entering a level, use the word scene followed by the map level’s
assigned number. For example, when the character enters map #4, the
script file scene4.mls is executed.

The final three methods of executing a script use a three-letter script filename
that is appended with the
associated character’s identification number or map level number. For end-of-route
scripts, you use eor followed by the character’s identification number. For example, when character #2
reaches the last point on a route, the script named eor2.mls is executed.

For the start of combat, use soc followed by the map level number for the filename
of the script. The same applies to the end-of-combat method, except you use eoc—
for example, eoc3.mls, which is executed when combat ends in map level #3.

With the six script file-naming methods in mind, check out the following list of
scripts used in The Tower:

■ Char1.mls, Char2.mls, Char3.mls, Char6.mls, and Char7.mls. These are the
scripts that are executed whenever the player clicks a character with the
mouse. Characters 1, 2, and 3 are villagers, whereas characters 6 and 7 are
Granite and the Evil Lord, respectively.

■ SOC1.mls, SOC2.mls, SOC3.mls, SOC4.mls, and SOC5.mls. These are the
start-of-combat scripts for each level. These play only the third assigned song
in the game.

■ EOC1.mls, EOC2.mls, EOC3.mls, EOC4.mls, and EOC5.mls. The end-ofcombat
scripts typically restore the music to the level’s original song.

■ EOR0.mls, EOR4.mls, and EOR5.mls. Only three characters in the game
walk along routes—the player during the first level of the game, the demon
that is attacking the player in the village at the start of the game, and the
guard that runs to warn his Evil Lord.

■ Scene1.mls, Scene2.mls, Scene3.mls, Scene4.mls, and Scene5.mls. Each scene
starts by playing music and setting up all characters that belong in that level.

■ Trig1.mls, Trig2.mls, Trig3.mls, Trig4.mls, Trig5.mls, Trig6.mls, Trig7.mls,
and Trig8.mls. You use the map triggers solely to move the player from one
level to another whenever the player tries to leave a particular level.

The majority of the scripts are basic. For example, check out the trig2.mls script:

Set character id=(*0*) direction to (*0.000000*)
Teleport character id=(*0*) to map (*1*) at (*100.000000*) (*0.000000*) (*-170.000000*)

The purpose of the trig2.mls, which is placed in the second scene (the bridge), is
to teleport the character to the first map (the village) and to change the player’s
direction. To see a more advanced script, check out scene4.mls, which is executed
when the player enters the fourth level:

// (*Store scene #*) //
Set variable (*1*) to (*4*)
————————————-
// (*Play scene music *) //
Play music (*1*)
————————————-
// (*Add teleporter triggers *) //
Add triangle trigger id=(*6*) at
(*-177.00000*) (*200.000000*) (*-144.000000)
Add triangle trigger id=(*7*) at
(*177.00000*) (*200.000000*) (*210.000000)
————————————-
// (*Add Granite is not killed already *) //
if flag (*8*) equals (*FALSE*) then
Add character id=(*6*) definition=(*3*) type=(*NPC*) at XPos=(*170.000000*) YPos=(*0.000000*) ZPos=(*-60.000000*)
direction=(*3.925000*)
Set character id=(*6*) AI to (*Stand*)
EndIf

Although it’s certainly much longer than the other scripts in the game, the
scene4.mls script is fairly simple. The script starts much like the other scene scripts
do—by storing the scene’s map number in variable #1 and playing the level’s associated
song. From there, two triggers are placed in the scene that teleport the
player back down to the ground level of the tower or to the Evil Lord’s chamber.

Finishing up the script, flag #8 is checked, and if set to FALSE, a character is added
to the level. This character, Granite, is character #3 in the master character list. In
the game engine, Granite is assigned the character identification number 6. At
first, Granite begins as an NPC (non-player character), merely standing still and
waiting for the player to speak to him.

When he is spoken to, Granite’s script is processed—some words are exchanged
between Granite and the player, and then Granite’s type is changed to Monster.
When the player dispatches Granite, the end of combat script sets flag #8 to TRUE,
thereby skipping the portion of the scene4.mls script that adds Granite to the map
when the player reenters scene #4. Ingenious, isn’t it?

In the section “Processing Scripts,” later in this chapter, you find out how the
scripts in The Tower are processed. As for now, move on to defining how the player
interacts with the game.

posted on 2007-12-28 18:48 lovedday 閱讀(315) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導(dǎo)航

統(tǒng)計

常用鏈接

隨筆分類(178)

3D游戲編程相關(guān)鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            中文一区二区在线观看| 欧美三级日本三级少妇99| 亚洲日产国产精品| 免费观看在线综合| 久久免费少妇高潮久久精品99| 欧美日韩一卡| 欧美激情一级片一区二区| 欧美大片18| 国产精品成人观看视频免费| 国产精品一区二区久久| 国产真实久久| 亚洲片区在线| 亚洲专区一区| 美女视频黄免费的久久| 亚洲国产成人午夜在线一区| 一本色道久久88综合亚洲精品ⅰ| 亚洲专区在线视频| 久久综合色88| 国产精品白丝黑袜喷水久久久| 国产日产精品一区二区三区四区的观看方式 | 亚洲国产欧美另类丝袜| 9久草视频在线视频精品| 欧美一区三区三区高中清蜜桃| 欧美www在线| 亚洲一级高清| 欧美电影在线观看完整版| 国产精品久久久久久久久久久久久久 | 亚洲国产精品专区久久| 99ri日韩精品视频| 久久精品国产亚洲a| 欧美日本不卡高清| 精品91免费| 西西人体一区二区| 亚洲区在线播放| 欧美一区日韩一区| 欧美午夜一区| av成人天堂| 嫩草影视亚洲| 性久久久久久久| 欧美日韩在线电影| 亚洲国产小视频| 久久青青草综合| 亚洲一区二区三区高清不卡| 欧美精品色综合| 在线观看国产精品淫| 亚洲欧美一区二区视频| 日韩亚洲欧美高清| 欧美激情精品| 亚洲日本免费电影| 欧美xx69| 麻豆国产精品777777在线| 精品1区2区| 裸体一区二区三区| 欧美在线高清| 国产精品视频一区二区三区| 久久福利视频导航| 99ri日韩精品视频| 欧美日韩精品免费在线观看视频| 亚洲国产成人av好男人在线观看| 久久久久久综合| 亚洲欧美日韩系列| 国产精品综合色区在线观看| 午夜激情亚洲| 亚洲一级在线| 国产日产欧美精品| 欧美中文字幕视频在线观看| 亚洲免费在线观看| 国产精品一区二区三区乱码| 欧美一级在线视频| 亚洲综合欧美| 国产一区二区三区直播精品电影| 久久av老司机精品网站导航| 午夜欧美理论片| 黄色成人在线| 亚洲国产乱码最新视频| 欧美精品亚洲| 亚洲欧美日韩精品久久奇米色影视| 亚洲一区二区三区视频| 国产欧美一区二区三区另类精品 | 在线观看日韩www视频免费| 麻豆精品精品国产自在97香蕉| 久久精品国产96久久久香蕉| 亚洲国产欧美一区二区三区同亚洲| 亚洲国产精品嫩草影院| 欧美日韩免费一区二区三区| 欧美在线观看你懂的| 久久婷婷久久| 亚洲一区在线视频| 久久免费黄色| 亚洲一区二区精品视频| 久久精品国产77777蜜臀| 99re在线精品| 久久国产精品亚洲77777| 99视频精品| 久久免费偷拍视频| 亚洲综合激情| 美日韩精品视频| 亚洲免费影视第一页| 久久久久亚洲综合| 亚洲一区二区免费视频| 久久精品国产精品 | 亚洲国产清纯| 国产精品久久久亚洲一区| 蜜桃av一区二区在线观看| 欧美三区视频| 美国十次成人| 国产精品久久网站| 亚洲国产高清视频| 国产一区二区三区久久 | 亚洲——在线| 亚洲高清在线精品| 亚洲一区二区三区高清 | 久久国产精品高清| 亚洲欧美日本在线| 男女激情久久| 久久九九全国免费精品观看| 欧美日韩国产在线播放网站| 理论片一区二区在线| 国产精品久久久久久久电影 | 美女国产一区| 久久久av毛片精品| 国产精品美女诱惑| 一区二区三区 在线观看视| 亚洲国产一区二区精品专区| 欧美一区二区三区四区在线观看地址| 99精品国产一区二区青青牛奶 | 亚洲一区视频| 在线一区日本视频| 欧美精品一区在线| 亚洲第一中文字幕| 亚洲国语精品自产拍在线观看| 亚洲欧美日韩在线观看a三区 | 99视频有精品| 欧美ab在线视频| 蜜桃av一区二区| 韩国女主播一区二区三区| 欧美亚洲综合另类| 久久aⅴ乱码一区二区三区| 国产精品一区二区三区久久久| 亚洲天堂视频在线观看| 亚洲欧美日韩一区二区三区在线观看 | 久久国产福利| 免费永久网站黄欧美| 亚洲福利视频专区| 另类春色校园亚洲| 亚洲高清免费在线| 亚洲精品自在在线观看| 欧美极品欧美精品欧美视频| 亚洲国产一区二区三区在线播 | 国语自产精品视频在线看8查询8| 午夜精品99久久免费| 久久男女视频| 亚洲成在线观看| 欧美电影美腿模特1979在线看| 欧美激情一区二区三区在线| 亚洲国产精品成人综合色在线婷婷| 久久久成人精品| 久久综合电影| 亚洲国产精品欧美一二99| 卡一卡二国产精品| 亚洲美女在线国产| 欧美一区国产二区| 在线播放一区| 欧美激情在线有限公司| 日韩视频一区二区三区在线播放免费观看| 一本久道久久综合狠狠爱| 国产精品二区在线| 欧美一区二区日韩一区二区| 欧美国产日韩一区| 国产精品99久久久久久久久久久久| 国产精品一二| 久久婷婷综合激情| 国产日韩欧美一区二区三区四区 | 欧美肥婆bbw| 一片黄亚洲嫩模| 久久久久久久久久久久久女国产乱| 亚洲高清视频在线观看| 欧美日韩专区| 久久永久免费| 99热免费精品在线观看| 久久精品午夜| 亚洲午夜在线观看| 国内自拍一区| 国产精品视频xxx| 欧美激情一区二区三区全黄| 久久精品日韩欧美| 中文在线资源观看视频网站免费不卡| 久久久久久久久久看片| 亚洲激情成人网| 欧美少妇一区二区| 久久久久一区二区| 亚洲一区二区精品| 欧美国产在线观看| 欧美在线观看一区二区| 亚洲人成毛片在线播放| 国产日韩欧美91| 国产精品wwwwww| 女同性一区二区三区人了人一| 亚洲免费视频在线观看| 日韩视频在线观看|