摘要: The next two functions to come along work in conjunction with the update functionality
of the class. At every frame that a character needs updating, a specific
function is called to update the character’s actions. This specific function is dependent
on the type of character being updated; for PCs, that specific function is
pc_update (which is overridden by you in order to control your player).
阅读全文
摘要: The brains of the character operation is the cCharController class,
which is probably the biggest non-game core class you’ll work with.
The cCharController class maintains a list of active characters, each character
being stored within a sCharacter structure. For each type of character, there is a
matching entry into an array of sMeshAnim structures (and a matching sCharAnimInfo structure).
阅读全文
摘要: To start, each character needs a definition, which is pulled from the master character
list. You store this definition value in the def variable. To tell similar
characters apart, you assign a unique identification number (ID) to each one.
Think of using identification numbers as you use names. Instead of adding a character
named “George” into the game during play, you refer to that same character
as character 5.
阅读全文
摘要: The character definitions are templates by nature, so you really need to load up the
definitions and work with them on a per-instance basis. This means that you need
to come up with a controller that loads the definitions and tracks each instance of
a character in your game. What you need is a character controller class.
阅读全文
摘要: master character list edit source:
阅读全文
摘要: 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.
阅读全文
摘要: Now, you can put all the neat spells that your game has to offer to good use. You
know how spells work, but you need to know how the spells affect the characters.
Remember that the spell controller tracks only the meshes that create the visual
side of spells; the character controller determines the effects of the spells.
阅读全文
摘要: When a character takes a swing at another character, this action triggers the
process that determines whether the blow hit the target. Determining whether the
attack hit involves an attacking character’s to-hit ability and a defending character’s
agility ability. Remember that the higher the ability values, the better the chance to
hit or dodge the attack.
阅读全文
摘要: After a spell triggers and the effects are processed, what happens? As I’ve previously
mentioned, spells only affect characters, so only the character controller engine
should modify the character’s data. In the section “Creating a Character Controller
Class,” later in this chapter, you find out how to process spells in regard to characters.
阅读全文
摘要: Because the spell controller is needed only for tracking the spell meshes and
animation, the class definition is relatively small
阅读全文