Jump to content


Photo

SSL documentation


8 replies to this topic

#1 DavidW

DavidW
  • Gibberlings
  • 4142 posts
  • Gender:Male

Posted 09 March 2011 - 02:08 AM

This is a rather belated attempt to provide proper documentation for "Stratagems Scripting Language" (SSL), which is a metalanguage for writing BAF scripts. Roughly speaking, SSL is to BAF as D is to DLG. It allows very complex scripts to be easily assembled and modifed. So far, its main application has been in combat AI (specifically, in my Sword Coast Stratagems I and II) though it also finds a home in Wisp's Item Randomizer. SSL isn't downloadable separately, but can be found in SCS or SCSII (look in scs(ii)/ssl).

I'm providing this documentation mostly for TheBigg, who's investigating offering SSL support in WEIDU. It's not especially user-friendly, and it assumes at least passing familiarity with SSL code as well as a thorough understanding of BAF code. Anyone interested in coding in SSL might want to look at this (incomplete) tutorial first. (Anyone not needing fairly sophisticated scripting probably should just stick to BAF - SSL is very powerful but has a pretty vertical learning curve.)

Anyway, there are three documents (all in PDF form).

The first gives a (roughly) context-free-grammar explanation of the syntax of SSL (more accurately, of the syntax of "unlooped, substituted SSL", the file you get when variable substitutions, file inclusions and loop evaluations have been performed on the original SSL).
Attached File  SSL_grammar.pdf   453.81KB   210 downloads

The second explains how the SSL parser turns an SSL block into a sequence of BAF blocks.
Attached File  How_to_evaluate_an_SSL_block.pdf   432.77KB   159 downloads

The third explains how SSL evaluates variable substitutions and file inclusions.
Attached File  SSL_loops_and_variables.pdf   268.61KB   136 downloads

EDIT 13-9-12 - very belatedly, I forgot about the DEFAULT_TRIGGER command. Add this to SSL_grammar.pdf:

A block can also be DEFAULT_TRIGGER(SSL-BAF trigger) or DEFAULT_TRIGGER()

The most recent DEFAULT_TRIGGER trigger is prepended to all trigger blocks.


(This is useful in, e.g., marking a large block of actions as only to be done if some variable is set.)

Edited by DavidW, 12 September 2012 - 04:25 PM.


#2 the bigg

the bigg

    The Avatar of F/Ts

  • Members
  • 2318 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 09 March 2011 - 02:49 AM

Thank you very much for the precise documentation. I'll delay implementing this for 230 though (there's enough bugs in the current version to warrant releasing 229, and my graduation paper is due on the 29th so I can't get started on stuff that I can't do in one hour).
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#3 DavidW

DavidW
  • Gibberlings
  • 4142 posts
  • Gender:Male

Posted 09 March 2011 - 02:57 AM

Thank you very much for the precise documentation. I'll delay implementing this for 230 though (there's enough bugs in the current version to warrant releasing 229, and my graduation paper is due on the 29th so I can't get started on stuff that I can't do in one hour).


More than fair.

#4 DavidW

DavidW
  • Gibberlings
  • 4142 posts
  • Gender:Male

Posted 09 March 2011 - 03:14 AM

I forgot to note that SSL accepts the \\ format for comments. (I couldn't be bothered to code it to accept the \* *\ format, but you wouldn't break backwards compatibility by doing so.)

#5 the bigg

the bigg

    The Avatar of F/Ts

  • Members
  • 2318 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 09 March 2011 - 03:43 AM

Is it really \\, or did you mean // ?
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#6 DavidW

DavidW
  • Gibberlings
  • 4142 posts
  • Gender:Male

Posted 09 March 2011 - 03:48 AM

Is it really \\, or did you mean // ?


It's //, sorry. (An inability to remember which way around the comment markers go accounts for a respectable fraction of my compile failures.)

#7 DavidW

DavidW
  • Gibberlings
  • 4142 posts
  • Gender:Male

Posted 09 March 2011 - 03:54 AM

I also forgot to mention that library files are cumulative: if the Charm trigger list turns up in more than one place, the resultant lists are combined (and duplicate entries are purged).

#8 the bigg

the bigg

    The Avatar of F/Ts

  • Members
  • 2318 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 09 March 2011 - 04:00 AM

Yes, I recall that from the tutorial thread.

And hey, fair enough about messing up \ and / - I always mess up << and >> when operating on iostream in c++, and in both cases the compiler is a safety net :)
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#9 phordicus

phordicus
  • Members
  • 263 posts
  • Gender:Male

Posted 09 March 2011 - 09:59 PM

nice. thanks!
Druid Kit Enhancements 1.0 (requires Dispel Magic Fix, either Taimon or ToBEx)



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users