Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

3D Game Programming All In One (2004)

.pdf
Скачиваний:
139
Добавлен:
17.08.2013
Размер:
17.91 Mб
Скачать

768

Appendix D

QuArK Reference

 

 

-n

Noisy error/statistic reporting

 

 

-s

Don't search for textures in parent directory

 

 

-q <1,2>

Parse Quake map file, version 1 or 2

 

 

-o dir

Directory in which to place the .dif file

 

 

-t dir

Location of textures

 

 

file.map

Name of file to be processed

 

The program takes a map file, processes it according to the supplied switches, and pro-

 

duces as output a Torque .DIF file. The .DIF file is deposited in the same directory as the

 

.MAP file unless the -o switch is employed to specify the output directory.

 

The textures used in the map have to be loaded in order to process the map. The map2dif

 

tool needs to load the textures so that it can determine the width and height of each tex-

 

ture. It uses this information to calculate polygon texture mapping information that will

 

be included in the .DIF file. If you change the size of a texture, you may need to re-process

 

any map files that use that texture.

 

When it runs, map2dif looks in the default directory of the .MAP input file; it then recur-

 

sively looks in its parent directory and on upwards until it reaches the root directory, or

 

finds the texture in question. If the -t dir switch is used in the command line, the program

 

starts searching for the textures in the directory specified by dir. The program will load

 

either .JPG, or .PNG forms of the textures specified in the map.

 

When it runs, the Torque engine expects textures to be in the same directory as the map

 

files that it uses, or in a parent directory. Parent directories are searched all the way to the

 

root main directory (where the torque engine executable resides). The root directory itself

 

is never searched.

 

The map2dif tool uses certain texture names to help identify special brushes. These tex-

 

tures are never loaded but they need to be in the base texture directory of QuArK to allow

 

processing of your maps.

 

null.png

 

 

origin.png

 

 

trigger.png

 

 

forcefield.png

Table 17.11 contains a list of the entities supported by map2dif and the various entity attribute options.

Team LRN

map2dif Reference

769

 

Table 17.11

map2dif Supported Entities

 

 

 

Category

Entity

Attribute

Data Type

 

Core Entities

 

 

 

 

 

 

worldspawn

 

 

 

 

 

detail_number

int (default is 0)

 

 

 

 

min_pixels

int (default is 250)

 

 

 

 

geometry_scale

int Must be a power of 2

 

 

 

 

 

(default is 32)

 

 

 

 

light_geometry_scale

int Must be a power of 2

 

 

 

 

 

(default is 32)

 

 

 

 

 

ambient_color

color (default is 0,0,0)

 

 

 

emergency_ambient_color

color (default is 0,0,0)

 

 

detail

 

 

 

 

 

collision

 

 

 

 

 

vehicle_collision

 

 

 

 

 

portal

 

 

 

 

 

ambient_light

bool: Pass ambient light

 

 

 

 

 

(default is 0)

 

 

 

 

target

 

 

 

 

 

 

name

string (default "")

 

 

 

origin

pos (default 0,0,0)

 

Light Emitters

 

 

 

 

 

 

light_emitter_point

 

 

 

 

 

 

origin

pos (default 0,0,0)

 

 

 

target

 

 

 

 

 

state_index

 

 

 

 

 

falloff_type

bool: 0 = distance, 1 =

 

 

 

 

linear (default false)

 

 

 

falloff1

float (default is 10)

 

 

 

falloff2

float (default is 100)

 

 

 

falloff3

float (default is 0)

 

 

light_emitter_spot

 

 

 

 

 

origin

pos (default is 0,0,0)

 

 

 

 

 

target

 

 

 

 

 

state_index

 

 

 

 

 

falloff_type

bool: 0=distance, 1=linear

 

 

 

 

(default false)

 

 

 

falloff1

int (default is 10)

 

 

 

falloff2

int (default is 100)

 

 

 

falloff3

int (default is 0)

 

 

 

 

continued

 

 

 

 

 

 

Team LRN

770

Appendix D QuArK Reference

 

 

 

 

 

 

 

 

direction

vector (default is 0,0,-1)

 

 

theta

radian: inner angle

 

 

 

(default is 0.2)

 

 

