Difference between revisions of "Add character to scene"
From XStoryPlayer Wiki
Line 25: | Line 25: | ||
<code>/init/std/base/char/char_base.dat</code>. You see that the scene_id and waypoint are overridden.</li> | <code>/init/std/base/char/char_base.dat</code>. You see that the scene_id and waypoint are overridden.</li> | ||
<li>Start the adbucted scene and if all went well, you should see an alien character outside your cell.</li> | <li>Start the adbucted scene and if all went well, you should see an alien character outside your cell.</li> | ||
− | <li>Now lets make her look at you and | + | <li>Now lets make her look at you and change her expression. Open the <code>/init/story/alien/brain/dyn.dat</code> file. This file contains the dynamic state for the brain.<br> |
Here you can add brain state variables that can be changed during the game. They are automatically saved when you save the game.<br> | Here you can add brain state variables that can be changed during the game. They are automatically saved when you save the game.<br> | ||
The variables <code>main_focus_type</code> and <code>main_def_exp</code> do not only contain a value but can also be used to set the actual focus and expression.<br> | The variables <code>main_focus_type</code> and <code>main_def_exp</code> do not only contain a value but can also be used to set the actual focus and expression.<br> | ||
Set <code>main_focus_type = STARE</code> and <code>main_def_exp = A_BIT_ANGRY</code>. This will make the character stare and you with an somewhat angry expression.</li> | Set <code>main_focus_type = STARE</code> and <code>main_def_exp = A_BIT_ANGRY</code>. This will make the character stare and you with an somewhat angry expression.</li> | ||
</ol> | </ol> |
Revision as of 11:59, 13 January 2015
In this tutorial we will add a female alien character to the scene. We will let her walk by the cell once in a while.
If you try to talk with her, she gets angry and says you should be quiet.
Steps
- Copy the files from the 'Tutorial resource pack' for this tutorial to the appropriate directories.
We will describe these files here briefly:
-
/init/story/alien
: This is the brain for the alien character. Just like the player each character has a brain. -
/scenes/capture
: These are the motion capture files used for the alien character. -
/scenes/character6
: These are the character and cloth meshes. -
/scenes/charobj
: These meshes are used for collision detection for characters in general. -
/scenes/sounds
: These files are the sound files used for the character. -
/scene/textures
: These files are the texture files used for the character.
-
- Now we need a location that is the starting point for this character.
Open the spaceship scenescene.ma
and create a duplicate instance of the waypoint object.
A duplicate instance copies only the instance of the object not the mesh itself. Name the copywaypoint2
and place it outside the cell like this:
- Open the
/init/story/alien/init.dat
file.
In the pose settings you see that thescene_id = SPACESHIP1
andwaypoint = "waypoint2"
.
The pose contains all pose settings for this character. The character is derived from the objectCHAR_BASE
, you can find more pose settings in the file:
/init/std/base/char/char_base.dat
. You see that the scene_id and waypoint are overridden. - Start the adbucted scene and if all went well, you should see an alien character outside your cell.
- Now lets make her look at you and change her expression. Open the
/init/story/alien/brain/dyn.dat
file. This file contains the dynamic state for the brain.
Here you can add brain state variables that can be changed during the game. They are automatically saved when you save the game.
The variablesmain_focus_type
andmain_def_exp
do not only contain a value but can also be used to set the actual focus and expression.
Setmain_focus_type = STARE
andmain_def_exp = A_BIT_ANGRY
. This will make the character stare and you with an somewhat angry expression.