Two Strife Dialogue questions

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Two Strife Dialogue questions

Postby Ravick » Tue Dec 25, 2012 7:16 pm

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
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: Two Strife Dialogue questions

Postby cocka » Wed Dec 26, 2012 7:47 am

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 allExpand view
#include "zcommon.acs"

script 1 (int tid)
{
int convid = random(1, 10);
Thing_SetConversation(tid, convid);
}
User avatar
cocka
 
Joined: 02 Jul 2011
Location: Hungary

Re: Two Strife Dialogue questions

Postby Blzut3 » Wed Dec 26, 2012 2:00 pm

For 1 you might do what cocka demonstrated but also use StartConversation.

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 allExpand view
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).
}
Blzut3
Pronounced: B-l-zut
 
Joined: 24 Nov 2004

Re: Two Strife Dialogue questions

Postby Ravick » Wed Dec 26, 2012 10:30 pm

Thanks a lot guys! :D
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil


Return to Editing

Who is online

Users browsing this forum: Ahrefs [Bot], GoreMarine, Yandex [Bot] and 4 guests