KSSC 1.3 released

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.
User avatar
Kaiser
Posts: 180
Joined: Thu Jul 15, 2004 8:21 am
Contact:

KSSC 1.3 released

Post by Kaiser »

<Taken from the readme>
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 note that if you want to insert choices you must put them between the { and } brackets so the compiler can reconize them. This is not complicated as the format in the previous versions. Hopfully this will be easier to pick up/understand.

Please read the information in Zdoom.txt and check out the zdoom sample wad in sample_z.wad. Have fun.. or something
User avatar
Sir_Alien
Posts: 863
Joined: Sun Aug 29, 2004 6:15 am
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

WOOOOOOOOOOOOOHOOOOOOOOOOOOOOOO!! \o/

This is going to be the best weekend ever!

EVER!!
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Re: KSSC 1.3 released

Post by David Ferstat »

Kaiser wrote:... KSSC is a script compiler for Rouge Software's Strife ...
So ... does this mean that changes are only cosmetic? :)
User avatar
Sir_Alien
Posts: 863
Joined: Sun Aug 29, 2004 6:15 am
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

Perhaps, but at least you know it's got a good foundation. :wink:
User avatar
ferentix
Posts: 96
Joined: Tue Jun 14, 2005 6:32 am
Location: Riding an Intestellar Chicken
Contact:

Post by ferentix »

Excellent! Now, how do you set MOBJ for items using DECORATE...? I'm sure someone mentioned it a while back... *searches forums*

Great tool Kaiser! :D

EDIT: Ah, I see, is ConversationID the same as somethings Mobj...?

So have I got this right: You set ConversationID in an items DECORATE, then in the conversation script, you use that number to refer to it when using "give" or "check" type commands? I read the ZDoom.txt file, and it's a little confusing...

EDIT: OK, so you have to give the talkable Actors their own ConversationID, and then define the same $MOBJ number in the script that you want that actor to execute, right? :s That's what I understand from all this, but is that correct?

Now if only XWE would actually load the compiled lumps without erroring :evil:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

ferentix wrote:
EDIT: Ah, I see, is ConversationID the same as somethings Mobj...?

So have I got this right: You set ConversationID in an items DECORATE, then in the conversation script, you use that number to refer to it when using "give" or "check" type commands? I read the ZDoom.txt file, and it's a little confusing...

EDIT: OK, so you have to give the talkable Actors their own ConversationID, and then define the same $MOBJ number in the script that you want that actor to execute, right? :s That's what I understand from all this, but is that correct?

Any mobj references in the script refer to the conversation ID. In Strife it was the index into the large actor table (which you might remember from other source ports as the contents of info.c.)
User avatar
ferentix
Posts: 96
Joined: Tue Jun 14, 2005 6:32 am
Location: Riding an Intestellar Chicken
Contact:

Post by ferentix »

Ah right, that's good then :). Unfortunately, I can't tell if my scripts are working or not because as I say, I can't insert them with XWE (which simply gives the error "Read beyond end of file" then "File still open", and inserts a marker of size 0 bytes) or Wintex. :(
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Post by David Ferstat »

Sounds like a job for ... DeePsea, which, even unregistered, should be able to insert lumps for you.
User avatar
ferentix
Posts: 96
Joined: Tue Jun 14, 2005 6:32 am
Location: Riding an Intestellar Chicken
Contact:

Post by ferentix »

Oh yeah, I forgot all about DeepSea, mainly because I never use it. Thanks for reminding me ;)
User avatar
Sir_Alien
Posts: 863
Joined: Sun Aug 29, 2004 6:15 am
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

ferentix wrote:Unfortunately, I can't tell if my scripts are working or not because as I say, I can't insert them with XWE (which simply gives the error "Read beyond end of file" then "File still open", and inserts a marker of size 0 bytes)
Are you inserting it as raw data or using the replace command?
User avatar
ferentix
Posts: 96
Joined: Tue Jun 14, 2005 6:32 am
Location: Riding an Intestellar Chicken
Contact:

Post by ferentix »

Oh noes! I am a fool... why didn't I try Load(Raw) instead of load?! thanks again Sir_Alien!

So, I've written some basic conversation scripts, and they work fine (and I can now insert them much more easily ;)), but now I'm wondering: Is there a way a conversation can trigger off some other event, like a map action (doors open, ceiling lower, etc.) or a script of any sort? Looking at your example, Kaiser, that conversation implies actions like the guys guards attacking you if you give him an answer he doesn't like, but how is this handled?