phi

radian: outer angle

 

 

 

(default is 0.4)

 

Lights

 

 

 

light

 

 

 

 

name

string (default "")

 

 

origin

pos (default is 0,0,0)

 

 

spawnflags

int: animation flags...

 

 

alarm_type

bool (default is 0)

 

 

state

int: State number

 

 

duration

float: State duration

 

 

color

color: State color

 

Scripted Lights

 

 

 

light_omni

 

 

 

 

name

string (default "")

 

 

origin

pos (default is 0,0,0)

 

 

color

color (default is 1,1,1)

 

 

alarm_type

bool (default is 0)

 

 

falloff1

int (default is 10)

 

 

falloff2

int (default is 100)

 

light_spot

 

 

 

 

name

string (default "")

 

origin

pos (default is 0,0,0)

 

 

 

target

 

 

 

color

color (default is 1,1,1)

 

 

alarm_type

bool (default is 0)

 

 

falloff1

int (default is 10)

 

 

falloff2

int (default is 100)

 

 

distance1

int: Inner distance (default

 

 

 

is 10)

 

 

distance2

int: Outer distance (default

 

 

 

is 100)

 

Animated Lights

 

 

 

light_strobe

 

 

 

 

name

string (default "")

 

 

origin

pos (default is 0,0,0)

 

 

target

 

 

 

spawnflags

int: animation flags...

 

 

color1

color (default is 0,0,0)

 

 

 

continued

 

 

 

 

Team LRN

 

map2dif Reference

771

 

 

 

color2

color (default is 1,1,1)

 

alarm_type

bool (default is 0)

 

falloff1

int (default is 10)

 

falloff2

int (default is 100)

 

speed

int (default is ?)

 

light_pulse

 

 

name

string (default "")

 

origin

pos (default is 0,0,0)

 

spawnflags

int: animation flags...

 

color1

color (default is 0,0,0)

 

color2

color (default is 1,1,1)

 

alarm_type

bool (default is 0)

 

falloff1

int (default is 10)

 

falloff2

int (default is 100)

 

speed

int (default is ?)

 

light_pulse2

 

 

name

string (default "")

 

origin

pos (default is 0,0,0)

 

spawnflags

int: animation flags...

 

color1

color (default is 0,0,0)

 

color2

color (default is 1,1,1)

 

alarm_type

bool (default is 0)

 

falloff1

int (default is 10)

 

falloff2

int (default is 100)

 

attack

float (default is 1)

 

sustain1

float (default is 1)

 

sustain2

float (default is 1)

 

decay

float (default is 1)

 

light_flicker

 

 

name

string (default "")

 

origin

pos (default is 0,0,0)

 

spawnflags

int: animation flags...

 

color1

color (default is 1,1,1)

 

color2

color (default is 0,0,0)

 

color3

color (default is 0,0,0)

 

color4

color (default is 0,0,0)

 

color5

color (default is 0,0,0)

 

alarm_type

bool (default is 0)

 

falloff1

int (default is 10)

 

falloff2

int (default is 100)

 

speed

int (default is ?)

 

 

continued

 

 

 

 

Team LRN

772 Appendix D

Special Entities

Path Entities

Trigger Entities

QuArK Reference

light_runway

 

name

string (default "")

origin

pos (default is 0,0,0)

spawnflags

int: animation flags...

color

color (default is 1,1,1)

target

 

alarm_type

bool (default is 0)

falloff1

int (default is 10)

falloff2

int (default is 100)

speed

int (default is ?)

steps

int (default is 0)

ingpong

bool (default is 0)

mirror_surface

 

origin

pos (default is 0,0,0)

alpha_level

int (default is ?)

door_elevator

 

name

string (default is "")

path_name

string (default ?)

trigger[0-7]_name

string (default ?)

force_field

 

name

string (default "")

color

color (default is 0.5,.8,1)

trigger[0-7]_name

string (default ?)

ai_special_node

 

name

string (default "")

origin

pos (default is 0,0,0)

path_node

 

name

string (default "")

next_node

string (default ?)

next_time

int (default ?)

path_start

 

name

string (default "")

next_node

string (default ?)

next_time

int (default ?)

trigger

 

