|
| Subscribe now to receive important news, game releases and site updates |
|
Download a demo
Full version download immediately after purchase!
You can use any credit card.
|
|
You can now offer your support and also make money by selling 3 Skulls RPG. You receive 30% commision per sale. If you do not want to let this opportunity pass then act now and register for free.
You will get your own affiliate Control Panel from where you can generate the links to put on your webpages and monitor your generated sales.
Affiliate Registration |
|
Creating Quests in LT
Written by Throndir
In scripting, quests are usually done with specific flags and markers that tell the game itself whether or not a player has done a specific task. This can be shown in the following short logic path.
~Talked to NPC
~Quest given
~Talked to NPC again
~Quest task repeated to the player
~Talked to NPC the third time
~Quest task repeated again to the player
The player will then have to complete a specific task that will be recognized by the NPC. Once this task is completed, the NPC will then have a different set of dialogue to interact with. Once that is done, the reward is given.
~Completed task
~Talked to NPC
~Quest ended
~Reward given
Now, to prevent the player from getting the same set of dialogues as when you ended the quest, a flag or marker should be set telling the NPC to say something different after the quest is completed.
~Talked to NPC
~?Thanks for helping me!?
~Talked to NPC
~?Thanks for helping me!?
Through Legendary Tale?s scripting, setting up flags or markers can be done with Globals. Since Globals itself are deleted each time the game is exited and loaded in the LT engine, one should use Permanent Globals. The following is from the LT Help file.
Property Read/Write
syntax: GlobalPer(AName)
Description: Much like the Global property only that these variables are persistent meaning that they are saved with each save game and loaded when a game is loaded
Parameters: The name of the global variable. If the variable is a string you must precede its name with a dollar sign ($)
Return Value:The value of the global variable or 0 if it is undefined
Usage:You could use a persistent variable to keep track of the group's reputationSwitches are most often used for an NPC to say something different each time a specific marker is set, however, it can just be the use of a simple If and Else statement. Since a switch is practically a more complex If and Else statement. The following is an example of an NPC dialogue script that uses a switch.
function OnDialog(){
switch(GlobalPer(?Ring_Quest_Flag?)){
case 0:
defaultop();
break;
case 1:
op1();
break;
case 2:
op2();
break;
case 3:
op3();
break;
case 4:
op4();
break;
case 5:
op5();
break;
}
}
With this type of script, after a dialogue is begun with the NPC, the switch checks the value of the Permanent Global ?Ring_Quest_Flag?. Depending on the value of this Global, the effects are different. If the value is 1, the function op1() is brought up. If the value is 2, then it is op2(), and so on and so forth. Note that when the value of the Permanent Global is 0, false, or undefined, then that is the default switch as said in case 0:, with defaultop() to be brought up.
Now that we know how to set up flags and markers, we?ll take another look at the logic path.
~Permanent Global currently at undefined, or 0
~Talked to NPC
~Quest given
~Permanent Global set to 1
~Permanent Global currently at 1
Before a player talks to the NPC, the Permanent Global is usually at 0, or the default action to take when the value isn?t any of the other numbers. However, once the quest is given, another flag is set up so that the NPC would say something different after you?ve started the quest. Now that the Permanent Global is currently at 1, the next time you talk to it, the NPC wouldn?t say the same thing and start the quest all over again as it was when the Permanent Global had a value of 0.
~Permanent Global currently at 1
~Talked to NPC again
~Quest task repeated to the player
~Talked to NPC the third time
~Quest task repeated again to the player
~Permanent Global currently at 1
As long as the Permanent Global is at the value of 1, this NPC will always repeat the instructions of a quest until the Permanent Global is set to 2.
~Permanent Global currently at 1
~Completed task
~Permanent Global set to 2
Once the player has completed the task, the Permanent Global changes once again, this time to a value of 2. By doing this the Permanent Global would not be at the value of 1, but at 2. So if the value of the Permanent Global is at 2, then the NPC will be able to go on to the next set of dialogues where he rewards you, and ends the quest.
~Permanent Global currently at 2
~Talked to NPC
~Quest ended
~Reward given
~Permanent Global set to 3
~Permanent Global currently at 3
Once you talk to the NPC, receive your reward, and have the quest ended, the Permanent Global should be set to a different value. By doing this, the Permanent Global wouldn?t be at 2. For if it was still at a value of 2, then the player will be able to get multiple rewards. Once it is set to 3, the NPC will have a different set of dialogues.
~Permanent Global currently at 3
~Talked to NPC
~?Thanks for helping me!?
~Talked to NPC
~?Thanks for helping me!?
~Permanent Global currently at 3
The NPC will always be saying, ?Thanks for helping me!? as long as that Permanent Global has the value of 3.
Setting Quests in a Script
Changing the flags or markers of a Global is similar to variables. One can say that a Global is actually a variable, and it is one. The only difference is that a Global can interact with outside scripts, while a variable is limited to the script that it is in.
GlobalPer(?Ring_Quest_Flag?)As with variables, changing the value of the Read/Write property remains the same. For example, changing the Global?s value to a 1.
GlobalPer(?Ring_Quest_Flag?) = 1;
Or changing the value to a 3.
GlobalPer(?Ring_Quest_Flag?) = 3;
Or increasing the Global by an increment of 1.
GlobalPer(?Ring_Quest_Flag?)+=1;
Or
GlobalPer(?Ring_Quest_Flag?)++;
Or
GlobalPer(?Ring_Quest_Flag?) = GlobalPer(?Ring_Quest_Flag?) +1;
Now to let a script check what value the Permanent Global is, one can use switches or through simple If statements.
function OnDialog(){
switch(GlobalPer(?Ring_Quest_Flag?)){
case 0:
defaultop();
break;
case 1:
op1();
break;
case 2:
op2();
break;
case 3:
op3();
break;
case 4:
op4();
break;
case 5:
op5();
break;
}
}
A script that uses If statements would look like the following.
function OnDialog(){
if (GlobalPer(?Ring_Quest_Flag?) == 0){
defaultop();
}
if (GlobalPer(?Ring_Quest_Flag?) == 1){
op1();
}
if (GlobalPer(?Ring_Quest_Flag?) == 2){
op2();
}
if (GlobalPer(?Ring_Quest_Flag?) == 3){
op3();
}
if (GlobalPer(?Ring_Quest_Flag?) == 4){
op4();
}
if (GlobalPer(?Ring_Quest_Flag?) == 5){
op5();
}
}
They both accomplish the same thing, but the way it was scripted differs. Depending on the value of the Global, it brings up a different function/operation, or op#(). We?ll make a lengthier script that includes other operations.
function OnDialog(){
switch(GlobalPer(?Ring_Quest_Flag?)){
case 0:
defaultop();
break;
case 1:
op1();
break;
case 2:
op2();
break;
case 3:
op3();
break;
}
}
function defaultop(){
Echo(?Global is currently at 0. Hello, help me on this quest now! Now do the following instructions??);
GlobalPer(?Ring_Quest_Flag?) = 1;
}
function op1(){
Echo(?Global is currently at 1. Remember, these instructions??);
}
// Task completed. Maybe after killing a creature, etc. Then...
// ...Set GlobalPer(?Ring_Quest_Flag?) = 2;
function op2(){
Echo(?Global is currently at 2. Thanks for helping me! Here?s your reward.?);
GlobalPer(?Ring_Quest_Flag?) = 3;
}
function op3(){
Echo(?Global is currently at 3. No more rewards! Go away.?);
} |
|
|
on July 11 2007 20:32:59
Some of that is whacked. I think all the quote marks were changed to question marks  |
on August 20 2007 01:08:03
Thank you so freaking much! |
on November 29 2007 22:28:15
Danieltheslayer took the words right ou of my mouth... and about dour months earlier than me... |
|
|
| Please Login to Post a Comment.
|
|
|
Isometric action RPG
 |
|
Flash version of Dragon Age
 |
|
Isometric flash RPG
 |
|
Flash miniature RPG game
 |
|
Platform RPG
 |
|
Action Fantasy Game
 |
|
Isometric Flash RPG
 |
|
Zelda classic RPG for Flash
 | | Seeds Of Darkness |
 |
|
Top-down classic RPG
 |
|
Isometric Action RPG
 |
|
Fun WoW based RPG game
 |
|
Classic dungeon crawl RPG
 |
|
Strategy RPG game
 |
|
| Legendary Tales Online is a PBBG. |
|