我终于决定在我的游戏中添加任务。我希望任务彼此独立。也许以后的一个,一个在访问该任务之前完成了另一个任务。反正。
我该怎么做?我想了很多。我是一个 PHP/Javascript/Mysqli 人。
您与 NPC 交谈,如果您选择正确的“答案”,他们将开始任务。你做任务,你可能需要和其他 NPC 交谈。这一切都取决于。我如何存储对话并显示它们?
谢谢。
编辑
这就是我“完成”的事情。
var people = [];
people[1]=['name'=>'Joe'];
people[1]['questions'][1] = 'Why, hello there';
people[1]['questions'][1]['send'] = 1;
people[1]['questions'][2] = 'My name is Joe, You seem to be new around here';
people[1]['questions'][2]['send'] = 2;
people[1]['questions'][3] = 'Why certainly! How about I send you on a quest to help you. It will get you aquainted with Corgate';
people[1]['questions'][3]['send'] = makequest(1);
people[1]['answers'][1] = array('Hello, who are you?');
people[1]['answers'][1]['send'] = 2;
people[1]['answers'][2] = array("I'm not new! Good bye!",'Yes I am, Can you help me?');
people[1]['answers'][2]['send'][1] = 3;
people[1]['answers'][2]['send'][2] = endthis();
很草率。是的。基本上,它从问题开始。然后“发送”到具有该 ID 的答案。然后,根据选择的答案数组,然后将其发送到相应的问题。