HerrSvensson
-
Posts
22 -
Joined
-
Last visited
Content Type
Forums
Events
Downloads
Gallery
Mods
News
Store
Posts posted by HerrSvensson
-
-
Seems very useful.
Why are targets separated in different blocks? Wouldn't it be sufficient to simply add an OR(x)?
Example:
Library definitions:
For example:
TARGET=test [PC] SecondNearest([PC])
Action definition:
BEGIN_ACTION_DEFINITION Name(Spell) TRIGGER HaveSpell(scsargument1) !CheckStatGT(scstarget,0,SANCTUARY) CheckStatLT(Myself,50,SPELLFAILUREMAGE) !CheckStat(scstarget,2,WIZARD_SPELL_TRAP) ACTION RESPONSE #scsprob1 SetGlobalTimer("castspell","LOCALS",6) Spell(scstarget,scsargument1) END
ssl script:
IF TRIGGER TargetBlock(test) THEN DO Action(Spell,WIZARD_FIREBALL) END
Will compile into:
IF HaveSpell(WIZARD_FIREBALL) !CheckStatGT([PC],0,SANCTUARY) CheckStatLT(Myself,50,SPELLFAILUREMAGE) !CheckStat([PC],2,WIZARD_SPELL_TRAP) See([PC]) THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",6) Spell([PC],WIZARD_FIREBALL) END IF HaveSpell(WIZARD_FIREBALL) !CheckStatGT(SecondNearest([PC]),0,SANCTUARY) CheckStatLT(Myself,50,SPELLFAILUREMAGE) !CheckStat(SecondNearest([PC]),2,WIZARD_SPELL_TRAP) See(SecondNearest([PC])) THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",6) Spell(SecondNearest([PC]),WIZARD_FIREBALL) END
Is there a way to compile it into the following instead?
IF HaveSpell(WIZARD_FIREBALL) OR(2) See([PC]) See(SecondNearest([PC])) !CheckStatGT(LastSeenBy(),0,SANCTUARY) CheckStatLT(Myself,50,SPELLFAILUREMAGE) !CheckStat(LastSeenBy(),2,WIZARD_SPELL_TRAP) THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",6) Spell(LastSeenBy(),WIZARD_FIREBALL) END
I think the script would then be quicker, or am I wrong about that? Does infinity engine read triggers from bottom and up instead of top to bottom like I assume it does?
Coding scripts in SSL: some lessons
in Modding How-Tos and Tutorials
Posted · Edited by HerrSvensson
Thanks, you are right.
I don't know a good reason for why you would want to code like I did then, but it's still possible to do in SSL, that's good: