But what is actually currently happening, is that I talk to the mayor, and exit the conversation before I change the variable. If I retalk to him, I get the "Have you done it yet"? line of conversation. What am I doing wrong with this? Thanks for any and all help.
Conversation woes
Débuté par
LordNyvek
, nov. 19 2011 04:36
#1
Posté 19 novembre 2011 - 04:36
Alright, so I have a conversation that the player is supposed to have with my town's mayor. On the onset of the conversation, I set a local variable "mayor" to 0 on the player. If he accepts the quest the mayor gives him, I then set the variable to 1. Theoretically, if the player talks to him again, instead of the initial quest conversation, he does a simple "Have you done it yet?" that floats above his head.
But what is actually currently happening, is that I talk to the mayor, and exit the conversation before I change the variable. If I retalk to him, I get the "Have you done it yet"? line of conversation. What am I doing wrong with this? Thanks for any and all help.
But what is actually currently happening, is that I talk to the mayor, and exit the conversation before I change the variable. If I retalk to him, I get the "Have you done it yet"? line of conversation. What am I doing wrong with this? Thanks for any and all help.
#2
Posté 19 novembre 2011 - 05:37
I think you're doing this the hard way. You can use local integers to store the quest state, or you can just set and use the quest state. Then you use fall-through logic:
1. If the quest is in completed state: "Thank you for the help you gave us."
2. If the quest is in progress: "Hurry up!"
3. If the quest hasn't been started: "Oh please oh please could you help us?"
You check for the quest state with gc_journal_entry in the Conditions tab and advance it with questname(quest state) in the Quest tab, as explained in this tutorial.
1. If the quest is in completed state: "Thank you for the help you gave us."
2. If the quest is in progress: "Hurry up!"
3. If the quest hasn't been started: "Oh please oh please could you help us?"
You check for the quest state with gc_journal_entry in the Conditions tab and advance it with questname(quest state) in the Quest tab, as explained in this tutorial.
#3
Posté 19 novembre 2011 - 01:40
Thanks, MasterChanger. I'll take a look at this soon as I get home from work. I spent about 45 minutes trying various different things, all ending in failure.
#4
Posté 19 novembre 2011 - 01:53
Incidentally, quest state is just a variable. The journal gets it's own script because the journal script handles the journal stuff in addition to variable setting.
#5
Posté 19 novembre 2011 - 04:32
Have a look at the node on the conversation. line that opens the mayors lines. Is it set to once only. If that is the case it will jump though regardless of the quest state.
The others are right, you can do this with with the quest log or journal entries but your way should work too.
Also look at the test you have given for the variable on the mayors line, I'm guessing you are looking for a not equals 1.
B.T.W. You don't have to set the variable to 0 at the start of the convo. You can simply set it to one at the correct time. Having lines that change variables without reason can cause you grief later on. That line may well set it back to zero whatever its state.
Finally if it's really bugging you, export it to an erf and link it up here and I or some other kind person will look at it for you if that would help.
PJ
The others are right, you can do this with with the quest log or journal entries but your way should work too.
Also look at the test you have given for the variable on the mayors line, I'm guessing you are looking for a not equals 1.
B.T.W. You don't have to set the variable to 0 at the start of the convo. You can simply set it to one at the correct time. Having lines that change variables without reason can cause you grief later on. That line may well set it back to zero whatever its state.
Finally if it's really bugging you, export it to an erf and link it up here and I or some other kind person will look at it for you if that would help.
PJ
Modifié par PJ156, 19 novembre 2011 - 04:34 .
#6
Posté 19 novembre 2011 - 06:07
I will second what MC and Kamal have said. Try to use the journal for tracking quest stats. It really will make your life easy. There are nice pre-made scripts for this and everything. Also, if you only want a part of the conversation to fire once, go to the NODE tab and select "once per game". That will make the convo only fire once. This can really help make characters feel real.
#7
Posté 19 novembre 2011 - 06:14
I did this again and again and again and again for BGR since it's the way they did it in Baldur's gate without a single problem.
Single value state (0,1):
---------------------------------
//gc_speakself:
int StartingConditional(){
if (GetLocalInt(OBJECT_SELF,"speak")){
return TRUE;
}
return FALSE;
}
-----------------------------------------------------------
//ga_speakself :
void main(){
SetLocalInt(OBJECT_SELF,"speak",TRUE);
}
---------------------------------------------------------------------------
Many value possible :
-----------------------------------------------------------------------------------------------------------------------------------------
//ga_move
void main(int moveStatus){
SetLocalInt(GetModule(),"Move",moveStatus);
}
---------------------------------------------------------------------------------------------------------------------------------------
//gc_move :
int StartingConditional(int moveStatus){
if (GetLocalInt(GetModule(),"Move")==moveStatus){
return TRUE;
}
return FALSE;
}
-------------------------------------------------------------------------------------------------------------------------------------------
If you are a bit observant, you'll see that for the first batch the value is stored into the conversation holder, while in the second it's stored into the module.
This has to do with the scope of the value. Is it needed only for an object (the NPC you are talking to) or is it needed somewhere else for triggering event ?
gc scripts are in the green panel.
ga scripts are in the pink panel.
Using journal entry and existing scripts for it work as well, but all the events need to be recorded in the journal.
Be sure that all the exiting path of a conversation root node has their ga_ scripts set.
Single value state (0,1):
---------------------------------
//gc_speakself:
int StartingConditional(){
if (GetLocalInt(OBJECT_SELF,"speak")){
return TRUE;
}
return FALSE;
}
-----------------------------------------------------------
//ga_speakself :
void main(){
SetLocalInt(OBJECT_SELF,"speak",TRUE);
}
---------------------------------------------------------------------------
Many value possible :
-----------------------------------------------------------------------------------------------------------------------------------------
//ga_move
void main(int moveStatus){
SetLocalInt(GetModule(),"Move",moveStatus);
}
---------------------------------------------------------------------------------------------------------------------------------------
//gc_move :
int StartingConditional(int moveStatus){
if (GetLocalInt(GetModule(),"Move")==moveStatus){
return TRUE;
}
return FALSE;
}
-------------------------------------------------------------------------------------------------------------------------------------------
If you are a bit observant, you'll see that for the first batch the value is stored into the conversation holder, while in the second it's stored into the module.
This has to do with the scope of the value. Is it needed only for an object (the NPC you are talking to) or is it needed somewhere else for triggering event ?
gc scripts are in the green panel.
ga scripts are in the pink panel.
Using journal entry and existing scripts for it work as well, but all the events need to be recorded in the journal.
Be sure that all the exiting path of a conversation root node has their ga_ scripts set.
Modifié par Shallina, 19 novembre 2011 - 06:18 .
#8
Posté 19 novembre 2011 - 06:32
If you download my Silverwand Sample Campaign you will find that it has a couple of very simple quests with straightforward conversations that demonstrate how to make use of the campaign journal. It particular the quest with the Three Stooges works exactly as you have described.
There is also Justin Gattuso's Conversation Tutorial and Obsidian's Writing Conversations How To but I've found there is no substitute for looking at working examples.
Regards
There is also Justin Gattuso's Conversation Tutorial and Obsidian's Writing Conversations How To but I've found there is no substitute for looking at working examples.
Regards





Retour en haut






