Gray Out / Disable User Interface?
Gray Out / Disable User Interface?
When the party climbs a ladder, the party's hands are grayed out and the keyboard movement keys don't work until you reach the top. I wish to reproduce this effect from a script: The script will be triggered, the interface disabled, the script does its thing, and enables the interface just before it exits.
Does anyone know how to do enable/disable this user interface? I've searched for days and not found anything.
Thank you, -Lark
Does anyone know how to do enable/disable this user interface? I've searched for days and not found anything.
Thank you, -Lark
Re: Gray Out / Disable User Interface?
Code: Select all
GameMode.setGameFlag("HideGui", true)
GameMode.setGameFlag("DisableMovement", true)
GameMode.setGameFlag("DisableMouseLook", true)
Code: Select all
GameMode.setEnableControls(false)*"HideGUI" may be overkill... That hides everything, including the portraits.
To disable just the attack panel, [afaik*] requires a party hook, if you are interested.
*(I would love to learn otherwise.
Lark, there is another (more up to date) scripting reference for LoG2; maintained by JKos & minmay.
https://github.com/JKos/log2doc/wiki
Re: Gray Out / Disable User Interface?
"Maintained" isn't the word I'd use
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Gray Out / Disable User Interface?
Embellished then.minmay wrote:"Maintained" isn't the word I'd use
[But they are welcome updates.]
Re: Gray Out / Disable User Interface?
Isaac, This is fantastic! Thank you! This fixed my problem! And the new wiki is great! Thank you JKos and minmay!!
I have a ladder script that automatically deploys itself on all ladders defined in the game that gives the party an actual descent to the floor instead of just falling. Just back onto a ladder and you descend it. It's working really well, but if the party moved forward while descending, they wound back up at the top of the ladder on the landing and the script got "confused". Disabling movement takes care of that and it's better than spawning a temporary block in the square!
I've still to handle stacked ladders and I'd like to disable the sound of the party falling, but I added some relatively hefty sounds of the party stepping down the ladder rungs, so the falling sound isn't so bad. I have a few leads on that, but the stacked ladder support is more fun right now.
I'd also like to add clicking on the top or bottom of the ladder while on a multi-ladder segment to go up or down, but I don't even know where to begin with that yet. Regardless, I hope to have at least a single ladder script uploaded soon.
Thank you again for your help! -Lark
I have a ladder script that automatically deploys itself on all ladders defined in the game that gives the party an actual descent to the floor instead of just falling. Just back onto a ladder and you descend it. It's working really well, but if the party moved forward while descending, they wound back up at the top of the ladder on the landing and the script got "confused". Disabling movement takes care of that and it's better than spawning a temporary block in the square!
I've still to handle stacked ladders and I'd like to disable the sound of the party falling, but I added some relatively hefty sounds of the party stepping down the ladder rungs, so the falling sound isn't so bad. I have a few leads on that, but the stacked ladder support is more fun right now.
I'd also like to add clicking on the top or bottom of the ladder while on a multi-ladder segment to go up or down, but I don't even know where to begin with that yet. Regardless, I hope to have at least a single ladder script uploaded soon.
Thank you again for your help! -Lark
Re: Gray Out / Disable User Interface?
The party_land sound only plays upon the party hitting the ground from their GravityComponent. If you disable the party's GravityComponent before they touch the ground, you should be able to prevent the sound from playing.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Gray Out / Disable User Interface?
That sounds really cool.Lark wrote:I have a ladder script that automatically deploys itself on all ladders defined in the game that gives the party an actual descent to the floor instead of just falling. Just back onto a ladder and you descend it.
I have a different kind of ladder script; one that spawns additional ladders as needed [upwards or down], resulting in a multi-story ladder object... but there was no safe descent.
Re: Gray Out / Disable User Interface?
minmay: Thanks for the gravity idea, but the party is actually "falling" a short distance on a moving, invisible platform. So when I turn off gravity, the party doesn't, uh, fall!
I tried using party.party:move() but found through trial and error that it only allows you to move N, E, S, and W (0, 1, 2, 3 respectively). It's a great idea, but alas...
Can/should others update the wiki? I had to experiment with :move(), but I could document what I just found if that is allowed/desired.
Isaac: I'll post the script soon, but now I really want to get it working on multi-level ladders! I'll share what I have at anytime if anyone wants it in alpha state.
Thank you both, -Lark
Can/should others update the wiki? I had to experiment with :move(), but I could document what I just found if that is allowed/desired.
Isaac: I'll post the script soon, but now I really want to get it working on multi-level ladders! I'll share what I have at anytime if anyone wants it in alpha state.
Thank you both, -Lark
Re: Gray Out / Disable User Interface?
party.party:move() and party.party:turn() are for changing the movement state of the party as if the player sent an input (except it ignores the input queue and overwrites any current action). If your intent is to translate the party along a path, party.party:move() is not what you want. Instead, use GameObject:setWorldPosition() called every frame - like you are presumably doing for your moving platform.Lark wrote:minmay: Thanks for the gravity idea, but the party is actually "falling" a short distance on a moving, invisible platform. So when I turn off gravity, the party doesn't, uh, fall!I tried using party.party:move() but found through trial and error that it only allows you to move N, E, S, and W (0, 1, 2, 3 respectively). It's a great idea, but alas...
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Gray Out / Disable User Interface?
Sorry if Im late to the party Lark,
to replicate the disabled attack panel (for a custom Frozen condition) I use:
then for the onDrawAttackPanel partyhook:
and then for the other appropriate party hooks (onAttack, onMove etc):
Importantly, is the onClickItemSlot hook though, as you may want different mouse clicks to be allowed or not (??):
to replicate the disabled attack panel (for a custom Frozen condition) I use:
Code: Select all
GameMode.setGameFlag("DisableMovement", true)
GameMode.setGameFlag("DisableMouseLook", true)
GameMode.setGameFlag("DisableKeyboardShortcuts", true)
Code: Select all
if champion:hasCondition("frozen") and (not champion:hasCondition("petrified") and not champion:hasCondition("paralyzed")) then
g.color(30,100,300)
champion:showAttackResult("", "ChampionConditionOverlay") -- I think this is what you may be looking for
champion:showAttackResult("Frozen", "SpellNoEnergy") --extra stuff you prob dont needCode: Select all
if champion:hasCondition("frozen") then --add your checks in here then return false
return false
endCode: Select all
onClickItemSlot = function(self, champion, container, slot, button)
------------------------------------------
local m = getMouseItem()
--------------------------------------------FROZEN
if champion:hasCondition("frozen")
or champion:hasCondition("paralyzed")
or champion:hasCondition("petrified") then
if (slot == 1 or slot == 2)
and (button == 0 or button == 1 or button == 2) then
return false
elseif slot
and (button == 1 or button == 2) then
return false
end
end
end
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)