Hello NWN community,
I am coming back to this topic after a few months away. I have learned how to apply variables to a campaign database so that conversations can logically continue from one module to the next.
Here is a sample of a script I am using to do this:
void main(){ // Set the variables SetLocalInt(GetPCSpeaker(), "thorgrimopinesshal", 1);
// 10.12.12 Added campaign database variable so PC can continue interacting with Shal in future modules
object oPC = GetPCSpeaker(); SetLocalInt(oPC,"campaignshal",1); SetCampaignInt("RedemptionCampaign","campaignshal",1,oPC);}
I am still puzzling out how to retrieve the various variables from the campaign database and apply them to the PC when he/she starts the next module. I found an entry on the NWN Wiki that gives this script:
void main(){ object oPC = GetEnteringObject(); if(!GetIsPC(oPC))return; int i,iQuest; for(i=1; i<6; i++) { iQuest = GetCampaignInt("QUEST_STATUS","QUEST_"+IntToString(i),oPC); SetLocalInt(oPC,"QUEST_"+IntToString(i),iQuest); }}
This is a bit over my head. It would appear that the author (apologies, I didn't see an author's name) is using variables that follow the format QUEST_1, QUEST_2, QUEST_3 and so on, and then can retrieve all of the variables by only using QUEST_. I am not familiar at all with strings so perhaps that is limiting my understanding.
The variables I am using all follow a format like my script above..."campaignshal", "campaignlionel", and so on.
If someone can get me started on a script that will go in the OnClientEnter of my 2nd module I will finish the script out. I just need some pointers on how to get started.
Thanks in advance for the help!
EDIT: Apologies for the way the scripts are spacing. I tried to correct to no avail.
Modifié par UnrealJedi, 18 mars 2013 - 12:18 .