name

string (default "")

Team LRN

INDEX

Symbols

+(addition operator), 61 & (ampersand), 73

* (asterisk), 56, 61 $ (dollar sign), 54

// (double-slash operator), 50 ! (exclamation point), 73

/ (forward slash), 61

* (multiplication operator), 62 \n (newline character), 124

% (percent sign), 54 | (pipe operator), 61

+(plus sign), 56

\r (return character), 124 ; (semicolon), 52

- (subtraction) operator, 61 \t (tab character), 124

~ (tilde), 39, 231 _ (underscore), 53

Numerics

1st PPOV (First-Person Point-of-View) games, 3 3D Cafe Web site, 743

3D objects

coordinate systems, 90–91 overview, 89

shapes, 94–95 transformation, 95–98

3D sounds, 559

3D Today Magazine Web site, 743 3Dup.com Web site, 743

3rd PPOV (Third-Person Point-of-View) games, 3

A

About UVMapper command (UVMapper Help menu), 408

action games, 3

action maps, console commands and, 24 ActionMap object, 174

ActionRPG Web site, 741 actions, lag, 133

activateDirectInput() function, 667 activateKeyboard() function, 667 activatePackage() function, 667 Add Dirt function, 537

Add flag (special materials, MilkShape), 462

Add Label At Selection command (Audacity Project menu), 548

Add Noise dialog box (Paint Shop Pro), 286 add-ons, 132

AddCardProfile() function, 668 addition operator (+), 61 AddMaterialMapping() function, 668 addMessageCallback function, 268 AddOsCardProfile() function, 669 AddTaggedString() function, 669 AddToServerGuidList function, 241 Adjust Height function, 537

Adjust Selection function, 537 adjustment layers, 292

administrative tools, as support infrastructure, 22 adventure games, 3–4

AI (Artificial Intelligence), 322 AiConnect() function, 669

Airbrush tool (Paint Shop Pro), 296–297, 517 alGetString() function, 669

Team LRN

774Index

Align Tracks Together command (Audacity Project menu), 548

Align with Zero command (Audacity Project menu), 548

alignment

cylindrical mapping option, 412 planar mapping option, 411 spherical unwrapping option, 413

alListener3f() function, 670 AllowConnections() function, 670 alpha channels, 288–290

alpha test phase, 661

Alphamap Browse Button button (MilkShape Materials tab), 402

AlPlayer class, 728 altCommand property, 642 alxCreateSource() function, 670

alxGetChannelVolume() function, 671 alxGetListener3f() function, 671 alxGetListenerf() function, 671 alxGetListeneri() function, 671 alxGetSource3f() function, 672 alxGetSourcef() function, 672 alxGetSourcei() function, 672 alxListener() function, 673 alxListenerf function(), 552 alxlsPlaying() function, 673

alxPlay() function, 552, 673 alxSetChannelVolume() function, 673 alxSource3f() function, 674 alxSourcef() function, 674 alxSourcei() function, 675

alxStop() function, 675 alxStopAll() function, 675

Ambient button (MilkShape Materials tab), 402 ampersand (&), 73

Amplify command (Audacity Effect menu), 549 AND operator, logical expressions, 73 AngelCode Web site, 743

Animate button (Keyframer tool), 404 Animate menu (MilkShape 3D), 394

animateTexture property, 601 animation

blended, 445 character modeling

joint animation, bone movement during, 445

rigging, 444

skeletal animation, 446–458 torque-supported sequences, 444

death, 455–457 look, 455 material, 27 mesh, 27 node/bone, 27

program example, 115–117 schedule() function, 115 sequences, 463

Torque Game Engine, 27 triggers, 209–210 vehicle model

body of vehicle, 467–472 collision mesh, 476 fenders, 473–474

mount nodes, 475–476 sketches, 466–467 skins, 476

testing, 477–478 wheels, 476–477 visibility tracks, 27

Animation FPS option (Preferences dialog box),

405

Animation Settings option (Torque Game Engine (DTS) Exporter dialog box), 460

animTexName property, 593 anti-aliasing, text, 306

APIs (Application Programming Interfaces), 10 arbitrary extrusion, character models, 417 area triggers, 209

