Jump to content

AR1500 script loop


Recommended Posts

Posted

The Spellhold outdoors area script has this block at the bottom:

 

IF
GlobalGT("AsylumPlot","GLOBAL",55)
THEN
RESPONSE #100
	Unlock("Door1501")
	OpenDoor("Door1501")
END

 

As you can see, this block will always return true after the confrontation with Irenicus which will prevent any script blocks placed below it from executing. In the unmodded game, there are no script blocks below this one so the bug is barely noticeable. However, several mods do extend the area script with their own blocks which will never trigger due to this bug. The fix is simple, we introduce a variable which ensures that the door unlocking/opening only occurs once:

 

// The Spellhold Asylum door should be unlocked and opened once

COPY_EXISTING ~ar1500.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
 REPLACE_TEXTUALLY EXACT_MATCH ~GlobalGT("AsylumPlot","GLOBAL",55)~ ~GlobalGT("AsylumPlot","GLOBAL",55) Global("RR#Door1501","AR1500",0)~
 REPLACE_TEXTUALLY EXACT_MATCH ~Unlock("Door1501")~ ~SetGlobal("RR#Door1501","AR1500",1) Unlock("Door1501")~
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...