game/core/scripts/client/core.cs- After:
exec("~/scripts/client/scriptDoc.cs");
- Add:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("~/scripts/RPGDialogEditor/ingameRPGDialogEditor.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/client/config.cs- Add:
Code: Select all
moveMap.bind(keyboard, "q", TalkTo);
game/scripts/client/default.bind.cs- Comment/remove the following line:
//moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Ryder\");", "");
- Add to the end of the file:
Code: Select all
// RPGdialog
moveMap.bind(keyboard, "q", TalkTo);
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
function TalkTo(%val)
{
if(%val)
commandToServer('RPGDialogRay');
}
moveMap.bind(keyboard, "q", TalkTo);
moveMap.bindCmd(keyboard, "1", "SelectAnswer(1);", "");
moveMap.bindCmd(keyboard, "2", "SelectAnswer(2);", "");
moveMap.bindCmd(keyboard, "3", "SelectAnswer(3);", "");
moveMap.bindCmd(keyboard, "4", "SelectAnswer(4);", "");
moveMap.bindCmd(keyboard, "5", "SelectAnswer(5);", "");
moveMap.bindCmd(keyboard, "6", "SelectAnswer(6);", "");
moveMap.bindCmd(keyboard, "7", "SelectAnswer(7);", "");
moveMap.bindCmd(keyboard, "8", "SelectAnswer(8);", "");
moveMap.bindCmd(keyboard, "9", "SelectAnswer(9);", "");
moveMap.bindCmd(keyboard, "0", "SelectAnswer(10);", "");
function OutOfRPGDialogFunction(%Number)
{
switch(%Number)
{
case 1: commandToServer('use',"Ryder");
case 2: %Number=0;//Does nothing... just a placeholder.
case 3: %Number=0;//Does nothing... just a placeholder.
case 4: %Number=0;//Does nothing... just a placeholder.
case 5: %Number=0;//Does nothing... just a placeholder.
case 6: %Number=0;//Does nothing... just a placeholder.
case 7: %Number=0;//Does nothing... just a placeholder.
case 8: %Number=0;//Does nothing... just a placeholder.
case 9: %Number=0;//Does nothing... just a placeholder.
case 0: %Number=0;//Does nothing... just a placeholder.
}
}
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/gui/optionsDlg.cs- Right after:
$RemapName[$RemapCount] = "Fire Weapon";
$RemapCmd[$RemapCount] = "mouseFire";
$RemapCount++;
- Add:
Code: Select all
$RemapName[$RemapCount] = "Talk to NPC";
$RemapCmd[$RemapCount] = "TalkTo";
$RemapCount++;
game/scripts/client/defaults.cs
- Add to the end of the file:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
$Pref::RPGDialog::Client::QuestionPath="art/dialogs/dlq/";//RPGDialog Question Path.
$Pref::RPGDialog::MaxOptions = 100;//RPGDialog Max Options.
$Pref::RPGDialog::ChatHudQuestionColor="\c1";//Question text Color on the chat hud.
$Pref::RPGDialog::ChatHudAnswerColor="\c5";//Answer text Color on the chat hud.
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/client/init.cs
- After:
exec("art/gui/remapDlg.gui");
- Add:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("art/gui/RPGDialog.gui");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
- After:
exec("scripts/gui/optionsDlg.cs");
- Add:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialog.cs");
exec("./RPGDialogAudioProfiles.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
- After:
Canvas.setCursor("DefaultCursor");
- Add
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
initRPGDialogEditor();
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/client/pref.cs- Add to the end of the file:
Code: Select all
$Pref::RPGDialog::ChatHudAnswerColor = "\c5";
$Pref::RPGDialog::ChatHudQuestionColor = "\c1";
$Pref::RPGDialog::Client::QuestionPath = "art/dialogs/dlq/";
$Pref::RPGDialog::MaxOptions = 100;
$Pref::Server::RPGDialog::ActionPath = "art/dialogs/dla/";
game/scripts/server/scriptExec.cs- After:
exec("./aiPlayer.cs");
- Add:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
exec("./RPGDialog.cs");
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/server/defaults.cs- After:
// Now add your own game specific server preferences as
// well as any overloaded core defaults here.
- Add:
Code: Select all
//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------
$Pref::Server::RPGDialog::ActionPath="art/dialogs/dla/"; //RPGDialog Action Path.
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------
game/scripts/server/pref.cs- Add to the end of the file:
Code: Select all
$Pref::Server::RPGDialog::ActionPath = "art/dialogs/dla/";
game/scripts/server/aiPlayer.cs- Change this function:
Code: Select all
//-----------------------------------------------------------------------------
// AIPlayer static functions
//----------------------------------------------------------------------------
function AIPlayer::spawnAtLocation()
- To the following:
function AIPlayer::spawnAtLocation(%name, %data, %spawnPoint, %Script, %Portrait, %startQuestion)
{
// Create the demo player object
%player = new AiPlayer()
{
//dataBlock = DemoPlayer;
dataBlock = %data;
path = "";
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint.getTransform());
%player.RPGDialogScript = %Script;
%player.RPGDialogPortrait = %Portrait;
%player.RPGDialogStartQuestion = %startQuestion;
%player.RPGDialogBusy = false;
%player.RPGDialogBusyText = 'Sorry but I\'m busy talking to %1 right now.';
%player.RPGDialogTalkingTo = 0;
return %player;
}
game/scripts/server/gameCore.cs- In this function:
function GameCore::startGame(%game)
- After:
// // Start the AI on the specified path
// AIPlayer::spawn("Path1");
- Add:
Code: Select all
AIPlayer::spawnAtLocation(Kaneda, DemoPlayer, spawn1, "Test", "test.png", 1);
*Note: This is how you spawn the NPCs - First is the NPC name: Kaneda
- Second is the datablock used for the NPC: DemoPlayer (derived from game/art/datablocks/aiPlayer.cs)
- Next is the new spawn point: spawn1
- Then the RPG Dialog script: Test (found in the dialogs folder)
- Next the RPG Dialog portrait: test.png (found in the dialogs folder)
- Finally, the RPG Dialog start question: 1
Create a spawnsphere in the world editor and name it "spawn1". Place it where ever you like. Also, if you don't want the player to use this as a spawn point, make sure it's NOT in the playerDropPoints simset.