Using the cam & talk commands in a window


Last updated 3/20/2000

CONTENTS: 1(Intro) 2(CAM Details) 3(TALK Details)

Intro


talk <"player" || "npc"> <animation name> [nostay]
talk_ex <entity A> <entity B> <anim A> <anim B> [<nostay A> <nostay B>]
cam <preset name> ["restore"] key(value) key(value) ...

With these three commands, you can accomplish everything you could with the old system, and in a more efficient and readable format. The talk command handles most cases. The most common dialog commands now look something like this:

startconsole "setcharactertalk 18:1101 character_boots start talk_a;rca 18:1101 gest_g; cam_to pickle rel;$CAMRIGHT;cam_lagfactor 120"
finishconsole "cam_moverestore 1;setcharactertalk 18:1101 character_boots stop;cam_restore"

Where $CAMRIGHT means:

cam_yaw -55;cam_pitch -50;cam_fardist 45;cam_neardist 10;cam_fwddist 45;cam_occlude 1; cam_delay -1;fov 80

All of this crap can now be done with something similar to this:

cam right to(pickle rel)
talk npc talk_a

CAM Details


Camera values are defined in the file caminfo.txt in the anoxdata/gameflow directory. The file consists of a series of camera definitions, one per line, each one containing one or more key/value pairs that define how the camera should work. Here's the format, with an example:

<camera name> key(value) key(value) ...
EX:
left yaw(55) pitch(-20) far(100) near(10) fwd(45) occlude(1) speed(100) lag(100)

Before we come to the huge list of keys and descriptions, understand that you can override any and all of the values if you want, when you build the window. For example, if you wanted to use the "left" cam from above, but wanted to change the pitch and from values, you would use:

cam left pitch(-40) from(13:2321)

And here are all the possible keys and what they mean:

KEY NAME DESCRIPTION
restore NOTE: IF you use this in a window, it must be the first key to come after the cam name.

If present, tells the camera not to go back to normal after the window is dismissed, unless the player moves. Use to let the player know that there is more dialog that they should read before going on.
NOTE: This "restore" behavior may be backwards. Check back with Josh and Squrirel. Also note that "restore" does NOT require a (value) following it.
zip (cam_zip) If present, the camera will cut instantly to where it's supposed to be, rather than smoothly going there.
from (cam_from) Tells the camera where to look from. You can specify a targetname or sequence for an entity in the map, or you can specify absolute world coordinates (which can be easily produced with the cam_dumpstring command)

If you specify an entity that is NOT solid, the camera looks from that entity's origin and the near, far, pitch and yaw values are ignored.
to (cam_to) Tells the camera what to look at. You can specify a targetname or sequence for an entity in the map, or you can specify absolute world coordinates

If you specify an entity that is NOT solid, the camera looks from that entity's origin and the near, far, pitch and yaw values are ignored.

Also, if you put the word "rel" after the target (with a space in between them), the camera will look at the point directly in between the target and the owner or from entity.
owner (cam_owner) Tells the camera that all the calculations it makes to determine where in the world to be should be based off a different entity. You can specify a targetname or sequence of an entity in the world.
yaw (cam_yaw) The camera will rotate this many degrees to the left or right in relation to the source (owner or from entity).
pitch (cam_pitch) The camera will rotate this many degrees up or down in relation to the source (owner or from entity).

NOTE that negative values will cause the camera to move up.
far (cam_fardist) The camera stays this far away from the source, assuming the source is solid.
near (cam_neardist) The camera will try to stay at least this far away from the source, assuming the source is solid.
fwd (cam_fwddist) The focus point of the camera is this far in front of the target (owner or to entity), assuming the target is solid.
speed (cam_movespeed) The maximum speed the camera will move.
lift (cam_lift) The focus point of the camera is this far up from the target's origin, assuming the target is solid.
lag (cam_lagfactor) Limits how fast the camera can move, and makes the in/out of the path more smooth. Generally, speed should be larger than lag, but some nice effects can be had by making lag larger than speed.
occlude (cam_occlude) If set to 1, the camera will freely allow anything to get between it and the focus.
fov Field of view.

Additionally if you want to force camera between the talk position and the player position, you can use the extern:
cam_anoxmariomode <"1" || "0">
Takes arguments "1", "0", or nothing. nothing == toggle. It puts the camera into "mario mode" (like when talking).

TALK Details


There are two talk commands. One is for the most common case, where the player and an NPC are talking to eachother, and the other is for special cases where more control is needed, i.e. two NPC talking to eachother, or an NPC talking to a specific player character in the party.

Here's the format for those two again:

talk <"player" || "npc"> <animation name> [nostay]
talk_ex <entity A> <entity B> <anim A> <anim B> [<nostay A> <nostay B>]

With the talk command, you specify either "player" or "npc" and an animation to play for that entity. Also, whichever you specify in this command will be the default cam_to entity. If you use the nostay command, the entity that you specified will not stop to talk, but will keep moving or whatever it is doing.

The
talk_ex command is the same, except you can specify both entities and parameters for both.