A guy is standing by a tree. PC approaches him, and he says.
"Yes? What do you want?"
PC says, "I have a few questions."
"Well? Spit it out."
PC:
Where am I?
Who are you?
What are you doing here?
---------------------
PC then leaves and talks to another guy, who gives them a quest. PC returns to the guy standing by the tree and says,
"I have a few questions."
"Well? Spit it out."
PC:
Where am I?
Who are you?
What are you doing here?
Do you know where I can find the lost treasure of awesomeness?
-------------------------------------------
So pretty much what I want, is that last question to only appear when the PC has recieved the quest.
Text appears when the PC has the right Journal entry. Or perhaps a better way of doing it?
Débuté par
simomate
, sept. 20 2010 08:28
#1
Posté 20 septembre 2010 - 08:28
#2
Posté 20 septembre 2010 - 12:35
You want to set a variable to guide the quest forward and so you know what stage of the quest it is at.
It's personal choice on how you want to name the variable. For myself, I might call the variable lost_q and when it's given by the first NPC, set the value of the variable to 5. The next time the quest is updated, change the variable to 10, 15, 20, etc. The numeric value of the journal would match the variable.
Example -
NPC#1 - gives out the quest.
NPC#2 - can ask about the quest.
NPC#3 - can ask about the shed.'
SHED - where to find the treasure.
NPC1 - When you first hand out the quest, set the variable and the journal entry.
You now know the quest has been given to the player and set the variable lost_q to equal 5.
NPC#2 would then have a TEXT APPEARS conditional script on the "Do you know where I can find the lost treasure of awesomeness?" that checks the value of the variable.
If it equals five, display the line, if not, the line is not displayed as an option for the player.
Now somewhere during that conversation option, NPC#2 tells the player where they last heard the treasure of awesomeness was. This is where you'd use the ACTIONS TAKEN TAB and write another script to update the lost_q variable and also use the OTHER ACTIONS TAB to select the appropriate journal entry.
Changing the variable to 10 serves two purposes. First, it updates the quest variable and tells the game what stage the quest is at. Now that it equals 10, the player will no longer receive the "Do you know where I can find the lost treasure of awesomeness?" option. Since they already asked this question and the variable was updated from 5 to 10, it won't be displayed.
Second, it sets up the quest for the next stage of finding the treasure.
This is how I normally put quests together. With each variable update, 5, 10, 15, 20, etc., there is also a journal entry number associated with the variable number. This way, when I'm reading journal entry #25 for this particular quest, I know that quest entry is only handed out when the variable equals 25.
Setting variables is the key.
FP!
It's personal choice on how you want to name the variable. For myself, I might call the variable lost_q and when it's given by the first NPC, set the value of the variable to 5. The next time the quest is updated, change the variable to 10, 15, 20, etc. The numeric value of the journal would match the variable.
Example -
NPC#1 - gives out the quest.
NPC#2 - can ask about the quest.
NPC#3 - can ask about the shed.'
SHED - where to find the treasure.
NPC1 - When you first hand out the quest, set the variable and the journal entry.
SetLocalInt(GetModule(), "lost_q", 5);
You now know the quest has been given to the player and set the variable lost_q to equal 5.
NPC#2 would then have a TEXT APPEARS conditional script on the "Do you know where I can find the lost treasure of awesomeness?" that checks the value of the variable.
int StartingConditional()
{
// Inspect local variables
if(!(GetLocalInt(GetModule(), "lost_q") == 5))
return FALSE;
return TRUE;
}
If it equals five, display the line, if not, the line is not displayed as an option for the player.
Now somewhere during that conversation option, NPC#2 tells the player where they last heard the treasure of awesomeness was. This is where you'd use the ACTIONS TAKEN TAB and write another script to update the lost_q variable and also use the OTHER ACTIONS TAB to select the appropriate journal entry.
SetLocalInt(GetModule(), "lost_q", 10);
Changing the variable to 10 serves two purposes. First, it updates the quest variable and tells the game what stage the quest is at. Now that it equals 10, the player will no longer receive the "Do you know where I can find the lost treasure of awesomeness?" option. Since they already asked this question and the variable was updated from 5 to 10, it won't be displayed.
Second, it sets up the quest for the next stage of finding the treasure.
This is how I normally put quests together. With each variable update, 5, 10, 15, 20, etc., there is also a journal entry number associated with the variable number. This way, when I'm reading journal entry #25 for this particular quest, I know that quest entry is only handed out when the variable equals 25.
Setting variables is the key.
FP!
Modifié par Fester Pot, 20 septembre 2010 - 12:36 .
#3
Posté 20 septembre 2010 - 12:58
Setting variables on the module does work fine, but remember that if it isn't a single player module, it'll have some side-effects: People unrelated to the quest will get their variables triggered, even if they hadn't gotten that far in the quest. Usually, setting the variable to the player or to every player in the party of the player would give the intended benefits for a more stable and adaptable module.
#4
Posté 21 septembre 2010 - 03:02
didn't work... :s
#5
Posté 21 septembre 2010 - 03:18
Guess you did something wrong 
FP!
FP!
#6
Posté 21 septembre 2010 - 03:39
Nevermind it's working now.
#7
Posté 21 septembre 2010 - 07:32
Great to read that. Now you have the foundation working and you can use the same example for future quests or conversation trees to become available. Building becomes easier to grasp once you start winning these little battles.
Have fun!
FP!
Have fun!
FP!
Modifié par Fester Pot, 21 septembre 2010 - 07:32 .
#8
Posté 30 septembre 2010 - 03:35
You can directly access the local variables set by AddJournalQuestEntry(), or from conversations with this.
nQuestState = GetLocalInt(oPC,"NW_JOURNAL_ENTRYQuest" + szPlotID);
I do not remember if you can directly set a journal entry with a similar SetLocalInt()
nQuestState = GetLocalInt(oPC,"NW_JOURNAL_ENTRYQuest" + szPlotID);
I do not remember if you can directly set a journal entry with a similar SetLocalInt()





Retour en haut






