Jike 1 Posted November 6, 2021 Much like the title suggests, I'm having issues with creating a script that's capable of both ending an active quest and awarding the PC some XP as a result. I've been using the two following lines of code to try to achieve this: //Using this line to end the quest by removing it from the journal. RemoveJournalQuestEntry(tat_IzizCaptive); //Using this line to award XP to oPC GiveXPToCreature(oPC, 250); However, when compiling so I can take it for a test run, compiling ends as it runs into syntax errors such as "Undeclared identifier 'tat_IzizCaptive' or 'oPC'" in the script. I've never done a script for this before so evidently I'm doing something wrong here I just can't quite figure out what. To be completely fair I likely inputted the quest name incorrectly as I'm unable to find the journal entry name. I have JRL Editor but that won't run even with all the DLLs present. EDIT: I realised I need to define the oPC identifier with "object oPC = GetFirstPC();" so I've solved that issue. It's mainly just the quest ending and whatnot that's the main issue now. I know I need to create an identifier for the string a string to identify the quest using "GetJournalEntry" but I'm not entirely sure how. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted November 6, 2021 Your problems are straightforward. In the first instance, you haven't declared the variables properly. Per nwscript.nss: void RemoveJournalQuestEntry(string szPlotID); Since the plot ID is a string it must be inside double quotes, like so: RemoveJournalQuestEntry("tat_IzizCaptive"); Note that this function removes the quest, as stated - i.e. deletes it entirely. Typically you will want to advance a quest to a closed stage, assuming one is available, so that it is still viewable by the player in the completed quests tab. You can do that with: void AddJournalQuestEntry(string szPlotID, int nState, int bAllowOverrideHigher=FALSE); Where you state the state number you want. The final TRUE/FALSE variable allows you to override a high numbered plot state (e.g. 90) with a lower number one (i.e. 20) if that is required. Typically it's not needed, but there are a handful of vanilla quests that have low numbered end states. If you are making your own custom quests, as seems to be the case here given the plot ID, then you can avoid that being a problem by using incrementing state numbers with the ending/s using the highest value/s. If instead you are trying to deal with the vanilla quest, its plot ID is tat17aa_jawarescue (all the quests are found in global.jrl). Also note that quest states can be set directly via a DLG, as is the case here when talking to the Jawa you free in the Sandpeople Enclave. For the second instance, as the compiler error stated, you have an undeclared variable, oPC. You either need to declare it in your script, like so: object oPC = GetFirstPC(); Or simply change your existing line to: GiveXPToCreature(GetFirstPC(), 250); 1 Quote Share this post Link to post Share on other sites
Jike 1 Posted November 6, 2021 Thanks for the information, that makes a lot more sense than what I was trying previously. 9 minutes ago, DarthParametric said: If instead you are trying to deal with the vanilla quest, its plot ID is tat17aa_jawarescue (all the quests are found in global.jrl). This in particular is very useful info, however I can't access the contents of global.jrl as my JRL Editor just crashes as soon as I try to launch it. Quote Share this post Link to post Share on other sites
Salk 374 Posted November 7, 2021 You can use K-GFF to access the content of global.jrl. Quote Share this post Link to post Share on other sites