[WIP] GrimTK GUI Framework

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: [WIP] GrimTK GUI Framework

Post by ratman »

In my mod I have a pressure plate where when the party steps on it, it starts a dialogue, but when they step on it it gives me an error saying 'attempt to call field 'startDialogue' (a nil value)'. Thanks
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [WIP] GrimTK GUI Framework

Post by Isaac »

A nil value basically means that it doesn't exist; your mod is calling for something that either doesn't exist, or the location/pathname for it is wrong.

More than that needs more details.
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: [WIP] GrimTK GUI Framework

Post by ratman »

I took out an asset pack I had in my dungeon, and it works now.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [WIP] GrimTK GUI Framework

Post by Isaac »

Objects can be redefined if they appear more than once during initialization/loading. It might be that an object altered/defined by GrimTK was redefined without the startDialog function.

More likely the mod you removed redefined the same object.
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: [WIP] GrimTK GUI Framework

Post by ratman »

I have another question, but I'm not sure if this is the right place to post it. Is it possible to make it so that some dialogue options are only available if the party has a high enough stat/skill? Example: The party is walking through a dungeon when they come to a cave in. The dialogue comes, asking them if they want to walk away, or if their athletics or strength is high enough, to clear it away to unlock some treasure. Is this possible with minimal scripting? Thanks. :D
User avatar
ratman
Posts: 158
Joined: Fri Jan 10, 2020 1:13 am

Re: [WIP] GrimTK GUI Framework

Post by ratman »

Does GrimTK not work with zim_assets? I have merged the party definitions, and it all works fine, no errors or anything, but when I start a dialogue or open the enchanting menu, the party can still move around. This isn't that big of a deal, but it is kind of annoying to have to drop invisible doors around the party every time I start a dialogue. Thanks
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [WIP] GrimTK GUI Framework

Post by Isaac »

ratman wrote: Sat Oct 24, 2020 5:28 pm This isn't that big of a deal, but it is kind of annoying to have to drop invisible doors around the party every time I start a dialogue. Thanks
I have rarely used GrimTK, but Grimrock 2 has a built in way to disable party movement, rather than using invisible doors.

Try this out:
https://github.com/JKos/log2doc/wiki/Ob ... s#gamemode
  • GameMode.setEnableControls(boolean)
If enable controls is false, then the player cannot move, use mouse look, pick up or throw items using the mouse, open or close champion windows, or use keyboard shortcuts in general. The player can freely interact with champion windows that are already open.
Post Reply