Ask a simple question, get a simple answer
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Well my problem is about procedural generated maps. I noticed that I can't spawn a water mesh when needed, so I have them generated at the initialisation of the mod, and they have the size of the full map. At that point I don't know where the stairs to go down to the map below will be placed. I try to find a way to hide the water that floods the stairs. No luck so far with ForceZWrite. I hope I won't have to give stairs a fixed position because of this, or other cheap solutions...
Re: Ask a simple question, get a simple answer
Ah. WaterSurfaceMeshComponent builds the mesh when:
- the party enters its level and the mesh hasn't been built already
- the game is reloaded
So it won't automatically build the mesh when newly spawned, but you can make it build the mesh by moving the party to another level and then back. HeightmapComponent behaves the same way.
Of course, the resulting mesh is based entirely on which tiles are underwater, and the user scripting interface can't modify the tile map. But if you were to find a way to modify the tile map anyway, it does get saved and loaded, as does the heightmap, so changing it probably works fine...
- the party enters its level and the mesh hasn't been built already
- the game is reloaded
So it won't automatically build the mesh when newly spawned, but you can make it build the mesh by moving the party to another level and then back. HeightmapComponent behaves the same way.
Of course, the resulting mesh is based entirely on which tiles are underwater, and the user scripting interface can't modify the tile map. But if you were to find a way to modify the tile map anyway, it does get saved and loaded, as does the heightmap, so changing it probably works fine...
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.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Excellent news, as the Pandora box was already half opened
Edit: Is it okay to chain both party teleports in the same frame?
Edit: Is it okay to chain both party teleports in the same frame?
Last edited by AndakRainor on Thu Feb 08, 2018 6:53 pm, edited 1 time in total.
Re: Ask a simple question, get a simple answer
I hope it's okay to post this here even though these questions are for LoG 1. I just starting modding and while I'm pretty clear on the basic stuff, there are a few things I'm a little confused about.
1. I found the command for ending the game. I'm assuming I have to write a Lua script that when whatever event occurs, I simply call that command. My question though has to do with how to customize the game ending. I see the syntax says:
completeGame([cinematicsFile])
I found the info for the file type that the cinematic file has to be and downloaded and installed FFmpeg.
However, in addition to the cinematic file, I want to display text similar to the dream sequence texts in LOG 1 but have no clue how to do that in conjunction with the cinematic file where several messages fade in and fade out, controlled by a timer. So any assistance here will be appreciated. Or do I simply incorporate all script animations into the video file itself? I use Camtasia so I assume that will be capable of giving me what I'm looking for.
2. Would like to create a custom item to be found in a chest in order to trigger the completeGame([cinematicsFile]) command. Is this possible? I've gone through the scripting reference page but might have missed something as it's pretty long. In fact, it's massive.
3. Is there an area where custom Lua scripts like the ones I'm looking for already exist? There is no point in reinventing the wheel if it already exists.
That's about it. Everything else I've pretty much figured out and am through 4 levels of my current dungeon. As a former D&D Dungeon Master, this has been very easy for me story wise.
Any assistance that anybody can give and any other suggestions regarding things that I might not have even thought of would be greatly appreciated.
1. I found the command for ending the game. I'm assuming I have to write a Lua script that when whatever event occurs, I simply call that command. My question though has to do with how to customize the game ending. I see the syntax says:
completeGame([cinematicsFile])
I found the info for the file type that the cinematic file has to be and downloaded and installed FFmpeg.
However, in addition to the cinematic file, I want to display text similar to the dream sequence texts in LOG 1 but have no clue how to do that in conjunction with the cinematic file where several messages fade in and fade out, controlled by a timer. So any assistance here will be appreciated. Or do I simply incorporate all script animations into the video file itself? I use Camtasia so I assume that will be capable of giving me what I'm looking for.
2. Would like to create a custom item to be found in a chest in order to trigger the completeGame([cinematicsFile]) command. Is this possible? I've gone through the scripting reference page but might have missed something as it's pretty long. In fact, it's massive.
3. Is there an area where custom Lua scripts like the ones I'm looking for already exist? There is no point in reinventing the wheel if it already exists.
That's about it. Everything else I've pretty much figured out and am through 4 levels of my current dungeon. As a former D&D Dungeon Master, this has been very easy for me story wise.
Any assistance that anybody can give and any other suggestions regarding things that I might not have even thought of would be greatly appreciated.
Re: Ask a simple question, get a simple answer
There is a page on this website, that outlines creating cinematics for LoG1.wagtunes wrote: However, in addition to the cinematic file, I want to display text similar to the dream sequence texts in LOG 1 but have no clue how to do that in conjunction with the cinematic file where several messages fade in and fade out, controlled by a timer. So any assistance here will be appreciated. Or do I simply incorporate all script animations into the video file itself? I use Camtasia so I assume that will be capable of giving me what I'm looking for.
http://www.grimrock.net/modding_log1/ho ... inematics/
You can create a chest that runs the script when opened, or when the item is taken from it—define a new item that runs the script when the party picks it up [via party hook]; or when it is used by them [via item hook].2. Would like to create a custom item to be found in a chest in order to trigger the completeGame([cinematicsFile]) command. Is this possible? I've gone through the scripting reference page but might have missed something as it's pretty long. In fact, it's massive.
Yes there is: viewtopic.php?f=14&t=3099&hilit=useful+scripts3. Is there an area where custom Lua scripts like the ones I'm looking for already exist? There is no point in reinventing the wheel if it already exists.
Re: Ask a simple question, get a simple answer
Thank you. Appreciate it.Isaac wrote:There is a page on this website, that outlines creating cinematics for LoG1.wagtunes wrote: However, in addition to the cinematic file, I want to display text similar to the dream sequence texts in LOG 1 but have no clue how to do that in conjunction with the cinematic file where several messages fade in and fade out, controlled by a timer. So any assistance here will be appreciated. Or do I simply incorporate all script animations into the video file itself? I use Camtasia so I assume that will be capable of giving me what I'm looking for.
http://www.grimrock.net/modding_log1/ho ... inematics/
You can create a chest that runs the script when opened, or when the item is taken from it—define a new item that runs the script when the party picks it up [via party hook]; or when it is used by them [via item hook].2. Would like to create a custom item to be found in a chest in order to trigger the completeGame([cinematicsFile]) command. Is this possible? I've gone through the scripting reference page but might have missed something as it's pretty long. In fact, it's massive.
Yes there is: viewtopic.php?f=14&t=3099&hilit=useful+scripts3. Is there an area where custom Lua scripts like the ones I'm looking for already exist? There is no point in reinventing the wheel if it already exists.
Re: Ask a simple question, get a simple answer
Yep.AndakRainor wrote:Edit: Is it okay to chain both party teleports in the same frame?
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: Ask a simple question, get a simple answer
is that possible to change the music of a level permanently with a command?
Re: Ask a simple question, get a simple answer
Hey all, I was wondering if someone could help me with a scripting question.
I'm having trouble with creating some custom GUI. I don't have any formal experience with Lua.
To get to the point, I have defined a custom onDrawGui hook as follows:
This refers to a script in my dungeon named guiT46, which has this code:
However, this gives an error when I run the dungeon, saying that the font field cannot be found. Any tips as to how I can fix this?
I'm having trouble with creating some custom GUI. I don't have any formal experience with Lua.
To get to the point, I have defined a custom onDrawGui hook as follows:
Code: Select all
onDrawGui = function(self, context)
guiT46.script:guiT46Init(context)
end,
Code: Select all
function guiT46Init(context)
context.font("large")
context.drawText("Test", width/2, height/2)
end
Re: Ask a simple question, get a simple answer
Hey Wrathful,Wrathful wrote: This refers to a script in my dungeon named guiT46, which has this code:However, this gives an error when I run the dungeon, saying that the font field cannot be found. Any tips as to how I can fix this?Code: Select all
function guiT46Init(context) context.font("large") context.drawText("Test", width/2, height/2) end
I usually start any GUI function/script with the following:
SpoilerShow
Code: Select all
function drawChampionInventory(pcomp, context, champion)
------------------------------------
local w, h, r = context.width, context.height, context.width / context.height
local f = (r < 1.3 and 0.8 or r < 1.4 and 0.9 or 1) * context.height/1080
local MX, MY = context.mouseX, context.mouseY
local mLeft, mRight = context.mouseDown(0), context.mouseDown(2)
if Editor.isRunning() and context.keyDown("I") and context.mouseDown(0) then
context.font("large")
context.color(225, 125, 125, 255)
local text = "TEST DRAW TEXT"
-------------------------------
context.drawText(text, w - f * (w / 2 + context.getTextWidth(text)), h - f * h / 2)
end
end
See how you go with that, happy to help with the GUI stuff
Akroma
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)