ACR Quest System

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

OK, nearly there. Not actually working, but it'll probably be a typing error. One thing I still can't figure out: I can see the XP reward in the journal entry for the whole quest, but where do you set at which node it's actually given (or is it automatic somehow?).
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

It's automatically awarded when the task is completed. Cipher implemented this to ensure that only people in the current party doing the quest could be rewarded xp, and not anyone else who joined up after the fact just to get the reward. So it's not dependent on conversations for xp.

GP, however, is different. GP is rewarded from the conversation after the deed is done.
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

indio wrote:It's automatically awarded when the task is completed. Cipher implemented this to ensure that only people in the current party doing the quest could be rewarded xp, and not anyone else who joined up after the fact just to get the reward. So it's not dependent on conversations for xp.
Yes, I see what it's doing, but not how. For example, a patrol might have 3 triggers to cross setting the quest state to 4, but the whole thing is not wrapped up until the quest state is set to 5 by the final convo. Where do you specify that the XP is awarded at state=4 (otherwise how does it know you've "finished" the quest? There might be another 6 triggers to find..?)

BTW my earlier optimistic post should be tempered by the fact that parts of Indio's quest lab and my experiments don't work. Things set by the convos are fine, but nothing is happening when entering triggers. Do you need to use any type of trigger in particular? (I'm using "New Generic" as a base) or is there any known issue with the acr_trigger scripts. I must admit to not adding them to triggers in the OAS because they stop transitions working. :oops:

Thanks for your patience,
Teric
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

The "broken AT" problem with acr triggers should also be sorted out by a recompile once the alfa_acr.hak gets updated by Worldgate- somehow we'd not included the code to manage Obsidian-style ATs, in part on the presumption that builders would be using doors and seamless ATs (I think we were all fairly repulsed by the showy, animated, glowing ATs NWN2 came with). In any case, it's a fix I've already got in place on my build machine, I've just fallen behind in propagating it out across the Worldgate.

re: quest triggers- two things. Make sure each quest trigger has a unique tag, as it checks the tag of the trigger to decide if you've already triggered it or not. With multi-trigger and/or multi-target kill quests, the system seems to award quest XP on each trigger/target dealt with, so you actually have to adjust the XP down in the module journal, lest it be multiplied for PCs performing the quest. (three-trigger scouting quest set for 25 xp would give 25 at trigger one, 25 at trigger 2, and 25 at trigger 3. I'd asked about a way to tie it to LowerState/UpperState, but I think I was misunderstood on the matter.

I'll let you know when the Quests/ATs fix is up on the worldgate. Should be soon, I'll give up on trying to patch the death system bugs before putting the rest up.
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

Roger that, Major Tom.
Part of my problem is that acr_trigger_i in the OAS doesn't include the quest code. Heh. Is it safe to just copy a newer version over?
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Unless you're connected to a database (locally or the ALFA hosted one), none of the quests will work.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

If you want to award quest XP on a trigger, define the UPPER state on the trigger to the state at which the XP should be awarded, typically one more than the LOWER (activation) state.

AL, are you seeing quest XP rewards on all triggers?
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

ç i p h é r wrote:If you want to award quest XP on a trigger, define the UPPER state on the trigger to the state at which the XP should be awarded, typically one more than the LOWER (activation) state.
lol. Yes, but where do I define "the state at which XP should be awarded"?
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Teric, it gets awarded automatically as the PC completes the quest.

So what does complete the quest mean?

1. Kills the mob
2. Finds the object
3. Enters the exploration/scouting trigger

After the quest is completed, you return to the quest giver who gives you some coin.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Teric neDhalir wrote:lol. Yes, but where do I define "the state at which XP should be awarded"?
It used to be required on all quest triggers, but you only need it on the trigger that will award the XP. For exploration quests or quests that are not sequential in nature (triggers activated in random order), you probably want it on all the triggers so the last trigger the PC activates (increments quest state) will grant the XP reward. You can put them on all triggers anyway, if it's easier for you.

XP will be awarded when the PC actually "completes" the quest, as Indio has described above.
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

lol x 2. Yeah I get this now, but only after reading the code in acr_quest_i. I'm afraid it's not made very clear anywhere that the xp is awarded when quest state >= upper state.

I don't know what I've done to get this working (re-compiled all the scripts, perhaps?) but finally the triggers seem to be working and xp is being awarded in the right place.

It's no wonder I don't have much hair left :)
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

You didn't say you wanted a primer on the mechanics of the quest system. :P
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

Another question, I'm afraid.

I have an errand quest which uses acr_quest_errand and acr_quest_reward at the quest giver and the errand recipient. The giver recognises the PC as not having done the quest before, gives the quest, creates the quest item and the journal is updated. The recipient recognises that the PC has the quest, awards gold and marks the quest as completed in the journal (and may or may not delete the quest item, I forgot to check). Where's the XP? I can't see where or how it's awarded from the code..? Any ideas?
Teric
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Did you define any quest XP in the journal?
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

He did have Quest XP defined in the journal entry. As far as I can tell, the following function is the only way Quest XP is set up to be awarded for errand quests in acr_quest_i.nss :

Code: Select all

  411 void ACR_QuestItemOnAcquire(object oPC, object oItem)
  412 {
  413     string sQuest = GetLocalString(oItem, ACR_QST_NAME);
  414 
  415     // exit if there is no bounty on this item
  416     if (sQuest == "") { return; }
  417 
  418     // ignore non player characters
  419     if (GetIsPC(oPC))
  420     {
  421         int nUpper = GetLocalInt(oItem, ACR_QST_UPPER_STATE);
  422         int nState = ACR_RetrieveQuestState(sQuest, oPC);
  423 
  424         // determine if conditions for the bounty have been met
  425         // lower boundary prevents a PC who hasn't taken the quest from earning quest XP
  426         if (nState > 0 && nState <= nUpper)
  427         {
  428             int nXP = 0; nState++;
  429 
  430             // award quest XP if the quest has reached its end state
  431             if (nState >= nUpper) { nXP = GetJournalQuestExperience(sQuest); }
  432 
  433             // update the quest state
  434             ACR_AddPersistentJournalQuestEntry(sQuest, nState, oPC, TRUE, FALSE, FALSE, nXP);
  435         }
  436 
  437         // store an object reference on the PC for easy retrieval (avoids costly inventory loops)
  438         SetLocalObject(oPC, sQuest + GetTag(oItem), oItem);
  439     }
  440 }
acr_quest_errand creates the item in inventory, and acr_quest_reward cleans it up and gives gold. Neither have the capacity to grant XP.

It would appear, by the current configuration, that errand quests are only testing for completion (and quest state) OnAcquire of the quest item- perhaps some of this was intended for OnUnAcquire? Looks like some was pasted in from the bounty quest OnDeath event, so maybe it didn't quite get finished.
Locked