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.
Two Strife Dialogue questions
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.
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.
Re: Two Strife Dialogue questions
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:How do I make a script that randomly calls one of different possible pages,
Code: Select all
#include "zcommon.acs"
script 1 (int tid)
{
int convid = random(1, 10);
Thing_SetConversation(tid, convid);
}
-
-
- Posts: 3144
- Joined: Wed Nov 24, 2004 12:59 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: Two Strife Dialogue questions
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:
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
Thanks a lot guys!