Two Strife Dialogue questions

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Ravick
Posts: 2002
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Two Strife Dialogue questions

Post 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.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: Two Strife Dialogue questions

Post 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);
}
Blzut3
 
 
Posts: 3144
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Two Strife Dialogue questions

Post 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).
}
User avatar
Ravick
Posts: 2002
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: Two Strife Dialogue questions

Post by Ravick »

Thanks a lot guys! :D
Locked

Return to “Editing (Archive)”