Moonboy187 Posted December 30, 2022 Share Posted December 30, 2022 Hi, Currently I am trying to edit a .BCS script to allow hostiles to appear once a HP threshold has been met by any one of several npcs: // IF HPLT("HMCOUN1",40) HPLT("HMCOUNC2",40) HPLT("HMCOUNC3",40) HPLT("HMCOUNC4",40) HPLT("HMCOUNC5",40) Global("DragonReinforcements","AR6301",0) THEN RESPONSE #100 SetGlobal("DragonReinforcements","AR6301",1) DisplayString("HMCOUN1",286029) ScreenShake([30.30],20) CreateCreature("HMOAS06A",[1814.502],SW) Wait(1) END // If I only have 1 instance of HPLT with any one of the creatures it works, but what I am trying to do is activate the response if any of the five creatures fall below that threshold. I don't really know how to do that. Any help would be appreciated. Thank you. Quote Link to comment
jmerry Posted December 30, 2022 Share Posted December 30, 2022 What you need is an "or" condition. Rows in the condition block are normally combined with an "and", so we need to override that. Using your code as an example... IF OR(5) HPLT("HMCOUN1",40) HPLT("HMCOUNC2",40) HPLT("HMCOUNC3",40) HPLT("HMCOUNC4",40) HPLT("HMCOUNC5",40) Global("DragonReinforcements","AR6301",0) THEN RESPONSE #100 SetGlobal("DragonReinforcements","AR6301",1) DisplayString("HMCOUN1",286029) ScreenShake([30.30],20) CreateCreature("HMOAS06A",[1814.502],SW) Wait(1) END The indentation is purely cosmetic here, but of course it's standard to indent everything that belongs to an OR group. Note the syntax - nothing to close the OR group, but you have to specify the number of conditions when you declare it. There are five conditions being combined this way in your example, so that's OR(5). Quote Link to comment
Moonboy187 Posted December 30, 2022 Author Share Posted December 30, 2022 43 minutes ago, jmerry said: What you need is an "or" condition. Rows in the condition block are normally combined with an "and", so we need to override that. Using your code as an example... IF OR(5) HPLT("HMCOUN1",40) HPLT("HMCOUNC2",40) HPLT("HMCOUNC3",40) HPLT("HMCOUNC4",40) HPLT("HMCOUNC5",40) Global("DragonReinforcements","AR6301",0) THEN RESPONSE #100 SetGlobal("DragonReinforcements","AR6301",1) DisplayString("HMCOUN1",286029) ScreenShake([30.30],20) CreateCreature("HMOAS06A",[1814.502],SW) Wait(1) END The indentation is purely cosmetic here, but of course it's standard to indent everything that belongs to an OR group. Note the syntax - nothing to close the OR group, but you have to specify the number of conditions when you declare it. There are five conditions being combined this way in your example, so that's OR(5). Thank you for responding, I unfortunately am not too familiar with the full syntax of using Java. I did not even know that you had to specify the amount of conditions set for the OR group, never knew that was even a thing. I do need to brush on my skills. Thank you again for your help. Quote Link to comment
Graion Dilach Posted December 30, 2022 Share Posted December 30, 2022 This isn't Java , this is BCS. Refer to https://gibberlings3.github.io/iesdp/scripting/triggers/bgeetriggers.htm and https://gibberlings3.github.io/iesdp/scripting/actions/bgeeactions.htm as your primary source of information on what does what and https://www.pocketplane.net/tutorials/simscript.html to get the basics covered. 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.