Author Topic: Quest reminder?  (Read 1131 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quest reminder?
« on: May 24, 2016, 10:17:49 pm »


               

okay I got a little issue here.... The whole quest is persistent however the quest can be "restarted" when I restart the module and that was not my intent for this so am hoping someone could help me get this fixed...


 


here is my quest entry script:


 


NPC: Hello would you like to deliver these items?


Text appears when:




int StartingConditional()

{

int nShow = !GetLocalInt(OBJECT_SELF, "p026began");

return nShow;

}

 



 



PC says: Sure!

 

NPC:  Grand! Here are the items have fun now!

Onaction tab


 




#include "nw_i0_plotwizard"

#include "pqj_inc"

void main()

{

    // Set the variables

    SetLocalInt(GetPCSpeaker(), "p026state", 100);

// Get the PC who is in this conversation.

    object oPC = GetPCSpeaker();

 

    // Update the player's journal.

    AddPersistentJournalQuestEntry("p026", 1, oPC, FALSE);

}

 



 



idea of the quest: 

okay so the npc asks if the pc is willing to deliver some items to several NPC's throughout the city. though the pc keeps getting the welcome/questgive option the second time you speak to the NPC. how do I fix this?


               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Quest reminder?
« Reply #1 on: May 24, 2016, 10:23:58 pm »


               

Variables stored on a PC don't remain over a server reset. You'll either need to give all your PCs an undroppable item and store the variable on that item, or else use the Set/GetCampaignInt variables that stores the variable in a database.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Quest reminder?
« Reply #2 on: May 25, 2016, 12:09:35 am »


               

Some of those variables aren't stored on the PC either, but the NPC.  That also means multiple players can get odd results.  The StartingConditional for example...


 


Also you have a p06state variable you are tracking in parallel to setting the journal entry for p026 using persistent journals. You could just read the persisted journal entry variable on the PC which will be named  "NW_JOURNAL_ENTRYp026"  (e.g.  "NW_JOURNAL_ENTRY"  + quest tag). That would be persisted with the pqj stuff without dealing with persisting additional PC variables (unless you have states you need that are not represented by actual journal entries).


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quest reminder?
« Reply #3 on: May 25, 2016, 11:01:59 am »


               Okay well will try it out.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Quest reminder?
« Reply #4 on: May 25, 2016, 03:39:01 pm »


               

The variable names are also different - not sure if thats intentional.
Also - yeah, one sets the variable on the player, the other on the NPC.


int StartingConditional()
{
int nShow = !GetLocalInt(OBJECT_SELF, "p026began");
return nShow;
}
 

#include "nw_i0_plotwizard"
#include "pqj_inc"
void main()
{
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p026state", 100);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p026", 1, oPC, FALSE);
}



The reason you keep getting the same dialogue option/response is because you are looking for 

p026began

 

However, the onAction script is setting p026state to 100

It is never touching p026began

 

Perhaps im over simplifying it?


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quest reminder?
« Reply #5 on: May 25, 2016, 08:21:55 pm »


               



The variable names are also different - not sure if thats intentional.
Also - yeah, one sets the variable on the player, the other on the NPC.


int StartingConditional()
{
int nShow = !GetLocalInt(OBJECT_SELF, "p026began");
return nShow;
}
 

#include "nw_i0_plotwizard"
#include "pqj_inc"
void main()
{
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p026state", 100);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p026", 1, oPC, FALSE);
}



The reason you keep getting the same dialogue option/response is because you are looking for 

p026began

 

However, the onAction script is setting p026state to 100

It is never touching p026began

 

Perhaps im over simplifying it?

 




the only reason I kept that began line was to prefent the quest of breaking (or mainly I was afraid it would break). I broke the quest once before by tinkering with it hence why I kept it all.


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quest reminder?
« Reply #6 on: May 25, 2016, 09:19:27 pm »


               

okay got it to work thanks guys! '<img'>