Author Topic: Help with Kill Count Quest  (Read 312 times)

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Help with Kill Count Quest
« on: June 25, 2011, 01:18:29 am »


               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
               
               

               
            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
Help with Kill Count Quest
« Reply #1 on: June 25, 2011, 04:00:36 am »


               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
    {
    }
}

               
               

               
            

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Help with Kill Count Quest
« Reply #2 on: June 25, 2011, 04:21:37 am »


               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 '<img'>

Thanks again