Monday, April 14, 2008

Immersing the Player

The Relbonian Chronicles is a story, and as a story it's important to immerse the player within it if they are to truly enjoy the experience. One of the methods I'm employing to achieve this is to have the character interact with their environment. It's a fairly easy method to employ, involving little more than triggers in the areas where you want a character to make a comment. Such comments can be scripted so that they only occur once.

For those of you wondering how to do it, here's a simple script that will have the player character say something when they enter the trigger area for the first time by placing the script in the "on enter" area of the trigger. Alternatively, instead of using a trigger, you can also place the script in the "on enter" of an area, although I'd advise you build in a delay so that the comment gets noticed.

//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
AssignCommand(oPC, ActionSpeakString("Line spoken here."));
}

Pretty simple, and easily effective depending on how you use it. Here's some example statements that could be used to give you some ideas:

On getting close to a corpse that's hidden from view - "What's that awful smell?!"
On approaching a statue - "That's beautiful!"
A Dwarf moving through a cave - "Hmmm...feels to me like there's a slight incline here."
Walking on a beach - "Ah...there's nothing I like more than feeling the sea breeze against my face."
On hearing a noise (which could be played via the same "on enter" script with a delay before the comment) - "What was that?"

These are only examples, but should enable you to see how you can take that extra step in making your module more immersive.

Stay tuned for an update on Chronicle progress soon. :)

No comments: