jastey Posted May 2, 2020 Share Posted May 2, 2020 Is there a way to detect whether the party AI is toggled off (or on)? My problem is that I assign a script as CLASS script to my NPC when in 7th party member mode (FAMILIAR) which gets executed also if AI is off, which is bad. Alternatively: Is there a script slot for a FAMILIAR party member that is also affected by the AI button? Quote Link to comment
Magus Posted May 20, 2020 Share Posted May 20, 2020 There's something in EEEx https://eeex-docs.readthedocs.io/en/latest/EE Game Lua Functions/game/game_GetPartyAI.html#game-getpartyai, although the usage is unclear. Quote Link to comment
jastey Posted May 20, 2020 Author Share Posted May 20, 2020 Thank you for the info! Unfortunately, I'd need a solution which would also be available for classic BGII (ideally). Quote Link to comment
Bubb Posted May 20, 2020 Share Posted May 20, 2020 I'm afraid it's impossible in classic games. The only place the engine exposes such information is to the UI in v2.0+ Enhanced Edition games, (to render the button on the worldscreen in the correct state). It would be possible to rig UI.MENU to toggle a GLOBAL according to the current state of the party AI, but that's about it. Quote Link to comment
jastey Posted May 20, 2020 Author Share Posted May 20, 2020 34 minutes ago, Bubb said: It would be possible to rig UI.MENU to toggle a GLOBAL according to the current state of the party AI, but that's about it. Meaning I would need to mod the UI so it gives the GLOBAL? Thank you very much for the info! Quote Link to comment
argent77 Posted May 20, 2020 Share Posted May 20, 2020 1 hour ago, Bubb said: I'm afraid it's impossible in classic games. The only place the engine exposes such information is to the UI in v2.0+ Enhanced Edition games, (to render the button on the worldscreen in the correct state). It would be possible to rig UI.MENU to toggle a GLOBAL according to the current state of the party AI, but that's about it. Well, PSTEE provides a PartyScriptsActive() trigger, which does exactly what the name suggests. Unfortuntately it hasn't been implemented in the other EE games. This feature would have been useful in some of my mods as well. Quote Link to comment
Bubb Posted May 20, 2020 Share Posted May 20, 2020 42 minutes ago, jastey said: Meaning I would need to mod the UI so it gives the GLOBAL? Correct - you can do something like this: Append to the very top of UI.MENU => Spoiler ` B3OldPartyAI = nil function B3CheckPartyAITick() if aiButtonToggle ~= B3OldPartyAI then B3OldPartyAI = aiButtonToggle C:SetGlobal("B3PartyAI", "GLOBAL", aiButtonToggle) end return false end ` menu { name "B3CheckPartyAI" label { enabled "B3CheckPartyAITick()" } } Use WeiDU to replace this part of UI.MENU: Spoiler Infinity_PushMenu('WORLD_MESSAGES') if(groundItemsButtonToggle == 1) then with => Spoiler if not Infinity_IsMenuOnStack('B3CheckPartyAI') then Infinity_PushMenu('B3CheckPartyAI') end Infinity_PushMenu('WORLD_MESSAGES') if(groundItemsButtonToggle == 1) then This patch works for the vanilla UI, (it might break if a UI mod alters the wrong part of WORLD_ACTIONBAR). You can then, in scripts, check if Party AI is enabled with: Global("B3PartyAI","GLOBAL",1) Zero being disabled, of course. 12 minutes ago, argent77 said: Well, PSTEE provides a PartyScriptsActive() trigger, which does exactly what the name suggests. Unfortuntately it hasn't been implemented in the other EE games. This feature would have been useful in some of my mods as well. I always forget that PST:EE had some unique features; I agree, would be nice if some of those were merged into the normal EE branch. Quote Link to comment
jastey Posted May 20, 2020 Author Share Posted May 20, 2020 Wow @Bubb it's really amazing what you can do with the engine/UI/everything on the fly-by! I don't think I will actually do this (as it still has the risk to break (with) UI mods) but it's interesting to know, thanks! Quote Link to comment
Magus Posted May 21, 2020 Share Posted May 21, 2020 kludgemaster 3000: you can set a short timer in dplayer.bcs, once it expires you'll know it's off. Not instant, and won't work in some corner cases, but hey, it's something. 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.