svj Posted May 29 Share Posted May 29 (edited) IF ~~ THEN BEGIN JoinSixtarchInBetrayal SAY ~Sixtarch i want to join you for i have score to settle whoever betrayed us!~ IF ~OR (10) !Dead("rqt5clf1") !StateCheck("rqt5clf1",STATE_HELPLESS) !StateCheck("rqt5clf1",STATE_STUNNED) !StateCheck("rqt5clf1",STATE_PANIC) !StateCheck("rqt5clf1",STATE_BERSERK) !StateCheck("rqt5clf1",STATE_SLEEPING) !StateCheck("rqt5clf1",STATE_SILENCED) !StateCheck("rqt5clf1",STATE_CHARMED) !StateCheck("rqt5clf1",STATE_FEEBLEMINDED) !StateCheck("rqt5clf1",STATE_CONFUSED)~ THEN EXTERN ~rqt5dea1~ YouTooItwantos IF ~~ THEN EXTERN ~rqt7dea2~ JoinUpThenSixtarchSays END I have created this check to see if neutral NPC is available for dialog however it does not work. My NPC fail every check despite not being afflicted by any of above negative status effects Edited May 29 by svj Quote Link to comment
paladin84 Posted May 29 Share Posted May 29 (edited) I'am not sure if this is your issue, but you check everything with "OR", why it should be checked with "AND". "OR" returns true if any of its statement is true. To start the dialog you want to be sure that the characeter is not dead and is not in panic and is not stunned, etc. So, the correct statement should be: IF ~ !Dead("rqt5clf1") !StateCheck("rqt5clf1",STATE_HELPLESS) !StateCheck("rqt5clf1",STATE_STUNNED) !StateCheck("rqt5clf1",STATE_PANIC) !StateCheck("rqt5clf1",STATE_BERSERK) !StateCheck("rqt5clf1",STATE_SLEEPING) !StateCheck("rqt5clf1",STATE_SILENCED) !StateCheck("rqt5clf1",STATE_CHARMED) !StateCheck("rqt5clf1",STATE_FEEBLEMINDED) !StateCheck("rqt5clf1",STATE_CONFUSED)~ THEN Hovewer, your OR statement should return true more oftern than the same AND statement, so idk why the original OR statement doesn't work for you (even if it is wrong). Edited May 29 by paladin84 Quote Link to comment
lynx Posted May 29 Share Posted May 29 I think the problem is that except in iwd2, all OR conditions get evaluated — it doesn't get short-circuited. Quote Link to comment
argent77 Posted May 29 Share Posted May 29 You can probably reduce all those checks to a single check: !StateCheck("rqt5clf1",CD_STATE_NOTVALID) Quote Link to comment
svj Posted May 29 Author Share Posted May 29 @argent77 No such check in state.ids !StateCheck("rqt5clf1",CD_STATE_NOTVALID) @lynx 32 minutes ago, lynx said: I think the problem is that except in iwd2, all OR conditions get evaluated — it doesn't get short-circuited. If i understood this correctly OR in BG2 does NOT work if either of these are conditions is correct. it evaluates true Quote Link to comment
argent77 Posted May 29 Share Posted May 29 2 minutes ago, svj said: No such check in state.ids !StateCheck("rqt5clf1",CD_STATE_NOTVALID) Is this for original BG2? In that case you might have to add this entry manually to STATE.IDS: 0x80101FEF CD_STATE_NOTVALID Quote Link to comment
svj Posted May 29 Author Share Posted May 29 IF ~~ THEN BEGIN DSKnowledge SAY ~We can provide you with magical items and perhaps in future you might have use further use of our talents.~ IF ~!Dead("rqt5clf1") !StateCheck("rqt5clf1",STATE_HELPLESS) !StateCheck("rqt5clf1",STATE_STUNNED) !StateCheck("rqt5clf1",STATE_PANIC) !StateCheck("rqt5clf1",STATE_BERSERK) !StateCheck("rqt5clf1",STATE_SLEEPING) !StateCheck("rqt5clf1",STATE_SILENCED) !StateCheck("rqt5clf1",STATE_CHARMED) !StateCheck("rqt5clf1",STATE_FEEBLEMINDED) !StateCheck("rqt5clf1",STATE_CONFUSED)~ THEN EXTERN ~rqt5dea1~ BetrayalIrgulisReaction IF ~!Dead("rqt6clf1") !StateCheck("rqt6clf1",STATE_HELPLESS) !StateCheck("rqt6clf1",STATE_STUNNED) !StateCheck("rqt6clf1",STATE_PANIC) !StateCheck("rqt6clf1",STATE_BERSERK) !StateCheck("rqt6clf1",STATE_SLEEPING) !StateCheck("rqt6clf1",STATE_SILENCED) !StateCheck("rqt6clf1",STATE_CHARMED) !StateCheck("rqt6clf1",STATE_FEEBLEMINDED) !StateCheck("rqt6clf1",STATE_CONFUSED)~ THEN EXTERN ~rqt6dea2~ JoinSixtarchInBetrayal IF ~~ THEN GOTO EyesandEars END If i use THEN EXTERN this check always fails however if use this in THEN REPLY it actually works. Works IF ~~ THEN BEGIN IdoNotKnowWhoisEnemy SAY ~If i knew who it was i would go kill it right now!~ IF ~!Dead("rqt5clf1") !StateCheck("rqt5clf1",STATE_HELPLESS) !StateCheck("rqt5clf1",STATE_STUNNED) !StateCheck("rqt5clf1",STATE_PANIC) !StateCheck("rqt5clf1",STATE_BERSERK) !StateCheck("rqt5clf1",STATE_SLEEPING) !StateCheck("rqt5clf1",STATE_SILENCED) !StateCheck("rqt5clf1",STATE_CHARMED) !StateCheck("rqt5clf1",STATE_FEEBLEMINDED) !StateCheck("rqt5clf1",STATE_CONFUSED)~ THEN REPLY ~Why should i let you go?~ EXTERN ~rqt5dea1~ ItwantosTreasonReac2 IF ~Dead("rqt5clf1")~ THEN REPLY ~Why should i let you go?~ GOTO EscapeAndGiveInventory END @argent77 Would that new statecheck work and not conflict other mods perhaps adding same? Quote Link to comment
argent77 Posted May 29 Share Posted May 29 29 minutes ago, svj said: Would that new statecheck work and not conflict other mods perhaps adding same? In a mod you would add it like this to prevent that the entry is added multiple times. APPEND "state.ids" "0x80101FEF CD_STATE_NOTVALID" UNLESS "CD_STATE_NOTVALID" CD_STATE_NOTVALID combines all of the individual disabling states as well as the various death states (STATE_DEAD, STATE_FROZEN_DEATH, ...), so it should cover all situations you have previously covered with the death check and individual state checks. The reason why your first code sample (without REPLY) doesn't work as intended is that dialog transitions are checked bottom-up, and the first matching state will be executed. That's always "IF ~~ THEN GOTO EyesandEars" in your case. That can be fixed by reordering your list of transitions. Quote Link to comment
svj Posted May 29 Author Share Posted May 29 @argent77 Append code goes into tp2 did i understood that correctly? 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.