temnix Posted August 6, 2021 Share Posted August 6, 2021 I want to insert a condition in front of Heard() triggers in scripts so that creatures only react to shouts unless they are deaf at the time or a special variable is set on them. This should be a simple case of REPLACE_TEXTUALLY, only that's never simple. COPY_EXISTING ~SHOUT.BCS~ ~override~ DECOMPILE_AND_PATCH BEGIN REPLACE_TEXTUALLY CASE_INSENSITIVE ~^Heard~ ~Global("JTOAD","LOCALS",0) !CheckSpellState(Myself,DEAFENED) Heard~ END There is a ^ in front of Heard to avoid the LastHeardBy trigger. I have also tried \bHeard and putting EXACT_MATCH in conditions, but decided to remove that in case it made the replacement too picky about spaces in the BCS. Any way I do it, nothing happens. What is the secret of eternal life, Brian? Quote Link to comment
tipun Posted August 6, 2021 Share Posted August 6, 2021 (edited) COPY_EXISTING ~shout.bcs~ ~override~ DECOMPILE_AND_PATCH BEGIN REPLACE_TEXTUALLY ~Heard(~ ~Global("JTOAD","LOCALS",0) !CheckSpellState(Myself,DEAFENED) Heard(~ END ^ - matches at beginning of line (weidu readme) Edited August 6, 2021 by tipun Quote Link to comment
temnix Posted August 6, 2021 Author Share Posted August 6, 2021 It is the beginning of line. But I have already done this just the way you suggest. Thanks anyway. Quote Link to comment
kjeron Posted August 6, 2021 Share Posted August 6, 2021 DECOMPILE_AND_PATCH indents the decompiled text, similar to how near infinity displays it, so it won't be the beginning of the line. This is the first block of SHOUT.BCS during a DECOMPILE_AND_PATCH: IF OR(2) StateCheck(Myself,STATE_STONE_DEATH) StateCheck(Myself,STATE_FROZEN_DEATH) THEN RESPONSE #100 SmallWait(5) END Quote Link to comment
temnix Posted August 7, 2021 Author Share Posted August 7, 2021 I tried the \b for the start of the word, too. It still didn't work. But this is all water under the bridge now. 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.