Hello! In this thread I will explain how to use the ZDoom Strife Dialogue Format, or ZSDF. I know it's documented on the wiki, but I wish to explain it in a way that makes it easy to understand.
First, add these top two lines in the file:
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
The first line indicates that this is ZDoom's format. (USDF uses namespace = "Strife";, but don't worry about that. ZSDF is simpler than that.)
I forgot what SCRIPT00 does, but you need to put it or you'll get an error.
Now for the dialogues. Each one begins with a conversation block:
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
//Code
}
Inside this block you can set which actor you will have this dialogue with:
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
}
To begin coding the actual conversation, you must create a
page block. Each page is a paragraph of dialogue. The first page will show when you first talk to the actor. On each page, you must give your actor a name and then set what he/she will say. There are other settings as well, and I will try to describe them all using the comments in that code.
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen"; //Name of the actor you are talking to (by that I mean the name that appears in the dialogue box, not the actor name)
dialog = "What are you here for, marine?"; //The text that appears in the main dialogue box
panel = "KEENPIC"; //This is the lump of the graphic used as a portrait (think Strife character portraits)
voice = "KEENDIA1"; //The voice lump (like the Strife characters)
drop = "Clip"; //Should the actor die while on this line of dialogue, this is what he/she will drop
link = 4; //This will be explained later on
}
}
From here you can make multiple choices. This is where your dialogues start to branch out more. Each choice is marked by a
choice block. Inside said block you can set a couple of options.
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2;
choice
{
text = "I want to buy a weapon"; //The text that represents the option
nextpage = 2; //The page that comes next if you chose this option (represented by order in the conversation block)
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1"; //You'll see why this is here later
}
}
}
From here you can make multiple page blocks for a branching dialogue script. Page 2 will be a weapon shop; page 3 will be reporting a broken pipe releasing hot steam in a sector, and will convince Keen to send men to fix it. In the shop, I will demonstrate the
cost block, and the economic functions of the choice block.
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2;
choice
{
text = "I want to buy a weapon"; //The text that represents the option
nextpage = 2; //The page that comes next if you chose this option (represented by order in the conversation block)
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1"; //You'll see what this is for
}
}
page //This second page block counts as page 2
{
name = "CDR. Keen";
dialog = "Here's what I got on in the inventory:";
panel = "KEENPIC";
voice = "KEENDIA2"; //A second voice lump
drop = "Clip";
choice //Each choice will now represent a shopping choice
{
text = "Shotgun";
giveitem = "Shotgun"; //This is the inventory item given to the player if this choice is selected and can be afforded
yesmessage = "Here you go!"; //This is a message printed on the screen separate from the dialogue box if you can afford it and the purchase is made
nomessage = "Sorry, you cannot afford that"; //And this is shown if it fails, and you cannot afford it
nextpage = 2; //Stay on this page
displaycost = true; //Adds "for 20" after "Shotgun", showing the cost
cost
{
item = "Coin"; //The item you spend in (for the sake of the tutorial I'll use the stock Strife gold)
amount = 20; //How much of aforementioned item you need to spend
}
}
choice
{
text = "Super Shotgun";
giveitem = "SuperShotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 40;
}
}
choice
{
text = "Chaingun";
giveitem = "Chaingun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "That's all.";
nextpage = 1;
closedialog = true;
}
}
page
{
name = "CDR. Keen";
dialog = "Thank you for reporting that. I'll have a crew fix it in no time!";
choice
{
text = "OK.";
nextpage = 1;
closedialog = true;
special = 80; //Executes special 80, or ACS_Execute
arg0 = 2; //Sets the first argument as 2, or script 2
}
}
}
OK, we're almost done. However, there's one more thing, Remember the "link = 2" from earlier and the giveitem = "QuestItem1"? Those were related. I want the dialogue to skip directly to the shop if the leak is already fixed. We can do this with an
ifitem block.
Code: Select all
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2; //This jumps to the page specified (in this case, 2) if the ifitem standards are met
ifitem //This checks for the item specified below
{
item = "QuestItem1"; //And it's our dummy item from before!
}
choice
{
text = "I want to buy a weapon";
nextpage = 2;
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1";
}
}
page //This second page block counts as page 2
{
name = "CDR. Keen";
dialog = "Here's what I got on in the inventory:";
panel = "KEENPIC";
voice = "KEENDIA2";
drop = "Clip";
choice
{
text = "Shotgun";
giveitem = "Shotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2; //Stay on this page
displaycost = true; //Adds "for 20" after "Shotgun", showing the cost
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "Super Shotgun";
giveitem = "SuperShotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 40;
}
}
choice
{
text = "Chaingun";
giveitem = "Chaingun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "That's all.";
nextpage = 1;
closedialog = true;
}
}
page
{
name = "CDR. Keen";
dialog = "Thank you for reporting that. I'll have a crew fix it in no time!";
panel = "KEENPIC";
voice = "KEENDIA3";
choice
{
text = "OK.";
nextpage = 1;
closedialog = true;
special = 80;
arg0 = 2;
}
}
}
That's all! Here's a demo map with the dialogue above (although, due to lack of resources, the panel and voice are omitted). You can withdraw money by using the computer. The room ahead has a gray fog affect for steam, and a pipe. The sector damages you, but once you talk to Keen, men show up, the steam is gone, and the sector no longer damages. Of course, all of the effects are low quality, and would most likely be more logical in a real map, but this is only a demonstration map.
https://www.dropbox.com/s/3952rrn2bfp6k ... uedemo.wad
Questions? Let me know below. If you read this whole thing, thank you! It means a lot to me, and I hope it helped.
Hello! In this thread I will explain how to use the ZDoom Strife Dialogue Format, or ZSDF. I know it's documented on the wiki, but I wish to explain it in a way that makes it easy to understand.
First, add these top two lines in the file:
[code]
namespace = "ZDoom";
include = "SCRIPT00";
[/code]
The first line indicates that this is ZDoom's format. (USDF uses namespace = "Strife";, but don't worry about that. ZSDF is simpler than that.)
I forgot what SCRIPT00 does, but you need to put it or you'll get an error.
Now for the dialogues. Each one begins with a conversation block:
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
//Code
}
[/code]
Inside this block you can set which actor you will have this dialogue with:
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
}
[/code]
To begin coding the actual conversation, you must create a [b]page block[/b]. Each page is a paragraph of dialogue. The first page will show when you first talk to the actor. On each page, you must give your actor a name and then set what he/she will say. There are other settings as well, and I will try to describe them all using the comments in that code.
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen"; //Name of the actor you are talking to (by that I mean the name that appears in the dialogue box, not the actor name)
dialog = "What are you here for, marine?"; //The text that appears in the main dialogue box
panel = "KEENPIC"; //This is the lump of the graphic used as a portrait (think Strife character portraits)
voice = "KEENDIA1"; //The voice lump (like the Strife characters)
drop = "Clip"; //Should the actor die while on this line of dialogue, this is what he/she will drop
link = 4; //This will be explained later on
}
}
[/code]
From here you can make multiple choices. This is where your dialogues start to branch out more. Each choice is marked by a [b]choice block[/b]. Inside said block you can set a couple of options.
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2;
choice
{
text = "I want to buy a weapon"; //The text that represents the option
nextpage = 2; //The page that comes next if you chose this option (represented by order in the conversation block)
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1"; //You'll see why this is here later
}
}
}
[/code]
From here you can make multiple page blocks for a branching dialogue script. Page 2 will be a weapon shop; page 3 will be reporting a broken pipe releasing hot steam in a sector, and will convince Keen to send men to fix it. In the shop, I will demonstrate the [b]cost block[/b], and the economic functions of the choice block.
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2;
choice
{
text = "I want to buy a weapon"; //The text that represents the option
nextpage = 2; //The page that comes next if you chose this option (represented by order in the conversation block)
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1"; //You'll see what this is for
}
}
page //This second page block counts as page 2
{
name = "CDR. Keen";
dialog = "Here's what I got on in the inventory:";
panel = "KEENPIC";
voice = "KEENDIA2"; //A second voice lump
drop = "Clip";
choice //Each choice will now represent a shopping choice
{
text = "Shotgun";
giveitem = "Shotgun"; //This is the inventory item given to the player if this choice is selected and can be afforded
yesmessage = "Here you go!"; //This is a message printed on the screen separate from the dialogue box if you can afford it and the purchase is made
nomessage = "Sorry, you cannot afford that"; //And this is shown if it fails, and you cannot afford it
nextpage = 2; //Stay on this page
displaycost = true; //Adds "for 20" after "Shotgun", showing the cost
cost
{
item = "Coin"; //The item you spend in (for the sake of the tutorial I'll use the stock Strife gold)
amount = 20; //How much of aforementioned item you need to spend
}
}
choice
{
text = "Super Shotgun";
giveitem = "SuperShotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 40;
}
}
choice
{
text = "Chaingun";
giveitem = "Chaingun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "That's all.";
nextpage = 1;
closedialog = true;
}
}
page
{
name = "CDR. Keen";
dialog = "Thank you for reporting that. I'll have a crew fix it in no time!";
choice
{
text = "OK.";
nextpage = 1;
closedialog = true;
special = 80; //Executes special 80, or ACS_Execute
arg0 = 2; //Sets the first argument as 2, or script 2
}
}
}
[/code]
OK, we're almost done. However, there's one more thing, Remember the "link = 2" from earlier and the giveitem = "QuestItem1"? Those were related. I want the dialogue to skip directly to the shop if the leak is already fixed. We can do this with an [b]ifitem block[/b].
[code]
namespace = "ZDoom";
include = "SCRIPT00";
conversation
{
actor = "ScriptedMarine";
page //The page block here marks the first page
{
name = "CDR. Keen";
dialog = "What are you here for, marine?";
panel = "KEENPIC";
voice = "KEENDIA1";
drop = "Clip";
link = 2; //This jumps to the page specified (in this case, 2) if the ifitem standards are met
ifitem //This checks for the item specified below
{
item = "QuestItem1"; //And it's our dummy item from before!
}
choice
{
text = "I want to buy a weapon";
nextpage = 2;
}
choice
{
text = "I'd like to report a broken pipe in Sector 8.";
nextpage = 3;
giveitem = "Questitem1";
}
}
page //This second page block counts as page 2
{
name = "CDR. Keen";
dialog = "Here's what I got on in the inventory:";
panel = "KEENPIC";
voice = "KEENDIA2";
drop = "Clip";
choice
{
text = "Shotgun";
giveitem = "Shotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2; //Stay on this page
displaycost = true; //Adds "for 20" after "Shotgun", showing the cost
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "Super Shotgun";
giveitem = "SuperShotgun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 40;
}
}
choice
{
text = "Chaingun";
giveitem = "Chaingun";
yesmessage = "Here you go!";
nomessage = "Sorry, you cannot afford that";
nextpage = 2;
displaycost = true;
cost
{
item = "Coin";
amount = 20;
}
}
choice
{
text = "That's all.";
nextpage = 1;
closedialog = true;
}
}
page
{
name = "CDR. Keen";
dialog = "Thank you for reporting that. I'll have a crew fix it in no time!";
panel = "KEENPIC";
voice = "KEENDIA3";
choice
{
text = "OK.";
nextpage = 1;
closedialog = true;
special = 80;
arg0 = 2;
}
}
}
[/code]
That's all! Here's a demo map with the dialogue above (although, due to lack of resources, the panel and voice are omitted). You can withdraw money by using the computer. The room ahead has a gray fog affect for steam, and a pipe. The sector damages you, but once you talk to Keen, men show up, the steam is gone, and the sector no longer damages. Of course, all of the effects are low quality, and would most likely be more logical in a real map, but this is only a demonstration map.
https://www.dropbox.com/s/3952rrn2bfp6k6n/dialoguedemo.wad
Questions? Let me know below. If you read this whole thing, thank you! It means a lot to me, and I hope it helped. :)