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!
id = "show_wares",
speakerName = storeKeeperName,
speakerMessage = "I require an item if you wish to pass, I need a new shield, named the Vanguard. Get it for me and you can pass. Its in Zeonguard Cave.",
responses = {
{ text = items.uiName, onSelect=self.go.id..".script.buyItem" },
{ text = "Alright, I will get the shield for you. <Walk Away>" },
{ text = items.uiName, onSelect=self.go.id..".script.buyItem" }, calls the buyItem function, but it doesn't give it any data. function buyItem(index) expects to receive data, but it doesn't.
Again, I may be wrong.
minmay wrote:I suggest that you review what commas and parentheses mean in Lua. Because this block:
items = { name="lightning_blade", uiName="Here is the Vanguard.", cost=1
}
function countInventoryItem(name)
Thanks for helping me on this! Both of you were right, I fixed my commas and parentheses, and the buyItem doesnt receive data and the script does not give out any data. Now I just have to find out how to make the script send data, and make myself learn how to not use heavily coded samples.
I test some scripts to display several texts on screen.
This works well if I use a string in showText, but fails if I do it with a variable with a string value.
EDIT: the issue wasn't due to the string variable itself but apparently to its lenght.
Now I am trying to change the background image, but "no valid image to show" is the only thing I get (image in dds format)
Some help?
Hello! Guess i found a bug! First, sorry for my English, i try to explain as good as possible. Download "GrimTK Alpha 008-23-0-0-007" and open the Sample Dungeon "GrimTK.dungeon_editor" and then export the Dungeon. Start a new game with the exported dungeon. Go to the "Text Input Section" and save the game! (quicksave for example)
Try to solve the Password. Its Working! Wrong Password do what it should and the Right Password is working too...
BUT if you now LOAD the game and try to click on the "Text Entry Box" to start typing the game crashes! Restarting the game and loading the savegame and trying again make it crash again... So, you cant save the game and still have a working "Text Input Box"!
Heres the Error from the "grimrock.log":
Loading dungeon GrimTK-Alpha-008-Test by John Wordsworth
Game loaded
=== Software Failure ===
mod_assets/ext/grimtk/scripts/gtk/input.lua:280: bad argument #1 to 'keyDown' (string expected, got nil)
stack traceback:
[C]: in function 'error'
[string "ScriptInterface.lua"]: in function 'checkArg'
[string "Gui.lua"]: in function 'keyDown'
mod_assets/ext/grimtk/scripts/gtk/input.lua:280: in function 'isKeyDown'
mod_assets/ext/grimtk/scripts/gtk/input.lua:245: in function 'commit'
mod_assets/ext/grimtk/scripts/gtk/core.lua:847: in function 'update'
mod_assets/ext/grimtk/scripts/hook.lua:2: in function <mod_assets/ext/grimtk/scripts/hook.lua:1>
[string "Script.lua"]: in function 'sendMessage'
[string "Component.lua"]: in function 'triggerConnectors'
[string "Component.lua"]: in function 'callHook'
[string "Gui.lua"]: in function 'draw'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
Any idea how to fix this? Btw. this also crashes in my own dungeon not only in the sample one!
Thanks for reading!
With this a working "Text Input Box" after Saveing and Loading the game is possible BUT you lose the ability to use your Shift key for Special Characters! and CAPITALS. In my case its not a good solution but if the author cant fix it or nobody else find a way to fix it i have to use it that way, still better than crashing to Desktop.
ColdDeadStone wrote:Still didnt find a fix for the Problem! But for a quick workaround you can "comment out" line 280 in the input.lua script which looks like this:
With this a working "Text Input Box" after Saveing and Loading the game is possible BUT you lose the ability to use your Shift key for Special Characters! and CAPITALS. In my case its not a good solution but if the author cant fix it or nobody else find a way to fix it i have to use it that way, still better than crashing to Desktop.
Alright, thanks for reading and a nice day!
I sent him the link to your post. No word if he's read it yet; but he's still active.
Time to bring new life back here.
How can i make a shop with more items than in the Dialog.04? I tried it with multiple pages, but the onSelect hook always Counts the index from 1 to 4 dependent on the item clicked, because i have only space for max. 4 items on one page and i can´t add more. Maybe it´s possible to give the function a fourth Parameter for making distinctions in the buy function.
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
grimtk based Question, (re clicking through windows/widgets) posted in simple Q simple A thread viewtopic.php?f=22&t=7951&p=120714#p120714
Akroma
EDIT: Nevermind, found a suitable workaround