Warning:
PartyComponent.onClickItemSlot(self, champion, container, slot, button) => champion is nil if you click on the attack panel's hands
your hook could cause a crash!
Gray Out / Disable User Interface?
Re: Gray Out / Disable User Interface?
Apologies folks - thanks again AndakRainorAndakRainor wrote:Warning:
PartyComponent.onClickItemSlot(self, champion, container, slot, button) => champion is nil if you click on the attack panel's hands
your hook could cause a crash!
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Gray Out / Disable User Interface?
I've been silent here a bit because 1) I'm working too much [I hate it when "life" gets in the way!], and 2) I'm more than a bit lost. I've never done "party hooks", so I'm searching the forums for a simple example that I can use. There are a lot of posts on them, but I'm missing some basic information, I think.
But then, if I understand the previous posts any at all, I can create one or more party hooks when the party "attack panel" is rendered on the screen and I can affect it on each frame so that it is modified how I want, namely grayed out for a time. Am I on the right track? Sorry to be such a newb here, but I' learning!
Thanks, -Lark
But then, if I understand the previous posts any at all, I can create one or more party hooks when the party "attack panel" is rendered on the screen and I can affect it on each frame so that it is modified how I want, namely grayed out for a time. Am I on the right track? Sorry to be such a newb here, but I' learning!
Thanks, -Lark
Re: Gray Out / Disable User Interface?
The supported hooks in Grimrock 1 & 2 are in their respective scripting references. [Essentially] If defined they exist; if they exist, they get called when their event triggers. Many of them have the option of canceling the calling event. This is done by returning a value of False. For instance, by returning false from the party:onMove() hook, the party does not complete the movement that triggered the hook. In another instance, the onAcceptItem() hook for a surface component, cancels the acceptance of the item, if the hook function returns false.
Defining a hook is done by including it as a variable in the component, and assigning an anonymous function to it.
eg. onMove = function(self) -- instructions here get called before every move -- end
*technical corrections follow...
Defining a hook is done by including it as a variable in the component, and assigning an anonymous function to it.
eg. onMove = function(self) -- instructions here get called before every move -- end
*technical corrections follow...
Re: Gray Out / Disable User Interface?
Hey Lark,
Isaac's explanation is spot on, and yes you are right - they are really essential to at least understand
Here is a list of the party hooks (from jKos wiki, also in scripting reference)
If you want some examples to read over/work with - Id be happy to send you my lua file with all my party hooks (so far)
Let me know if so
Isaac's explanation is spot on, and yes you are right - they are really essential to at least understand
Here is a list of the party hooks (from jKos wiki, also in scripting reference)
SpoilerShow
Code: Select all
PartyComponent.onCastSpell(self, champion, spell)
PartyComponent.onClickItemSlot(self, champion, container, slot, button) Beta 2.2.4
PartyComponent.onDamage(self, champion, damage, damageType)
PartyComponent.onDie(self, champion)
PartyComponent.onAttack(self, champion, action, slot)
PartyComponent.onGetPortrait(self,champion) Beta 2.2.3
PartyComponent.onLevelUp(self, champion)
PartyComponent.onReceiveCondition(self, champion, condition)
PartyComponent.onDrawAttackPanel(self, champion, context, x, y) Beta 2.2.4
PartyComponent.onDrawGui(self, context)
PartyComponent.onDrawInventory(self, context, champion)
PartyComponent.onDrawStats(self, context, champion)
PartyComponent.onDrawSkills(self, context, champion)
PartyComponent.onDrawTraits(self, context, champion)
PartyComponent.onPickUpItem(self, item)
PartyComponent.onProjectileHit(self, champion, item, damage, damageType)
PartyComponent.onRest(self)
PartyComponent.onWakeUp(self)
PartyComponent.onTurn(self, direction)
"direction" will be -1 for a left turn, or 1 for a right turn
PartyComponent.onMove(self, direction)Let me know if so
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Gray Out / Disable User Interface?
Isaac and Akroma: Thank you very much for the assistance. This helps me understand what's happening a bit better and I can't wait to play with it when I get some time which is way to hard to come by lately. You two are very kind.
Akroma: I would LOVE to have your party hooks - working examples really help me a lot. I'll PM you an email address.
Sincere thanks to you both! -Lark
Akroma: I would LOVE to have your party hooks - working examples really help me a lot. I'll PM you an email address.
Sincere thanks to you both! -Lark