Aller au contenu

Photo

Help with Kill Count Quest


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

#1
Rowwena

Rowwena
  • Members
  • 33 messages
Hi,

I am looking for a little help/advice on scripting what "should be" a simple quest. I want to have an old fashioned newbie quest where the Quest Giver tells the PC to kill all of the rats in the basement and when the correct number is exterminated the PC will get the Journal Entry that the job is done and to return to the Quest Giver for the reward.

I had a script several years ago during my last time working on my modules, but after a long time away I have forgotten most of what I did then, and I am very rusty at my scripting. If I remember right, I had to do something with variables and integers that included an incrimental progression.

If anyone can point me to any tutorials or sample scripts (I am very good at reworking scripts still), I would appreciate it.  I have tried searching but most everything I come up with are links to the old bioware forums and direct me just to the the bioware home page.

Thanks

#2
Rubies

Rubies
  • Members
  • 292 messages
Hi there,

These should do what you're after. Not exactly the best code, though.

Conditional script ("TextAppearsWhen" option in conversation editor):
int StartingConditional()
{
    object oPC = GetPCSpeaker();
    int nRats = GetLocalInt(oPC, "DeadRats");

    if (nRats >= 10)
    return TRUE;

    else
    return FALSE;
}

Rat OnDeath script addition:
void main()
{
    object oPC = GetLastKiller();
    int nRats = GetLocalInt(oPC, "DeadRats");

    SetLocalInt(oPC, "DeadRats", nRats+1);

    if (nRats = 10)
    {
    // AddJournalQuestEntry("DeadRats", 1, oPC);
    // - This one requires a bit more manual setup to your journal.
    }

    else
    {
    }
}


#3
Rowwena

Rowwena
  • Members
  • 33 messages
Thank you Rubies!

I will give it a try as soon as finish cleaning up some of the old scripts and conversations I made playing around with various quests. I tend to give scripts easy names to remember until they are working right then change them to something with logical naming conventions - but then I have to clear out the trash :)

Thanks again