Changes in 1.3 - Revised compiling code, updated script format, more syntax error checks
KSSC is a script compiler for Rouge Software's Strife with support for Vavoom, Zdoom and SvStrife.
To compile a script, drag and drop a text file on KSSC.exe to compile it into a binary lump file.
Output file will be the named whatever your input file is.
To use the script for your wad, rename the lump to SCRIPTXX where
XX is the number of the map you want to use it on. For example if you wish to use it on Map02, then rename the script to SCRIPT02.lmp.
Simply import the lump into your wad after your done renaming.
*****Strife Script Breakdown******
In scripts, they are stored as dialog blocks for a NPC, each NPC can have multible dialog blocks, and each block sets the text, name, choices etc for that NPC.
Each dialog block is divided into two sections: NPC info and Choice info. NPC info is used for the name, voice, panel, item thats droped, and dialog text for the NPC. While the Choice info describes the various choices, items to check/buy, and used to jump to the next dialog block.
When a NPC jumps to the next block, it displays another set of text/info for the NPC.
The big change to 1.2 is that users no longer have to enter tokens that they don't use, before for example, if a NPC doesn't have an item to drop, the user still had to enter the token DROP with a value of 0. In 1.2 its automatically counted as 0 if the user doesn't add this token. This saves time and allows the user to enter only the tokens that actually get used.
Here are some of the tokens you must specify in the script.
Basic stuff:
# - Comment
&& - Quote. Note, you don't have to use quotes for strings with no spaces
To make a blank string, add "&&"
NPC INFO
------------
$MOBJ - Mobj ID for the NPC
DROP - Mobj ID of the item to drop when killed
IF_ITEM - Item to check
GOTO - Dialouge to jump to if IF_ITEM passes
NAME - Name of NPC (16 character limit)
VOICE - Voice file to play (8 character limit)
PANEL - Panel to display (8 character limit)
DIALOG - Text to display (320 character limit)
CHOICE INFO
-------------
Note when writing choices, you must start off by adding the '{' token followed by these choice options:
TEXT - Text for that choice (32 character limit)
GIVEMOBJ - The mobj ID item to give when the player selects this choice. This option is always called when the player selects the choice. To avoid this option from being called, you must specify a -1 for the value.
IF_HAS - Item to check when selecting the choice. Followed after the item #, you must specify how much of that item is required. To do so you must add the '*' followed by the number amount. EX - (IF_HAS 168 * 20 -this means you must have 20 of item # 168)
YESTEXT - the text to display on the hud when choosing the choice. NOTE: if not specified the text will default to "You got the %!" To leave it blank, you must add "_". Don't use && (80 character limit)
LINK - Dialog block to jump after selecting the choice
LOG - Log lump file to display in hud (example: LOGXXXX.lmp, XXXX is the number to enter - 4 digit limit)
NOTEXT - Text to display on hud if IF_HAS fails. Not specifying this will default to "No you don't have what I want for the %!" (80 character limit)
When done with the choice block, add the '}' token to end it. You may add up to 5 Choice infos
When done with the entire block, add the token $END
Basic rule is when making a block, you must always begin with $MOBJ and end it with $END. Otherwise the compiler will not compile the script.
----------------------------------------------------------
NOTE ABOUT IF_ITEM, AND IF_HAS
----------------------------------------------------------
You may use up to three of these per block. For IF_ITEM, you may specify three different items that can be checked. If one of them is in the player's inventory, then the script will move on to the next block specified as normal.
IF_HAS is treated differently and can get confusing if not used properly. When using IF_HAS, it will display the text "for %" where % is the item amount. If you wish to NOT have the "for %" text shown, create two IF_HAS, but leave the first option blank (IF_HAS 0 * 0) and acually use the second option. It is unknown what the third one is used for.
Information about MOBJ ID
For those who want to know why you must use MOBJ IDs in the scripts, the oringinal Strife game was of course based on the oringinal C source of Doom2. There is a source file called info.c and info.h which contains a HUGE array of the things. Well, Strife used that array to identify what thing is scripted.
You can actually view the MOBJ ID for Doom if you use Dehacked (don't get this confused with DoomEDNum).
More infomation about the Strife script:
Its very strict, meaning you have to keep everthing in order, when you make a NPC with more than 1 dialog block, they all must follow each other, you can't have lets say a block for NPC#1 then a block for NPC#2 then another block for NPC#1 again. They all must follow like this NPC#1, NPC#1, NPC2 etc.
Each dialog block is EXACTLY 1.48kb, if the size varied, then the script won't work.
Please read HARRIS.TXT for an example of how the NPC Harris (from Strife map02) works.
Also check out the sample script for more examples.
Understanding Strife scripting is not hard at all and does not require learning unlike ACS. This version (1.3) has attempted to make the format as simple to use as possible. I really suggest taking a look at the example scripts and see how it is done. For any questions or problems, please feel free to email me.
download link is:
http://home.houston.rr.com/svkaiser/hosted/KSSC1_3.zip
Again here is the same example I've mentioned in the 1.2 thread but changed to the 1.3 format.
Code: Select all
#===================
#HARRIS block 1========
#===================
$MOBJ 9
DROP 301
NAME HARRIS
VOICE HA001
PANEL M_PEAS1
DIALOG &I'M KINDA A TALENT BROKER FOR THE REBELS. A GUY WHO'S AS GOOD AS YOU COULD MAKE A LOT OF GOLD... IF YOU HOOKED UP WITH THE RIGHT PEOPLE.& #strings with spaces must be quoted..
{
GIVEMOBJ -1
TEXT &I'M INTERESTED.&
YESTEXT _
LINK -3
}
{
GIVEMOBJ 301
TEXT &SCREW THE REBELS!&
YESTEXT _
LINK -2
}
$END
#===================
#HARRIS block 2========
#===================
$MOBJ 9
DROP 301
NAME HARRIS
VOICE HA002
PANEL M_PEAS1
DIALOG &NO, NO SECOND CHANCE. OH GUARDS, KILL HIM.&
$END
#===================
#HARRIS block 3========
#===================
$MOBJ 9
DROP 301
NAME HARRIS
VOICE HA003
PANEL M_PEAS1
DIALOG &GOOD CHOICE. THE ORDER'S SANCTUARY BY THE RIVER IS THEIR UNOFFICIAL TORTURE CHAMBER. HIDDEN INSIDE THERE'S A GOLDEN CHALICE. YOU SWIPE IT AND REAP YOUR REWARD.&
{
GIVEMOBJ 194 #Crossbow
TEXT &HOW AM I SUPPOSED TO DO THAT?&
YESTEXT _
LINK -4
}
$END
#===================
#HARRIS block 4========
#===================
$MOBJ 9
DIALOG &HERE'S A CROSSBOW, JUST AIM STRAIGHT AND --SPLAT--. REMEMBER, GRAB THE FANCY CUP AND GET TO THE TAVERN.&
DROP 301
NAME HARRIS
VOICE HA004
PANEL M_PEAS1
{
GIVEMOBJ -1
TEXT &COOL. I'll get it.&
LOG 1024
YESTEXT _
LINK 5
}
$END
#===================
#HARRIS block 5========
#===================
$MOBJ 9
DROP 305 #now a door token
IF_ITEM 174 #Check for chalice
GOTO 6
NAME HARRIS
VOICE HA006
PANEL M_PEAS1
DIALOG &WHAT ARE YOU WAITING FOR? BRING ME THAT CHALICE.&
$END
#===================
#HARRIS block 6========
#===================
$MOBJ 9
NAME HARRIS
VOICE HA007
DROP 305
PANEL M_PEAS1
DIALOG &HEY, I KNOW, KINDA LOOKS LIKE A SET-UP. I WOULD NEVER DO THAT TO SUCH A GREAT KILLING MACHINE. GOT THE ITEM? GREAT! NOW GET READY, GOLD AND GLORY JUST LIKE I PROMISED. TAKE THIS KEY AND THE GOVERNOR WILL REWARD YOU.&
{
TEXT &HE'D BETTER. FOR YOUR SAKE!& #bad choice
YESTEXT _
LINK -7
GIVEMOBJ 134
}
{
GIVEMOBJ -1
TEXT &WHAT! WHERE'S MY MONEY?&
YESTEXT _
LINK -8
}
$END
#===================
#HARRIS block 7========
#===================
DROP 301
$MOBJ 9
NAME HARRIS
VOICE HATBL
PANEL M_PEAS1
DIALOG &GET LOST KID, YOU BOTHER ME.&
$END
#===================
#HARRIS block 8========
#===================
$MOBJ 9
DROP 305 #door token
NAME HARRIS
VOICE HA002
PANEL M_PEAS1
DIALOG &NO, NO SECOND CHANCE. OH GUARDS, KILL HIM.&
$END
Please read the information in Zdoom.txt and check out the zdoom sample wad in sample_z.wad. Have fun.. or something