Game Development Community

RPG Elements?

by Mads Ragnar · in Torque Game Builder · 11/25/2011 (9:25 am) · 3 replies

Hi,
What is the easiest way to make a quest system where the player is given a quest to go to different places and speak with different npc's?

And also is there someway to make dialogues? Chat with an npc? Buying/selling stuff and so on..

How can you make that in TGB?

Thanks,

About the author

Recent Threads

  • Torque 2d rpg?

  • #1
    11/28/2011 (9:50 am)
    There's no easy way to make a quest system. In one game I'm writing, I'm kind-of "brute forcing" it. The quests are objects that have variables in them. As the player gets to certain areas, I change the variables, like in this horrible, horrible example below...

    $princessQuest = new ScriptObject();
    $princessQuest.name = "Find the Princess";
    $princessQuest.text = "You need to find the princess in the dungeon!";
    $princessQuest.complete = false;
    $princessQuest.playerHas = false;
    
    ...
    
    function talkToGuard()
    {
      guardSays( $princessQuest.text );
      $princessQuest.playerHas = true;
      putPrincessInDungeon();
    }
    
    ...
    
    function talkToPrincess()
    {
      if( $princessQuest.playerHas )
      {
        princessSay( "Thanks for finding me!" );
        $princessQuest.complete = true;
      }
      else
      {
        // Princess is either in the castle or the dungeon.
        // Since we don't have the quest, she's in the castle.
        princessSay( "I'm going to explore the dungeon!" );
      }
    }

    That example is *very* rough... after you design all of your quests, you can build a system that fits your quests and is generic.

    You can build dialogs with the GUI system or with the t2dTextObjects in your scene.
    #2
    11/28/2011 (11:57 am)
    you are way too hard on yourself William, thanks for the example!

    Always~
    Vickie ;)
    #3
    11/29/2011 (6:25 am)
    I have made an RPG NPC/chat system for TGB, but it's a bit too complicated to share :/ It uses multiple scene windows and scenegraphs. There may be an easier way to do it using the built in GUI system, I'm not sure.