Page 12 of 15

Re: [WIP] GrimTK GUI Framework

Posted: Mon Nov 02, 2015 11:01 am
by cromcrom
Is there a way to not make the UI "transparent" ? When I click on a button, if there is an item "behind" (say, for example, on an alcove), it will grab that item. Leading to a "bug", if the clicked button should destroy that alcove item. (I encountered this problem quite a lot of times before figuring out. :oops: )
I could probably write a bugproof function (if mouseItem then return) of some sort, but well.
If anybody has a tip, most welcome. Thanks.

Re: [WIP] GrimTK GUI Framework

Posted: Wed Nov 04, 2015 7:11 pm
by JohnWordsworth
Hmm, I hit this problem the other day with the ORRR3. I have yet to solve the issue (not that I've tried for long), but will have a think about it and post a solution. I'm hoping that a button will block mouse input to the game world, and then I could just place a big button behind every window automatically. Failing that, we might need to disable any surfaces / clickable entities in the spaces around the player and then re-enable them later.

Will ponder and get back to you!

Other news about GrimTK - I'm working on a crafting system for the ORRR3 which will come bundled with GrimTK. It's very similar in style to Skyrim - Select Category -> Select Item -> Click Build.

Re: [WIP] GrimTK GUI Framework

Posted: Mon Feb 01, 2016 5:22 am
by akroma222
cromcrom wrote:Is there a way to not make the UI "transparent" ? When I click on a button, if there is an item "behind" (say, for example, on an alcove), it will grab that item. Leading to a "bug", if the clicked button should destroy that alcove item. (I encountered this problem quite a lot of times before figuring out. :oops: )
I could probably write a bugproof function (if mouseItem then return) of some sort, but well.
If anybody has a tip, most welcome. Thanks.
Cromcrom & john,
Last post here was from November - you guys may have found solutions to the 'transparent' UI - being able to interact with objects, pick up and throw items through the UI etc
I have also encountered logistical issues with this while creating my picklocking system, Question - do we have a solution to this??
If not, here is how I have hacked around it (correct me if there is a better way pls)

My system requires you to keep pick locks in the mouse cursor through out the picklocking process - so I needed to move my UI buttons into areas of the screen that you cant throw or place items into
If you click on the clickable area of the chest through the Champ Select menu - then it just takes you back to the Main Menu anyways
These are the positions of the spawned UI menus
SpoilerShow
Image
If I drag the Champ select menu to the side...... You can see the Champion buttons have default positions over an area (yellow shading) in front of the chest where you can not pick up or drop items (because of the chest)- I also reduced the clickable area (green box) for the lock
SpoilerShow
Image
So, that is my dodgey, hacky solution....
Also, I have written some functions to make sure you cant pick up items while UI menus are activated....

Place in a script called guiExpScript
SpoilerShow

Code: Select all

                          --place all names of menus you are using in this table

guiWindows = {"gtk-select-menu-small", "gtk_info_message", "log2-messagebox-champSelect", "gtk-info-message-box", "log2-messagebox-large", "log2-messagebox-small",
			"gtk-select-menu-option", "gtk-select-menu", "log2-textinputbox", "gtk_text_input"}		
			
function getGuiWindows()           --check if any of the windows in the table are currently spawned	
	for i = 1,#guiWindows do
		local name = guiWindows[i]
		local winList = GTK.Core.GUI:getWindow(name)
		if winList then
			return true	
		else
			return false
		end
	end
end
Then place this in your - onPickUpItem hook
SpoilerShow

Code: Select all

onPickUpItem = function(self, item)
			
			if guiExpScript.script.getGuiWindows() then
				
				return false	
				
			end
If there have been any newer, better solutions or developments here, pls let me know.

Re: [WIP] GrimTK GUI Framework

Posted: Thu Mar 17, 2016 4:42 pm
by THOM
Can anyone help me, how to lock the party while a messagebox or a selectmenue is open?

I had a look into the examples and for a dialogue there is this:

Code: Select all

	local dialogue = {
		lockParty = true,
		pages = {... ... ...
But I cannot find out IF ther is a way, to put this also into messageboxes/selectmenues, and if WHERE to put.

Has anyone an idea?

Re: [WIP] GrimTK GUI Framework

Posted: Fri Mar 18, 2016 9:36 pm
by Echoplex
What is the mod directory path the pictures that are used in the dialogue scripts should be placed in when uploading the mod to say steam? I'm able to pull them into the dialogue via the editor no problem however once uploaded to steam it results in a crash when triggered. I'm guessing just like the custom portraits being uploaded there is a very specific location and format that needs to be used so it will upload properly. Portraits needed to be 128x128 dds format and placed in the mod_assets/textures/portraits folder. Those work fine. The pictures in question for the dialogue are dds format and 192x192 and do not display when triggered in the dialogue scripts once published. Again they do work inside the editor.

Code: Select all

function gtkDidLoad()
	GTK.Core.GUI:addImage({ name="davion", path="mod_assets/ext/grimtk/samples/davion.tga", size={192, 192} });
end

isDone = false;

function showIntroDialogue(sender)
	if ( isDone == true ) then
		return;
	end

	local dialogue = {
		lockParty = true,
		pages = {
			{
				id = "page1",
				mainImage = "davion",
				mainMessage = "Spoilers",
				speakerMessage = "Yysara:",
				responses = {
					{ text = "Spoilers", nextPage = "page2" },	
				} 
			},
			{
				id = "page2",
				mainImage = "davion",
				mainMessage = "Spoilers,
				speakerMessage = "Yysara",
				responses = {
					{ text = "Spoilers", nextPage = "page3" },
				}
			},	
			{
				id = "page3",
				mainImage = "davion",
				mainMessage = "Spoilers",
				speakerMessage = "Yysara",
				responses = {
					{ text = "<Spoilers.>"},
				}
			}
		}
	}

	GTKGui.Dialogue.startDialogue(dialogue);
end

function hideDemoDialogue()
	GTKGui.Dialogue.hideDialogue();
	end
	

Re: [WIP] GrimTK GUI Framework

Posted: Sat Mar 19, 2016 12:30 am
by minmay
Only files that are somewhere in the mod_assets directory, and whose filenames end in .dds, .lua, .model, .animation, .wav, .ogg, or .ivf, will be exported. If you are trying to use files that actually end in .tga or .DDS instead of .dds, they won't work, even if they're actually dds files, because the game only checks the extension when exporting.

Re: [WIP] GrimTK GUI Framework

Posted: Sat Mar 19, 2016 5:26 am
by Echoplex
The files are in dds format and have the dds extension and are not importing over. I'm suspecting that they need to be in a specific directory for the import just as the portraits do. Im not sure if this is a steam only problem or not.

Re: [WIP] GrimTK GUI Framework

Posted: Sat Mar 19, 2016 5:39 am
by minmay
Can you at least provide the error message and console output for the crash?

Re: [WIP] GrimTK GUI Framework

Posted: Sat Mar 19, 2016 6:13 am
by Echoplex
I don't receive an error message it just crashes to desktop. Where would I capture such a message to report back?

Re: [WIP] GrimTK GUI Framework

Posted: Sat Mar 19, 2016 6:16 am
by minmay
Run the Grimrock 2 executable file from the command prompt (Windows) or a terminal (Mac OS).