Luke Posted August 21, 2019 Share Posted August 21, 2019 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 .....) Quote Link to comment
Luke Posted August 21, 2019 Share Posted August 21, 2019 @DavidW Next question: what does the following clause mean in a TRIGGER definition? LineIf<!CheckStatGT(scstarget,0,WIZARD_SPELL_DEFLECTION)><%scsargument1_SPELLTURN%> Quote Link to comment
DavidW Posted August 21, 2019 Author Share Posted August 21, 2019 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. Quote Link to comment
Luke Posted August 29, 2019 Share Posted August 29, 2019 (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 August 29, 2019 by Luke Quote Link to comment
DavidW Posted August 30, 2019 Author Share Posted August 30, 2019 Quotation marks, possibly. Look at the ssl_to_bcs function in lib_general for a working template. Quote Link to comment
Luke Posted September 1, 2019 Share Posted September 1, 2019 (edited) 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 September 1, 2019 by Luke Quote Link to comment
DavidW Posted September 1, 2019 Author Share Posted September 1, 2019 No. (Basically because the underlying bcs language doesn’t allow higher-level OR(), so it would have required a tedious amount of propositional logic.) Quote Link to comment
Luke Posted September 22, 2019 Share Posted September 22, 2019 On 7/28/2019 at 4:10 PM, DavidW said: LOOP - basically does multiple copies of a chunk of SSL code, with a different value of a variable each time. Look at SCS, there are quite a few examples. Is it possible to write the following in a compact way? BEGIN LOOP(scsloopvar||NearestEnemyOf(Myself);SecondNearestEnemyOf(Myself);ThirdNearestEnemyOf(Myself);FourthNearestEnemyOf(Myself);FifthNearestEnemyOf(Myself);SixthNearestEnemyOf(Myself)) I tried with BEGIN LOOP(scsloopvar||EnemiesInOrder) but it's not working...... Thanks in advance Quote Link to comment
DavidW Posted September 22, 2019 Author Share Posted September 22, 2019 No. There's no variable substitution into loops (basically because loops themselves are executed right at the start). Quote Link to comment
Luke Posted September 25, 2019 Share Posted September 25, 2019 (edited) On 9/22/2019 at 7:47 PM, DavidW said: No. There's no variable substitution into loops (basically because loops themselves are executed right at the start). Well, fortunately there's a workaround Spoiler BEGIN LOOP(scsloopvar||;Second;Third;Fourth;Fifth;Sixth) IF TRIGGER !StateCheck(scsloopvarNearestEnemyOf(Myself),STATE_REALLY_DEAD) THEN DO Action(Test) END END LOOP Edited September 25, 2019 by Luke Quote Link to comment
Luke Posted November 15, 2019 Share Posted November 15, 2019 On 9/1/2019 at 3:38 PM, DavidW said: No. (Basically because the underlying bcs language doesn’t allow higher-level OR(), so it would have required a tedious amount of propositional logic.) Actually, it does seem to be possible, see below. ConditionalTargetBlock(EnemiesInOrderShort;OR(2)&Kit(scstarget,BLACKGUARD)&Class(scstarget,BARD)) Separately: I noticed there are some 'ActionCondition()'s in SCS, but are they functional? I'm asking because I keep getting an error when using them... Moreover, according to the underlying perl code, they seem to be functionally identical to standard 'Action()'s... if ($scsline=~m/ActionCondition\(/ eq "1") { extract_from_brackets(); push @action, $scsline; Quote Link to comment
Luke Posted December 6, 2019 Share Posted December 6, 2019 A quick note for the 2-3 people (other than @DavidW and @Wisp) who use SSL: the source-code editor Visual Studio Code has an extension that supports SSL and SLB file formats (as far as Syntax Highlighting is concerned). Quote Link to comment
Luke Posted March 17, 2020 Share Posted March 17, 2020 (edited) A quick note for the 2-3 people who use SSL: unlike TRIGGERs, you cannot combine multiple TARGETs inside a single "TargetBlock()" using the character "|". You need to use either "*" (only the first argument in "TargetBlock()" will be considered) or "&" (all the arguments in "TargetBlock()" will be considered). For instance: TargetBlock(PCMages*PCsInOrderShort) // "PCsInOrderShort" will be discarded TargetBlock(PCMages&PCsInOrderShort) // First "PCMages", then "PCsInOrderShort" Edited March 17, 2020 by Luke Quote Link to comment
Luke Posted May 14, 2020 Share Posted May 14, 2020 On 3/17/2020 at 11:14 AM, Luke said: A quick note for the 2-3 people who use SSL: unlike TRIGGERs, you cannot combine multiple TARGETs inside a single "TargetBlock()" using the character "|". You need to use either "*" (only the first argument in "TargetBlock()" will be considered) or "&" (all the arguments in "TargetBlock()" will be considered). For instance: TargetBlock(PCMages*PCsInOrderShort) // "PCsInOrderShort" will be discarded TargetBlock(PCMages&PCsInOrderShort) // First "PCMages", then "PCsInOrderShort" @DavidW Could you please state if the above info is correct? If so, what's the purpose of *? Quote Link to comment
DavidW Posted May 14, 2020 Author Share Posted May 14, 2020 '&' is intended notation, and works as you suggest. '*' I don't know about. That character doesn't appear in BAF scripts, normally - it may be that SSL's parser is just ending its script read at it. Or it may be some subtler bit of functionality I've forgotten about. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.