Aller au contenu

Photo

Quest not ending (again)


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Who said that I

Who said that I
  • Members
  • 492 messages

okay not entirely sure what I did wrong here, certainly it is something very minor but it does not seem to go past the point where the plotgiver tells you that he will open the door and reward you when you show proof of the deed you agreed to.

 

QG- Wanna kill vilain for me?

P- Yes

QG- Actiontakentab

#include "pqj_inc"
void main()
{
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p002state", 100);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p002", 1, oPC, FALSE);
 
object oTarget;
 
 
    // Unlock and open "DOOR_TO_CHICKEN_HOUSE".
    oTarget = GetObjectByTag("DOOR_TO_CHICKEN_HOUSE");
    SetLocked(oTarget, FALSE);
    AssignCommand(oTarget, ActionOpenDoor(oTarget));
}
 

 

 

QG- Got the head? (Textg appears when)

int StartingConditional()
{
 
    // Inspect local variables
     if (!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p002") == 1))
        return FALSE;
 
    return TRUE;
}
 

 

 

P- Yes (TAW)

int StartingConditional()
{
int nShow = OBJECT_INVALID != GetItemPossessedBy(GetPCSpeaker(), "ChickenHead");
return nShow;
}
 

 

 

QG-  reward

#include "pqj_inc"
void main()
{
    // Give the speaker some gold
    GiveGoldToCreature(GetPCSpeaker(), 150);
 
    // Give the speaker some XP
    GiveXPToCreature(GetPCSpeaker(), 200);
 
 
    // Remove items from the player's inventory
    object oItemToTake;
    oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "ChickenHead");
    if(GetIsObjectValid(oItemToTake) != 0)
        DestroyObject(oItemToTake);
    // Set the variables
    SetLocalInt(GetPCSpeaker(), "p002state", 300);
// Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();
 
    // Update the player's journal.
    AddPersistentJournalQuestEntry("p002", 3, oPC, FALSE);
 
 
object oTarget;
 
 
    // Close and lock "DOOR_TO_CHICKEN_HOUSE".
    oTarget = GetObjectByTag("DOOR_TO_CHICKEN_HOUSE");
    AssignCommand(oTarget, ActionCloseDoor(oTarget));
    SetLocked(oTarget, TRUE);
}
 

 

 

okay so what did I do wrong here?



#2
meaglyn

meaglyn
  • Members
  • 808 messages

Is there a starting conditional on the first QG option, or is the "got the head?" one listed first?

 

Aside from some parts that are hard to read, that looks like it should be working otherwise. If you have the "wanna kill villian?" line first with no TAW then it will fire all the time.



#3
Who said that I

Who said that I
  • Members
  • 492 messages
int StartingConditional()
{
int nShow = !GetLocalInt(OBJECT_SELF, "p002began");
return nShow;
}
 

 

 

is the line when you first speak with the QG



#4
meaglyn

meaglyn
  • Members
  • 808 messages

And you are setting that variable ("p002began")  to TRUE where?

 

You could probably change that starting conditional to something like this, since you want it to return TRUE if and only if the quest has not been started (JOURNAL state is 0):

if (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p002") == 0)
        return TRUE;
    return FALSE;

If you use p002began elsewhere then you probably want to set it in that first actiontaken you listed.



#5
Who said that I

Who said that I
  • Members
  • 492 messages

And you are setting that variable ("p002began")  to TRUE where?

 

You could probably change that starting conditional to something like this, since you want it to return TRUE if and only if the quest has not been started (JOURNAL state is 0):

if (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p002") == 0)
        return TRUE;
    return FALSE;

If you use p002began elsewhere then you probably want to set it in that first actiontaken you listed.

 

now i did that and the quest no longer works at the point you got to return the item xD



#6
Who said that I

Who said that I
  • Members
  • 492 messages

okay found out what the problem was here, it was the starting conditions on the second time you speak to the QG, it was set to check for the wrong phase of the quest! Thanks for your help guys! :D