arguments. See parameters arithmetic operators, 63

arms, character models, 433–438 arrays

defined, 56 elements and, 56

Fruit program example, 56–58 index of, 56

subscripts and, 59 arrow widgets, 336

Artificial Intelligence (AI), 322 artwork, textures, 357–358 assemblers, defined, 46 assembly language, defined, 46

Assign button (MilkShape)

Joints tab, 403 Materials tab, 402

Team LRN

Assign command (UVMapper Edit menu), 408 assigned statements, 52

assignment strings, 59 asterisk (*), 56, 61 atmospheric perspective, 520

Attach & Defend, 3

Audacity tool

commands, shortcut keys to, 550 installing, 540

main screen, 542–543 menus

Edit menu, 545, 547 Effect, 545, 549 File, 545–546 Project, 545, 548

View menu, 545, 547 Play button, 541 Record button, 540–541 sample rates, 544 toolbar tools, 543

Track Panel tools, 544 Track Types tool, 544 volume control, 541

audio. See also sound audio profiles, 121 editing tools, 751

program example, 119–121 Audio tool (Audacity tool), 544 AudioDescription property, 561 AudioProfile property, 561

Auto Proof button (Paint Shop Pro), 280

Auto Save option (Preferences dialog box), 406 Auto Tool button (MilkShape Model tab), 400 auto-update programs, as support infrastructure,

22

avatar inhabits, 3

axial extrusion, character models, 416 axis, coordinate systems, 90

B

back animation sequence, torque-supported, 444 backfaces, 95

background layers, 292 Backtrace() function, 675 BackUp function, 175 bandwidth strategies, 28 BanList class, 728

Index 775

bar widgets, 336 barriers, 607

BassBoost command (Audacity Effect menu), 549 beta test phase, 661

Billboard flag (special materials, MilkShape), 462 billboard trees, creating, 488–490

BillboardZ flag (special materials, MilkShape),

462

binary systems, 46 Bitmap function, 537 bitmaps

bitmap images, 288–289 bitmap property, 164 chunked, 337–338

Blackhawk Down, 22

Blend function, 537 blended animation, 445 Blender class, 26

blur, terrain, 374

body of vehicle models, 467–472 BodyFriction command, 618 BodyRestitution command, 618

bone movement, during joint animation, 445 bookmark capabilities, UltraEdit-32, 41 Boolean logic, 72

bottom property, 164 bounded loops, 64

Box button (MilkShape Model tab), 399 Box Mapping dialog box, 409

Box tool (MilkShape), 479–480 Box unwrapping method, 409, 411 BrakeTorque command, 618 branches, tree creation, 486–487 branching, 74–75

break keyword, 54, 735 brick textures, 359

bridge structures, 505–508

brushes (Torque Map Editor, QuArK)

Cub, 505 Portal, 510 Roadbed, 506

Subtraction, 509 buddycount parameter, 229 buddylist parameter, 229

BuildTaggedString() function, 676

bulletin boards, as support infrastructure, 22 bump mapping, 101–102

Team LRN

776Index

buttons

Animate (Keyframer tool), 404 GuiButtonCtrl class, 340–341 MilkShape toolbox

Groups tab, 401 Joints tab, 403 Materials tab, 402 Model tab, 399–400

Mirror (Mission Area Editor), 594 Play (Audacity tool), 541

Record (Audacity tool), 540–541 buttonType property, 164

byte code, 134

C

CalcExplosionCoverage() function, 676 Call() function, 676

calling functions, 70, 126 Camera class, 728

Camera menu (Mission Editor), 589

Camera To Selection command (World menu),

590

CameraDecay command, 618 CameraLag command, 618 CameraMaxDist command, 154, 184, 618 CameraOffset command, 618 CameraRoll command, 618

campfire effects, 595–598

Can Line Stipple option (Preferences dialog box),

405

Cancel() function, 676 CancelServerQuery() function, 677 Canvas module, client-side, 259–261 Canyon Fractal function, 537

Capture the Flag, 3

Cartesian coordinates, 95 carving, bump mapping, 101 case keyword, 54, 735 case-sensitivity, variables, 54

celsalute animation sequence, torque-supported,

445

