Jump to content
DavidW

Coding scripts in SSL: some lessons

Recommended Posts

19 hours ago, DavidW said:

Upthread: "Precious little" is an expression, roughly synonymous with "almost nothing". Action(Literal) is just a hardcoded action with no trigger conditions and no actions. Mostly it's syntactic sugar (i.e., language that makes code easier for humans to read but doesn't matter to the compiler); there are one or two use cases (if you want to use probabilities in a literal action, notably).

OK, it should be clear now, thanks.

To tell the truth, I think it may be useful for what I need to do (in conjunction with DELETE_SCRIPT_BLOCK 🙂.....)

Share this post


Link to post

 

@DavidW

Next question: what does the following clause mean in a TRIGGER definition?

LineIf<!CheckStatGT(scstarget,0,WIZARD_SPELL_DEFLECTION)><%scsargument1_SPELLTURN%>

 

Share this post


Link to post

That's actually handled by the ssl_to_bcs function in SFO (in stratagems/sfo/general/general.tpa), not by the SSL perl script. If the second angle bracket evaluates to 1, the contents of the first angle bracket are inserted; if not, nothing is inserted.

Share this post


Link to post
Posted (edited)

So, I have a question about setting variables from outside the SSL script itself, in the command line. If I write

Spoiler

AT_NOW ~/usr/bin/perl	%MOD_FOLDER%/ssl/ssl.pl	%MOD_FOLDER%/components/component_1/TEST.ssl	-l %MOD_FOLDER%/ssl/library.slb	mod_folder=%MOD_FOLDER%&Test=True~	EXACT

 

the variable "Test" doesn't get set. As a matter of fact, if TEST.ssl contains something like

Spoiler

IF TRIGGER
	IgnoreBlock(Test)
	Detect(NearestEnemyOf(Myself))
THEN DO
	Action(Attack)
END

 

that block does get compiled (the SSL compiler should ignore it since "Test" is supposed to be set to True....)

What am I missing?

Edited by Luke

Share this post


Link to post

Quotation marks, possibly.

Look at the ssl_to_bcs function in lib_general for a working template.

Share this post


Link to post

Next: as you know, you can put multiple triggers when using 'ConditionalTargetBlock()'. My question is: can you OR() two or more triggers? I mean, you can currently write 'A AND B' via "&". Is there an equivalent symbol for 'A OR B'?

Related: I noticed that you cannot write

Spoiler

ConditionalTargetBlock(PCsInOrderShort;TriggerBlock(Test))

 

That'd be handy.......

Edited by Luke

Share this post


Link to post

No. (Basically because the underlying bcs language doesn’t allow higher-level OR(), so it would have required a tedious amount of propositional logic.)

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...