Use this template when you are creating a script that will control actions during a conversation. Pass the variable nAction from the conversation to tell the script which case you want to perform. For instance, pass 100 as the nAction argument to execute the code for case 100.
If you need more information on what a case statement is, see the Wikipedia entry on case statements.
A common way to control the action in conversation switches is with ActionPauseCutscene() and AssignCutsceneActionToObject(). A cut scene action is an action that has a special flag that tells the pause function to resume once the action has been complete. An example from the OC would is:
ActionPauseCutscene(1000, FALSE); AssignCutsceneActionToObject(oRegulator, ActionWait(1.0f));
This example uses a regulator because the example it comes from (a romance script in module 3500) needed to keep both speakers available for other actions. For best results, a regulator is an Ipoint speaker, which can be found under Blueprints > Placeables > Misc Props. I found that removing the heartbeat from the Ipoint and also using it as the speaker is a good way to make sure that you don't run into conflicting action assignments.
Once you have the pauses set and you static cameras place on your converations nodes, you can add custom functions in the case that will control the movement of other characters. For instance, in the following example you can see that there are a number of custom functions that are included in the file that get referenced.
case 6: ActionPauseCutscene(15000, FALSE); AssignCutsceneActionToObject(oRegulator, ActionWait(15.0f)); MoveCameraman1Again(); PlayRomanceStinger(); MovePC(); DelayCommand(11.0f, FadeOut()); break;
and further down:
void MoveCameraman1Again()
{
object oCameraman = GetTarget("3501_cameraman1");
object oWP = GetTarget("3501_wp_camerman2");
AssignCommand(oCameraman, ClearAllActions(TRUE));
DelayCommand(1.0f, AssignCommand(oCameraman, ActionForceMoveToObject(oWP, FALSE)));
}
Note that I usually use GetNearestObjectByTag instead of GetTarget, but that's just because I'm not sure what GetTarget really does.
Obviously you can go pretty crazy with this. Here is the base code from the template for reference:
//
/*
master script for conversation X
*/
//
#include "ginc_actions"
void main(int nAction)
{
object oPC = GetPCSpeaker();
switch ( nAction )
{
case 100: //
break;
case 200: //
break;
case 300: //
break;
case 400: //
break;
case 500: //
break;
}
}
Recent comments
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 25 weeks ago
2 years 26 weeks ago
2 years 42 weeks ago
2 years 43 weeks ago
2 years 47 weeks ago
2 years 47 weeks ago
2 years 50 weeks ago