celwave animation sequence, torque-supported,

445

center property, 164

Center World, 6

CFXweb Web site, 743

Chain Reaction, 6

character models animation

blended, 445

joint rotation, bone movement during, 445 rigging, 444

skeletal animation, 446–458 torque-supported sequences, 444–445

arbitrary extrusion, 417 arms, 433–437

arms to torso, integrating, 438 axial extrusion, 416 continuous-mesh model, 417 head, 418–423

head to torso, matching, 429–430 hybrids, 417

incremental polygon construction, 415–416 legs, 430–432

legs to torso, integrating, 432 segmented-mesh model, 417 shape primitives, 415

skins, 438–443

topographical shape mapping, 417 torso models, 423–429

ChatBox interface, 636–640, 650–652 ChatMessage function, 267 ChatMessageAll function, 653 chatPageDown function, 640 cheating, online, fighting against, 209 check boxes, GUI, 335, 341–342 checkDismountPoint method, 616 checkpoints and laps, scoring, 622–625 CheckProgress method, 624 childMargin property, 343

chunked bitmaps, 337–338 classes

AlPlayer, 728

BanList, 728

Blender, 26

Camera, 728

Control, 25

Debris, 728 defined, 26 EditTSCtrl, 728 FileObject, 728 FlyingVehicle, 729 GameBase, 729

GameConnection, 729

Team LRN

GUI control classes, 337–345 GuiBitmapCtrl, 639, 729 GuiButtonCtrl, 632 GuiCanvas, 729

GuiControl, 630, 730 GuiEditCtrl, 730 GuiFilterCtrl, 730 GuiFrameSetCtrl, 730 GuiInspector, 730 GuiMessageVectorCtrl, 730 GuiNoMouseCtrl, 639 GuiPopUpMenuCtrl, 730 GuiScrollCtrl, 224 GuiSliderCtrl, 731 GuiTerrPreviewCtrl, 731 GuiTestListCtrl, 731 GuiTextEditCtrl, 224 GuiTreeViewCtrl, 732 HTTPObject, 732 InteriorInstance, 732

Item, 732 Lightning, 732 MessageVector, 732 PhysicalZone, 732 Player, 732 Precipitation, 732 Profile, 25 SceneObject, 732 ServerScreen, 642 ShapeBase, 732 ShapeBaseData, 734

SimpleNetObject, 734 Sky, 734

StaticShape, 735 superclass, 129 TCPObject, 735 Terraformer, 735 Trigger, 735 TriggerData, 735 WaterBlock, 735 WorldEditor, 735

className property, 154, 184

Clear button (MilkShape Joints tab), 403 Clear Empty function, 537 ClearTextureHolds() function, 677 clicking, mouse operations, 591

Index 777

client control modules control/client/client.cs, 160–164

control/client/interfaces/menuscreen.gui, 162 control/client/interfaces/playerinterface.gui,

165–168 control/client/interfaces/splashscreen.gui, 169 control/client/misc/presetkeys.cs, 171–174 control/client/misc/screens.cs, 169–171

client interfaces

ChatBox, 636–640, 650–652 FindServer, 635–636, 648–650 Host, 635, 647–648 MenuScreen, 632–634 MessageBox, 640–642, 652–655 SoloPlay, 634–635, 643

client modules

Canvas module, 259–261 discussed, 258–259 functions, list of, 269–270 messages module, 266–268 mission module, 261–262

client-only sounds, 560

client versus server design issues, 132–133 ClientCmdChatMessage function, 267 ClientCmdMissionStart function, 262 ClientConnection module, 250–256 clipColumnText property, 344

Clone Brush tool (Paint Shop Pro), 297–298 Close command (Audacity File menu), 546 Close method, 655

clothing, player skin example, 329–332 cloud layers, 521–523

code

byte code, 134 common, 129 control, 129, 139–140 executable, 51

code module, finding servers, 225–229 CodeGuru Web site, 743

coins, scoring, 625–627 CollapseEscape() function, 677 collisions

collision mesh, vehicle models, 476

Collision Mesh option (Torque Game Engine (DTS) Exporter dialog box), 459–460

CollisionTol command, 618 vehicle models, 612–613

Team LRN