Page 1 of 1

Two Strife Dialogue questions

Posted: Tue Dec 25, 2012 6:16 pm
by Ravick
1 - How do I make a script that randomly calls one of different possible pages, like the peasants or idle alcolites in Strife?

2 - Could someone give me an example of the use of the "ifitem" conditional in a more complex script? I want a NPC to talk to the player for 2-3 pages and then to check if player have an specifically item. If player have it, the NPC should go to a new page, if not it should show the current page.

Thanks in advance.

Re: Two Strife Dialogue questions

Posted: Wed Dec 26, 2012 6:47 am
by cocka
How do I make a script that randomly calls one of different possible pages,
I don't know the solution, but you can create different conversations for the same character. Put a line in front of the character or use a thing executed special and assign this script to it:

Code: Select all

#include "zcommon.acs"

script 1 (int tid)
{
int convid = random(1, 10);
Thing_SetConversation(tid, convid);
}

Re: Two Strife Dialogue questions

Posted: Wed Dec 26, 2012 1:00 pm
by Blzut3
For 1 you might do what cocka demonstrated but also use [wiki]StartConversation[/wiki].

For 2, I'm not going to write a complex example, but the use of ifitem is fairly simple. The page you want to jump to is set in the link property and then you have ifitem block for each condition that needs to be met:

Code: Select all

page
{
    link = 2;
    ifitem
    {
        item = 1;
        amount = 1;
    }

    // The rest of your page properties here
}
page
{
    // If this is page 2 then it will jump to here when the previous page is opened (without showing the previous page).
}

Re: Two Strife Dialogue questions

Posted: Wed Dec 26, 2012 9:30 pm
by Ravick
Thanks a lot guys! :D