OK, my guess would be that you have somehow assigned MOBJ 305 to a door (I'm guessing this from the comments like "now a door token"), and in certain blocks you've set DROP to that number... so if Harris dies at that point, a door will open...? :?

Well, like I say, that's all guesswork, and most probably woefully incorrect, but if there is a way to cause actions to happen other than giving or checking items...

(apoligies for my ignorance of what is possible with this, but I haven't ever played Strife, so I haven't any experience of it in action)
User avatar
Sir_Alien
Posts: 863
Joined: Sun Aug 29, 2004 6:15 am
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

[EDIT]:

Are there any strange or unusual bugs that stop a dialogue script from activating?

Anyway, here're my lumps:

Code: Select all

#=================== 
# TERMINAL block 1
#=================== 
$MOBJ 9 

IF_ITEM 312
GOTO 2
NAME TERMINAL 
VOICE && 
DIALOG &YOU HAVE NO ONE ON YOUR LIST OF CONTACTS.& 
$END

#=================== 
# TERMINAL block 2
#=================== 
$MOBJ 9 
IF_ITEM 313
GOTO 3
NAME TERMINAL 
VOICE && 
DIALOG &WHO WOULD YOU LIKE TO CONTACT?&
            #--Choice1-- 
{
GIVEMOBJ 320 #QuestItem1
TEXT && 
YESTEXT _
}
            #--Choice2-- 
{
GIVEMOBJ 321 #QuestItem2
TEXT && 
YESTEXT _
}

$END

#=================== 
# TERMINAL block 3
#=================== 
$MOBJ 9 

IF_ITEM 314
GOTO 4
NAME TERMINAL 
VOICE && 
DIALOG &WHO WOULD YOU LIKE TO CONTACT?& 

           #--Choice3-- 
{
GIVEMOBJ 320 #QuestItem9
TEXT && 
YESTEXT _
}

            #--Choice2-- 
{
GIVEMOBJ 321 #QuestItem10
TEXT && 
YESTEXT _
}

            #--Choice3-- 
{
GIVEMOBJ 322 #QuestItem11
TEXT && 
YESTEXT _
}

$END

#=================== 
# TERMINAL block 4
#=================== 
$MOBJ 9 

#IF_ITEM 315
#GOTO 5
NAME TERMINAL 
VOICE && 
DIALOG &WHO WOULD YOU LIKE TO CONTACT?& 

            #--Choice1-- 
{
GIVEMOBJ 320 #QuestItem9
TEXT && 
YESTEXT _
}
 
            #--Choice2-- 
{
GIVEMOBJ 321 #QuestItem10
TEXT && 
YESTEXT _
}

            #--Choice3-- 
{
GIVEMOBJ 322 #QuestItem11
TEXT && 
YESTEXT _
}
            #--Choice4-- 
{
GIVEMOBJ 323 #QuestItem12
TEXT && 
YESTEXT _
}

$END

Code: Select all

ACTOR NPCguy 1212
{
   Health 20
   ConversationID 9
   Radius 20
   Height 56
   Speed 8
   PainChance 200
   +FLOORCLIP
   +SOLID
   +SHOOTABLE
   PainSound "grunt/pain"
   DeathSound "grunt/death"
   ActiveSound "grunt/active"
   States
   {
   Spawn:
       POSS AB 10
       Loop
   See:
       POSS AABBCCDD 4 A_Wander
       Loop
   Pain:
       POSS G 3
       POSS G 3 A_Pain
       Goto See
   Death:
       POSS H 5
       POSS I 5 A_Scream
       POSS J 5 A_Fall
       POSS K 5
       POSS L -1
       Stop
   XDeath:
       POSS M 5
       POSS N 5 A_XScream
       POSS O 5 A_Fall
       POSS PQRST 5
       POSS U -1
       Stop
   }
}
[/EDIT]
ferentix wrote:Well, like I say, that's all guesswork, and most probably woefully incorrect, but if there is a way to cause actions to happen other than giving or checking items...
Not that I know. Mobj 305 refers to a key, (Mobj Name = MT_TOKEN_DOOR3, Mobj ID = 305) rather than an action.

The only way I know, which works fine, to trigger events from a dialogue block is with a looping script that checks for an inventory item.

Try this:

Code: Select all

Script 100 ENTER

{

    while(!checkinventory("QuestItem1") //Mobj ID = 312

        {

        Delay(1);

        }

    //Insert stuff here

}
That checks for the quest item, which you can give in a dialogue script. The script will loop until you receive it, at which point it will execute whatever actions you desire.
Last edited by Sir_Alien on Fri Oct 28, 2005 5:37 am, edited 1 time in total.
User avatar
Apothem
Posts: 2070
Joined: Sat Nov 29, 2003 7:13 pm
Location: Performing open heart surgery on an ACS compiler.

Post by Apothem »

Hmmmm This could come in handy. Thanks Kaiser 8-)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Sir_Alien wrote: Not that I know. Mobj 305 refers to a key, (Mobj Name = MT_TOKEN_DOOR3, Mobj ID = 305) rather than an action.
Actually no.

305 is a special item that opens a door with tag 224 when dropped or given in a dialog.
User avatar
Sir_Alien
Posts: 863
Joined: Sun Aug 29, 2004 6:15 am
Location: Sydney, Australia
Contact:

Post by Sir_Alien »

Well, you learn something new everyday.

Now, you couldn't possibly learn me how to fix my dialogue script, could you?
Locked

Return to “Editing (Archive)”