• <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>

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

            Controlling Players and Characters(28)

             

            Building the Master Character List

            You create and use a master character list (MCL) much like you use the master
            item list (MIL) to define objects in your game. Before using them in your game,
            you need to design every character, complete with appearance (3-D mesh) and
            functionality (abilities and attributes). This character information is stored in the
            sCharDef structure.

            The MCL is stored just as the MIL, as a sequential data file (see Figure 16.12).

            Whenever a character is needed within the game, the MCL is referenced; each
            character is assigned a number that tells which character to use. As a character is
            needed, you load the specific data structure.

            Now take a look at the sCharDef structure:

            typedef struct sCharDef         // character definition
            {
                
            // misc data
                char    name[32];
                
            long    class_index;        // class index of character
                long    money;
                
            float   speed;              // movement speed
                long    magic_spell[2];     // bit flags to mark known spells
                long    mesh_index;         // mesh/anim index to load

                // abilities
                long    agility;
                
            long    attack;
                
            long    defense;
                
            long    resistance;         // magic resistance ability
                long    mental;
                
            long    to_hit;             // chance to hit

                // attributes
                long    health_points;      // number of health points (maximum)
                long    mana_points;        // number of mana points (maximum)
                long    level;              // experience level
                long    exp;                // experience points

                // inventory
                char    item_filename[MAX_PATH];    // char ics filename
                long    weapon;
                
            long    armor;
                
            long    shield;
                
            long    accessory;

                
            // droppping item data
                long    drop_chance;        // % of dropping item when killed
                long    drop_item;          // item index to drop when killed

                // attack/magic chances and effects
                float   attack_range;
                
            float   charge_rate;        // countdown rate to attack
                long    to_attack;          // percent to attack
                long    to_magic;           // percent to use magic
                long    effect_chance;      // chance of attack effect occuring
                long    effects;            // bit flags of attack effects
            } sCharDef;

            Just like the master item list, the MCL stores only minimal information about a
            character. Because multiple characters of the same type can exist in the game
            world at one time (for example, ten instances of a Goblin character), the
            per-instance data is kept separate. This per-instance data includes the coordinates
            of the characters, their current health and mana points, and so on.

            Although the structure is well commented, a few things might not make immediate
            sense. In addition to the abilities and attributes that you’ve already read about, you
            have the miscellaneous, inventory, dropping item, and attack/magic chances and
            effects. Table 16.6 describes what these variables do for the character definition.

            Configuring a single character definition is as simple as filling in the blanks, but
            when it comes to defining 100 characters, things can quickly become complicated.
            What you need is an MCL Editor.

             

            The MCL Editor

            You’re probably used to these editors by now, and this one is just as easy to use as
            other editors. If you haven’t done so already, go ahead and run the MCLEdit application.

            Following snap shows the MCL Editor dialog box.

            The MCL Editor can handle up to
            256 characters—each numbered from 0 to 255. Each character is shown in the list
            box. To work with the MCL Editor, follow these steps:

            1. Double-clicking a character in the list or clicking the New button brings up
            the Modify Character dialog box.

            2. In the Modify Character dialog box, enter the appropriate character information
            in each field. You can alter a character’s Name, Class, Health Points,
            Mana Points, Level, Experience, Money, ability values, known Spells, and
            Mesh information.

            3. Once you finish filling in a character’s information in the Modify Character
            dialog box, click OK. You’ll return to the Master Character List Editor dialog
            box.

            4. Click the Save button to bring up the Save MCL File dialog box.

            5. Enter a filename and click the Save button to write the MCL file to disk.

            6. To Load a file, click the Load button (in the Master Character List Editor
            dialog box), enter a filename, and click OK.

            You’ve read about each bit of the character definition. Now, it’s time to enter that
            information into the appropriate places. When it comes to spells, highlight the
            spell number you want the character to know automatically. Those spell numbers
            relate directly to your MSL, so you might want to run the MSL Editor and MCL
            Editor side by side to compare the information.


            posted on 2007-12-03 21:54 lovedday 閱讀(219) 評(píng)論(0)  編輯 收藏 引用


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


            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(178)

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

            搜索

            最新評(píng)論

            久久久久久久久久久| 国产精品九九久久免费视频| 2019久久久高清456| 18岁日韩内射颜射午夜久久成人| 亚洲精品国产字幕久久不卡| 久久精品国产精品亚洲毛片| 国産精品久久久久久久| 亚洲国产综合久久天堂| 99久久er这里只有精品18| 久久91这里精品国产2020| 久久婷婷色香五月综合激情| 国产精品久久久久久福利漫画| 精品多毛少妇人妻AV免费久久 | 99久久精品毛片免费播放| 99久久国产亚洲高清观看2024| 久久天天躁狠狠躁夜夜不卡| 精品久久久久久国产91| 国内精品人妻无码久久久影院导航| 国产精品久久久久无码av| 思思久久精品在热线热| 99久久精品无码一区二区毛片| 婷婷伊人久久大香线蕉AV| 久久久久一本毛久久久| 久久久青草久久久青草| 久久99精品久久久久子伦| 久久精品国产亚洲av麻豆图片| 久久久久国产精品三级网| 天天综合久久久网| 99麻豆久久久国产精品免费| 久久综合狠狠综合久久| 亚洲精品乱码久久久久久蜜桃图片 | 一本色综合网久久| 久久久国产打桩机| 色综合久久夜色精品国产| 亚洲一级Av无码毛片久久精品| 精品多毛少妇人妻AV免费久久| 天天综合久久久网| 久久精品无码一区二区app| 久久精品无码一区二区三区日韩| 久久久久国产精品麻豆AR影院| 99久久无码一区人妻|