so the following script compiles fine and gives the first update but doesn't give the next 6 updates like i need it to. can someone please tell me if i missed something?
so the following script compiles fine and gives the first update but doesn't give the next 6 updates like i need it to. can someone please tell me if i missed something?
#include "pqj_inc" // journal include
#include "nw_i0_tool"
void main()
{
object oPC = GetLastUsedBy();
object oBox = GetItemPossessedBy(oPC, "memorybox"); // item created on PC when entering the world
string sName = GetName(OBJECT_SELF);
int nBug = 1;//change to 0 once testing is done
int nCheck = GetLocalInt(oBox, sName);
if (!GetIsPC(oPC)) return;//if not a pc stop
if(nBug == 1)
{ //if debugging the script
SpeakString("Plant Name: "+sName, TALKVOLUME_SHOUT);
//speak the plant name
if(!GetIsObjectValid(oBox))
{ //if the box is NOT VALID
SpeakString("The character does not have a valid memorybox.", TALKVOLUME_SHOUT);
}
if(nCheck == 1)
{//if the pc has used this named thing before
SpeakString(sName+" is marked as used.", TALKVOLUME_SHOUT);
return;
}
else
{ //if the pc has not used this named thing before
SpeakString(sName+" is marked as NOT USED.", TALKVOLUME_SHOUT);
}
}
SetLocalInt(oBox,sName,1); //set plant name as int ref on box
ExportSingleCharacter(oPC); //save pc thereby saving box info
int nInt = RetrieveQuestState("q_plants",oPC);
if(nBug == 1)
{ //if debugging == 1
SpeakString("PlantName: "+sName+" SetTo: "+IntToString(GetLocalInt(oBox,
sName)), TALKVOLUME_SHOUT);
SendMessageToPC(oPC, "PC Quest State: "+IntToString(nInt));
}
if (nInt >= 10 && nInt < 80)
{
AddPersistentJournalQuestEntry("q_plants",nInt+10, oPC,FALSE);
FloatingTextStringOnCreature("** Your Journal Has Been Updated **", oPC);
DelayCommand(2.0, FloatingTextStringOnCreature("** Character Saved **", oPC));
GiveXPToCreature(oPC, 1000);
}
}
yes, this is a quest, so it's journal updates.
ok, implemented the extra debug and tested.. got some weird results...
i'd like to say, this script worked fine the last time i ran my server about a year ago and nothing in the quest has changed...
so did 4 tests, got different results, but yet still all the same...
test 1: (quest removed from pc)
7 plants touched/used
only 1 gave an update, the 3rd plant touched. (all should give updates)
quest state at 10 when touched and 20 after. (this part worked)
test 2: (quest removed from pc)
7 plants touched/used
only 1 gave an update, the 5th plant touched.
quest state at 10 when touched and 20 after.
test 3: (quest removed from pc)
7 plants touched/used
only 1 gave an update, the 6th plant touched.
quest state at 10 when touched and 20 after.
test 4: (quest removed from pc)
7 plants touched/used
only 1 gave an update, the 2nd plant touched.
quest state at 10 when touched and 20 after.
in my head i'm simply thinking... "wtf is going on?"
can anyone explain this? why only one plant, at random, is working?
A few questions that might help you figure it out:
*pounds head on desk*
did compile all scripts in my mod and found nwnx_funcs wasn't compiling.
looked at why, missing nwnx_funcs_effs.nss (include)
downloaded the latest version.
installed it.
retested.
works fine.
it took me a few to realize the script might not be the issue and it might be the memory box wasn't being set properly.
i do thank you for your assistance BelowTheBelt.