What's wrong with this code?
#1
Posted 30 December 2011 - 09:55 AM
IF
InParty(Myself)
Global("KishJaheiraFighterStronghold","GLOBAL",1)
GlobalTimerExpired("KPPlotTime","GLOBAL")
!Global("KeepPlot","GLOBAL",9)
CombatCounter(0)
!Global("KishKeepInactive","GLOBAL",1)
!GlobalTimerNotExpired("KishJaheiraImpatient","GLOBAL")
OR(3)
Global("Chapter","GLOBAL",2)
Global("Chapter","GLOBAL",3)
Global("Chapter","GLOBAL",6)
!AmIInWatchersKeepPleaseIgnoreTheLackOfApostophe()
!Global("KishKeepFinished","GLOBAL",1)
!AreaCheck("AR1306")
!AreaCheck("AR1307")
!AreaCheck("AR1304")
!AreaCheck("AR1305")
THEN
RESPONSE #100
SetInterrupt(FALSE)
StartDialogueNoSet(Player1)
END
and this is in the mod's .d file:
CHAIN IF WEIGHT #-1 ~GLOBAL("KishJaheiraFighterStronghold","GLOBAL",1)
GlobalTimerExpired("KPPlotTime","GLOBAL")
!GlobalTimerNotExpired("KishJaheiraImpatient","GLOBAL")
Global("KishJaheiraComplained","GLOBAL",0)
!Global("KeepPlot","GLOBAL",9)
!Global("KishKeepInactive","GLOBAL",1)
OR(3)
Global("CHAPTER","GLOBAL",2)
Global("CHAPTER","GLOBAL",3)
Global("CHAPTER","GLOBAL",6)
!InWatchersKeep()
!InActiveArea("AR1306")
!InActiveArea("AR1307")
!InActiveArea("AR1304")
!InActiveArea("AR1305")
!Global("KishKeepFinished","GLOBAL",1)~ THEN JAHEIRAJ DeArniseKeepHurry
~We should check on affairs at my keep.~
END
++ ~We're too busy right now, Jaheira.~ EXTERN JAHEIRAJ DeArniseKeepDelay
++ ~Of course, we'll go there right away.~ EXTERN JAHEIRAJ DeArniseKeepRightAway
++ ~I have no time for that.~ EXTERN JAHEIRAJ DeArniseKeepDelay
and certainly appears to be being appended properly to JAHEIRAJ. However, when her script tries to execute this, it crashes the game.
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
#2
Posted 30 December 2011 - 10:55 AM
And then use Global("KishJaheiraFighterStronghold","GLOBAL",2) as the only trigger in the D?
cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#3
Posted 30 December 2011 - 12:35 PM
IF
InParty(Myself)
Global("KishJaheiraFighterStronghold","GLOBAL",1)
GlobalTimerExpired("KPPlotTime","GLOBAL")
!Global("KeepPlot","GLOBAL",9)
CombatCounter(0)
!Global("KishKeepInactive","GLOBAL",1)
!GlobalTimerNotExpired("KishJaheiraImpatient","GLOBAL")
OR(3)
Global("Chapter","GLOBAL",2)
Global("Chapter","GLOBAL",3)
Global("Chapter","GLOBAL",6)
!InWatchersKeep()
!Global("KishKeepFinished","GLOBAL",1)
!InActiveArea("AR1306")
!AreaCheck("AR1307")
!AreaCheck("AR1304")
!AreaCheck("AR1305")
THEN
RESPONSE #100
SetInterrupt(FALSE)
IncrementGlobal("KishJaheiraGoToKeep","GLOBAL",1)
Wait(3)
StartDialogueNoSet(Player1)
END
and the .d file to:
CHAIN IF WEIGHT #-1 ~Global("KishJaheiraGoToKeep","GLOBAL",1)~ THEN JAHEIRAJ DeArniseKeepHurry
~We should check on affairs at my keep.~
END
++ ~We're too busy right now, Jaheira.~ EXTERN JAHEIRAJ DeArniseKeepDelay
++ ~Of course, we'll go there right away.~ EXTERN JAHEIRAJ DeArniseKeepRightAway
++ ~I have no time for that.~ EXTERN JAHEIRAJ DeArniseKeepDelay
but while it looks much more elegant now (thanks), it still crashes the game exactly the same way.
On a separate but not entirely unrelated note, is it impossible for a CHAIN to check for a variable which was set earlier in the CHAIN? That is,
== JAHEIRAJ IF ~PartyGoldGT(499)~ THEN ~Something.~ DO ~SetGlobal("KishJaheiraPaidMerchant","GLOBAL",1)~
== JAHEIRAJ IF ~PartyGoldLT(500)~ THEN ~Something different.~ DO ~SetGlobal("KishJaheiraPaidMerchant","GLOBAL",2)
IncrementGLOBAL("KPRevolt","GLOBAL",1)~
== KPMERC01 IF ~GLOBAL("KishJaheiraPaidMerchant","GLOBAL",1)
CheckStatGT("Jaheira",14,CHR)~ THEN ~Reply.~ DO ~TakePartyGold(500)~
== KPMERC01 IF ~GLOBAL("KishJaheiraPaidMerchant","GLOBAL",1)
CheckStatLT("Jaheira",15,CHR)~ THEN ~Different reply.~
doesn't work. The lines that check for KishJaheiraPaidMerchant never fire. Is there a way to fix this?
Edited by Kish, 30 December 2011 - 12:42 PM.
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
#4
Posted 30 December 2011 - 12:46 PM
I'm wondering if the SetInterrupt(FALSE) without a SetInterrupt(TRUE) is causing the problem. Sorry if I'm missing something important, but I'm not seeing any other reason why this should be causing a crash.
cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#5
Posted 30 December 2011 - 01:42 PM
Unfortunately, with the setting a variable and then referring to it within the same dialog, there is no way to do it. If it passes through two states first, it has a better chance, but it is still flaky. Ascension64 made a part of ToBEX (a bit like TimeSlip's oblivion engine extensions for modders) that sets dialog actions to take effect immediately, but apparently there are some problmes with doing that as well. So, the suggestion is to either filter through two states (and ocassionally have it fail for no reason) or to make the dialogs successive.
for
IF
InParty(Myself)
Global("KishJaheiraFighterStronghold","GLOBAL",1)
GlobalTimerExpired("KPPlotTime","GLOBAL")
!Global("KeepPlot","GLOBAL",9)
CombatCounter(0)
!Global("KishKeepInactive","GLOBAL",1)
!GlobalTimerNotExpired("KishJaheiraImpatient","GLOBAL")
OR(3)
Global("Chapter","GLOBAL",2)
Global("Chapter","GLOBAL",3)
Global("Chapter","GLOBAL",6)
!InWatchersKeep()
!Global("KishKeepFinished","GLOBAL",1)
!InActiveArea("AR1306")
!AreaCheck("AR1307")
!AreaCheck("AR1304")
!AreaCheck("AR1305")
THEN
RESPONSE #100
SetInterrupt(FALSE)
IncrementGlobal("KishJaheiraGoToKeep","GLOBAL",1)
Wait(3)
StartDialogueNoSet(Player1)
END
I have been having one hell of a time getting stuff like !GlobalTimerNotExpired("KishJaheiraImpatient","GLOBAL") to fire, even though it should. But it doesn't crash stuff.try breaking it up and seeing if that helps:
IF
GlobalTimerExpired("KishJaheiraImpatient","GLOBAL")
GlobalTimerExpired("KPPlotTime","GLOBAL")
Global("KishJaheiraFighterStronghold","GLOBAL",1)
!Global("KeepPlot","GLOBAL",9)
!Global("KishKeepInactive","GLOBAL",1)
!Global("KishKeepFinished","GLOBAL",1)
OR(3)
Global("Chapter","GLOBAL",2)
Global("Chapter","GLOBAL",3)
Global("Chapter","GLOBAL",6)
!InWatchersKeep()
THEN
RESPONSE #100
SetGlobal("KishJaheiraGoToKeep","GLOBAL",2)
END
IF
Global("KishJaheiraGoToKeep","GLOBAL",2)
!AreaCheck("AR1307")
!AreaCheck("AR1304")
!AreaCheck("AR1305")
!AreaCheck("AR1306")
THEN RESPONSE #100
StartDialogueNoSet(Player1)
END
or even better, set it so the smaller blocks increment the var to 3, so that you can troubleshoot. That should give you an idea of what is not firing correctly. In the worst case scenario, troubleshoot by setting even smaller blocks that set an independent variable (or use DisplayStringHead) and you should be able to track down which thing is not working.
#7
Posted 30 December 2011 - 07:38 PM
berelinde, on 30 December 2011 - 12:46 PM, said:
berelinde, on 30 December 2011 - 12:46 PM, said:
#9
Posted 30 December 2011 - 09:48 PM
As for NPC Strongholds, it's still on hiatus. It's not going to be out in 2011; I wouldn't bet anything I wasn't willing to lose that it will be out in 2012.
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
#10
Posted 29 January 2012 - 11:22 AM
IF
True()
THEN
RESPONSE #100
CutSceneId(Player1)
Wait(1)
FadeToColor([20.0],0)
Wait(1)
LeaveAreaLUAPanic("AR1100","",[2122.1482],4)
LeaveAreaLUA("AR1100","",[2122.1482],4)
ActionOverride(Player2,LeaveAreaLUA("AR1100","",[2159.1447],4))
ActionOverride(Player3,LeaveAreaLUA("AR1100","",[2172.1513],4))
ActionOverride(Player4,LeaveAreaLUA("AR1100","",[2209.1476],4))
ActionOverride(Player5,LeaveAreaLUA("AR1100","",[2208.1535],4))
ActionOverride(Player6,LeaveAreaLUA("AR1100","",[2244.1499],4))
MultiPlayerSync()
Wait(1)
FadeFromColor([20.0],0)
Wait(1)
SetGlobal("OgronAttackStarted","AR1100",1)
CreateCreature("RORCL01",[1854.1387],14) // Orog Leader
CreateCreature("RORCA01",[1758.1453],14) // Orc Archer
CreateCreature("RORCA01",[1822.1481],14) // Orc Archer
CreateCreature("RORCS01",[1750.1534],14) // Orog
CreateCreature("RORCS01",[1663.1536],14) // Orog
CreateCreature("RORCS01",[1613.1450],14) // Orog
Wait(1)
ActionOverride("Valygar",Attack("rorcl01"))
ActionOverride("Rorcl01",Attack("Valygar"))
EndCutSceneMode()
END
It's a cutscene. It works almostperfectly, but Valygar doesn't attack the orog leader and the orog leader doesn't appear to be looking at Valygar in particular.
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
#12
Posted 29 January 2012 - 01:11 PM
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
#13
Posted 29 January 2012 - 02:20 PM
Quote
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#14
Posted 05 February 2012 - 07:12 AM
--Miles Vorkosigan
"The really unforgivable acts are committed by calm men in beautiful green silk rooms, who deal death wholesale, by the shipload, without lust, or anger, or desire, or any redeeming emotion to excuse them but cold fear of some pretended future. But the crimes they hope to prevent in the future are imaginary. The ones they commit in the present--they are real."
--Aral Vorkosigan
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












