Jump to content

RPG Dialog resource updated for T3D 3.8


SqHd
 Share

Recommended Posts

RPG Dialog 1.4 to T3D 3.8

(*It also works in T3D 3.9)


Since I couldn’t get the Yack Pack working in T3D 3.8, I decided to check out an old GG resource called: RPG Dialog (v1.4). After some experimenting, I was able to get NPCs spawning with the dialog options. Only issue is the sound isn't working. See console errors:


scripts/client/RPGDialog.cs (190): Unable to find function alxIsPlaying

scripts/client/RPGDialog.cs (191): Unable to find function alxStop

scripts/client/RPGDialog.cs (194): Unable to find function alxPlay



DropBox link: https://www.dropbox.com/sh/gxfy58huq3hvrpl/AACefZCSBHwnU4JAftDhzv9Ga?dl=0


I used the following forum topics to get this working:

(Original Resource): http://www.garagegames.com/community/resources/view/3531

https://www.garagegames.com/community/forums/viewthread/93667

http://www.garagegames.com/community/forums/viewthread/75606

https://www.garagegames.com/community/forums/viewthread/137872

Link to comment
Share on other sites

game/core/scripts/client/core.cs


- After:

exec("~/scripts/client/scriptDoc.cs");


- Add:

//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------   
exec("~/scripts/RPGDialogEditor/ingameRPGDialogEditor.cs");   
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------

 


game/scripts/client/config.cs


- Add:

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:

// 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:

$RemapName[$RemapCount] = "Talk to NPC";
$RemapCmd[$RemapCount] = "TalkTo";
$RemapCount++;

 


game/scripts/client/defaults.cs


- Add to the end of the file:

//----------------------------------------------------------------
//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:

//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------    
exec("art/gui/RPGDialog.gui");
//----------------------------------------------------------------
//RPGDialog Code End
//---------------------------------------------------------------- 

 

- After:

exec("scripts/gui/optionsDlg.cs");


- Add:

//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------     
exec("./RPGDialog.cs");
exec("./RPGDialogAudioProfiles.cs");   
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------

 

- After:

Canvas.setCursor("DefaultCursor");


- Add

//----------------------------------------------------------------
//RPGDialog Code Begin
//----------------------------------------------------------------        
initRPGDialogEditor();      
//----------------------------------------------------------------
//RPGDialog Code End
//----------------------------------------------------------------

 


game/scripts/client/pref.cs


- Add to the end of the file:

$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:

//----------------------------------------------------------------
//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:

//----------------------------------------------------------------
//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:

$Pref::Server::RPGDialog::ActionPath = "art/dialogs/dla/";

 


game/scripts/server/aiPlayer.cs


- Change this function:

//-----------------------------------------------------------------------------
// 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:

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.

Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...