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

天行健 君子當自強而不息

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)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美不卡一卡二卡免费版| 国产精品影音先锋| 亚洲美女黄网| 亚洲品质自拍| 亚洲国产老妈| 在线亚洲成人| 亚洲免费中文| 久久免费国产| 欧美日韩日韩| 国产丝袜一区二区| 在线看成人片| 一区二区三区欧美日韩| 午夜国产精品影院在线观看| 久久久精彩视频| 亚洲国产成人精品女人久久久 | 欧美伊人久久大香线蕉综合69| 香蕉国产精品偷在线观看不卡| 久久九九99| 欧美日韩综合在线| 精品成人国产在线观看男人呻吟| 日韩一级片网址| 久久久久久久欧美精品| 亚洲高清在线| 欧美一级二区| 欧美视频中文一区二区三区在线观看 | 国产午夜精品全部视频播放 | 久久免费99精品久久久久久| 国产欧美一区二区三区在线老狼 | 久久综合色影院| 国产精品久久久久久久电影| 极品日韩av| 欧美一区二区播放| 亚洲人成网站在线观看播放| 午夜免费电影一区在线观看| 欧美激情一二区| 在线电影一区| 久久九九精品99国产精品| 日韩小视频在线观看| 另类综合日韩欧美亚洲| 国产亚洲一级| 性欧美8khd高清极品| 亚洲精品乱码久久久久久蜜桃麻豆| 欧美中文在线观看国产| 国产精品久久久久久久久久尿| 最新国产の精品合集bt伙计| 久久久久久久久蜜桃| 亚洲专区在线| 国产精品视频久久一区| 一区二区不卡在线视频 午夜欧美不卡在| 久久久久久网| 欧美在线视频观看| 国产性色一区二区| 欧美诱惑福利视频| 亚洲欧美日韩在线播放| 国产精品免费电影| 欧美一级淫片aaaaaaa视频| 中文一区二区| 国产精品卡一卡二| 欧美一区二区啪啪| 午夜精品久久久久久久99热浪潮 | 亚洲天堂网在线观看| 亚洲黄色成人久久久| 欧美成人首页| 日韩一级大片在线| 日韩午夜中文字幕| 国产精品日本| 久久久久久香蕉网| 美国十次了思思久久精品导航| 亚洲承认在线| 亚洲精品国产系列| 国产精品初高中精品久久| 亚洲欧美综合精品久久成人| 亚洲欧美国产三级| 在线免费观看日本一区| 亚洲高清视频在线观看| 欧美日韩亚洲天堂| 久久av二区| 免费观看久久久4p| 亚洲小说区图片区| 欧美在线一级视频| 日韩视频免费看| 免费成人av| 国产精品视频精品| 久久婷婷丁香| 麻豆久久婷婷| 亚洲欧美日韩区| 久久久久综合一区二区三区| 日韩亚洲欧美综合| 欧美一区二区三区啪啪| 日韩视频免费| 欧美一区三区二区在线观看| 亚洲精品女av网站| 欧美呦呦网站| 亚洲视频图片小说| 久久综合亚州| 欧美一区二视频| 欧美aⅴ一区二区三区视频| 亚洲一区二区三区影院| 久久久久久久综合日本| 亚洲一区在线视频| 亚洲电影在线免费观看| 亚洲久色影视| 国产精品永久免费在线| 美乳少妇欧美精品| 欧美日韩另类国产亚洲欧美一级| 香蕉久久夜色精品国产| 免费成人性网站| 亚洲欧美国产精品桃花| 久久亚洲精品一区二区| 亚洲欧美日韩在线播放| 欧美成在线视频| 久久天堂精品| 国产精品亚洲第一区在线暖暖韩国| 欧美国产日韩视频| 国产有码一区二区| 亚洲一级一区| 亚洲图片欧美日产| 欧美成人午夜激情视频| 亚洲视频每日更新| 欧美高清日韩| 久久理论片午夜琪琪电影网| 欧美理论电影在线观看| 美女日韩欧美| 国产一区二区三区在线免费观看| 亚洲毛片在线免费观看| 亚洲级视频在线观看免费1级| 欧美亚洲视频一区二区| 午夜精品美女久久久久av福利| 欧美屁股在线| 亚洲人成7777| 亚洲国产天堂久久国产91| 久久久福利视频| 久久久久亚洲综合| 国产日韩欧美一区在线| 亚洲图片在线| 午夜一级在线看亚洲| 欧美午夜一区二区| 亚洲第一免费播放区| 欧美日韩在线三区| 亚洲黄色影片| 久久久夜精品| 国产亚洲一本大道中文在线| 亚洲图中文字幕| 欧美一级播放| 国产精品第13页| 亚洲伊人第一页| 欧美一区二区三区在线视频 | 新片速递亚洲合集欧美合集 | 欧美一进一出视频| 国产欧美日韩一区二区三区| 亚洲欧美另类国产| 久久精品在线播放| 黄色成人免费观看| 另类亚洲自拍| 99精品国产一区二区青青牛奶| 亚洲女同精品视频| 国产日本亚洲高清| 久久这里只有精品视频首页| 欧美成人精品福利| 日韩视频免费观看高清在线视频 | 欧美电影打屁股sp| 日韩一级黄色av| 性色一区二区三区| 黄色成人在线观看| 欧美经典一区二区| 亚洲网址在线| 女女同性精品视频| 一片黄亚洲嫩模| 国产精品最新自拍| 欧美第一黄网免费网站| 亚洲午夜国产成人av电影男同| 久久精品人人做人人综合| 国产一区视频在线观看免费| 美女精品在线| 欧美亚洲免费电影| 欧美国产欧美亚洲国产日韩mv天天看完整 | 99精品福利视频| 国产午夜亚洲精品理论片色戒| 麻豆精品网站| 亚洲综合电影一区二区三区| 欧美a级在线| 久久av一区二区| 亚洲精品一区二区三区在线观看| 国产精品区一区| 欧美日韩国产精品专区| 欧美在线视频网站| 一区二区三区四区在线| 欧美大片在线观看| 久久精品国产v日韩v亚洲 | 欧美激情视频在线播放| 久久激情网站| 在线亚洲美日韩| 亚洲欧美亚洲| 亚洲综合电影| 99re亚洲国产精品| 在线观看三级视频欧美| 国产美女扒开尿口久久久| 久久免费视频在线观看| 亚洲欧美日韩一区在线观看| 99精品福利视频|