pro5 Posted October 26, 2006 Share Posted October 26, 2006 IF Allegiance(Myself,ENEMY) See(ThirdNearest([ENEMY])) HaveSpell(0) !Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Spell(LastSeenBy(Myself),0) END BG2 fixpack changes some of such blocks in original Bioware scripts, so I assumed they were meaningless or erroneous. But now I'm looking through some scripts in other mods, and find blocks like this (so someone used them on purpose). Can anyone knowledgable explain, how it works (if it works)? Link to comment
CamDawg Posted October 26, 2006 Share Posted October 26, 2006 Let's say I write a baf file like this: IF Allegiance(Myself,ENEMY) See(ThirdNearest([ENEMY])) HaveSpell(SPELL_FOO) !Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Spell(LastSeenBy(Myself),SPELL_FOO) END When WeiDU goes to compile this, it will look for SPELL_FOO in spell.ids. If found, it'll substitute the numerical value for it (as the engine only understands the numerical value). If not it'll simply use zero, resulting in the code you've posted. These are usually caused by typos in spell references prior to compilation. Link to comment
pro5 Posted October 26, 2006 Author Share Posted October 26, 2006 Hmm, I see. Thanks for explaining. But why would they then be in a mod's BAF file which hasn't yet been compiled or decompiled by WeiDU? Weird. Link to comment
CamDawg Posted October 26, 2006 Share Posted October 26, 2006 Could be a myriad of reasons--they're using an entry that isn't present by default, it's just a normal typo, etc. Some of them can also be intentional: IF SpellCast([PC],0) !GlobalTimerNotExpired("SpellsBad","GLOBAL") Global("BribedCowled","GLOBAL",0) GlobalLT("CowledWarning","GLOBAL",7) THEN RESPONSE #100 CreateCreatureObjectDoor("COWENF2",LastTrigger,0,0,0) // Cowled Enforcer SetGlobalTimer("SpellsBad","GLOBAL",300) END ^^ This block, present in every Athkatla (outdoor) area script, summons the Cowled Wizards when you cast spells. In his case, SpellCast([PC],0) will pick up any mage spell cast by a PC. Link to comment
Avenger Posted October 29, 2006 Share Posted October 29, 2006 HaveSpell(0) is most likely a result of decompiled script with bad IDS. In that case, a bug. It was probably a HaveSpellRES... Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.