Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
But I think especially the mine tileset hasn't that problem Isaac is mentioning.
But try out what is possible if you add a heightmapMaterial to the Tileset definition.
But try out what is possible if you add a heightmapMaterial to the Tileset definition.
Re: Ask a simple question, get a simple answer
I m wondering about epic items count: I want to upgrade a few epic items (parts of an armor set) with crafting, but whatabout the epic items counter in the statistics?
Will it be unrecommanded if I detroy an epic items, and make a new one?
I plan to upgrade 3 or 4 times each pieces of the armor set.
Will it be unrecommanded if I detroy an epic items, and make a new one?
I plan to upgrade 3 or 4 times each pieces of the armor set.
Re: Ask a simple question, get a simple answer
Is there a published list of those statistic names? I can only find the few from Grimrock 1.
Re: Ask a simple question, get a simple answer
bongobeat wrote:I m wondering about epic items count: I want to upgrade a few epic items (parts of an armor set) with crafting, but whatabout the epic items counter in the statistics?
Will it be unrecommanded if I detroy an epic items, and make a new one?
I plan to upgrade 3 or 4 times each pieces of the armor set.
AFAIK every item, which is defined for the game with traits = { "epic" }, will be in count of the epic item statistic. So, yes: If you remove this item from the item definition file it will not be in count.
Re: Ask a simple question, get a simple answer
Epic items are counted when the dungeon begins to get the maximum number. If this count is incorrect because you want to spawn an additional epic item, you can just use GameMode.setMaxStatistic() to fix it.
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.
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
I have seen here and there that the only way to call GraphicContexts.DrawText() or DrawImage() is to use onDrawGui party hook (with fw hooks). But I don't see any example of use for now. Any lead or example to follow?
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
Re: Ask a simple question, get a simple answer
There are other hooks that have the graphic context besides onDrawGUI.Duncan1246 wrote:I have seen here and there that the only way to call GraphicContexts.DrawText() or DrawImage() is to use onDrawGui party hook (with fw hooks). But I don't see any example of use for now. Any lead or example to follow?
The example is the same one for any party hook. What's important are the arguments available to the hook. You use the context object for the graphics functions
Code: Select all
--[[ Other hooks with context
PartyComponent.onDrawAttackPanel(self, champion, context, x, y) Beta 2.2.4
PartyComponent.onDrawGui(self, context)
PartyComponent.onDrawInventory(self, context, champion)
PartyComponent.onDrawStats(self, context, champion)
PartyComponent.onDrawSkills(self, context, champion)
PartyComponent.onDrawTraits(self, context, champion)
--]]
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onDrawAttackPanel = function(self, champion, context, x, y)
local text = tostring(GameMode.getStatistic("play_time"))
local text3 = "Game Playtime:"
local offset = (context.width - (context.width/#text3))*.5 --quick centering on-screen
context.font("large") --Set Font size ; ("tiny", "small", "medium", "large")
--GraphicsContext.drawText(text, x, y)
if champion:getOrdinal() == 2 then
local text2 = champion:getName().." Health: "..champion:getHealth()
context.drawText(text2, offset, context.height/2.14)
end
context.drawText(text3, offset, context.height/2.07)
context.drawText(text, offset, context.height/2)
end
},
},
}
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
Thanks Isaac! I have just found viewtopic.php?f=22&t=8250#p83546 from J Wordsworth and the JKos site, and I do this:Isaac wrote:There are other hooks that have the graphic context besides onDrawGUI.Duncan1246 wrote:I have seen here and there that the only way to call GraphicContexts.DrawText() or DrawImage() is to use onDrawGui party hook (with fw hooks). But I don't see any example of use for now. Any lead or example to follow?
The example is the same one for any party hook. What's important are the arguments available to the hook. You use the context object for the graphics functions
SpoilerShow
Code: Select all
party.party:addConnector("onDrawGui", self.go.id, "newsheet")
function newsheet()
textlist()
context.drawImage2("mod_assets/textures/dc_octog3_panel.tga",5,5,0,0,1024, 693, 2550, 1430) --------------------------------------------to be modified with context width and height
context.drawRect(90, 890, 90, 30) --------------------------------------------to be modified with context width and height
context.color(0,0,0,255)
context.drawText("CLOSE", 100, 910)
if ( context.button("CLOSE", 100, 900, 90, 90) ) then
print("CLOSED")
end
context.font("large")
local width = context.width
context.drawParagraph(bufferpage, 100,200,width-100)
end
And something bad is happening when I test it in the editor: the command to toggle fullscreen don't work anymore after the image is drown and the editor become irresponsive... Image size is involved, I suppose? (issue is linked to the keyboard key, I can still close the project but using this key causes crash)
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
Re: Ask a simple question, get a simple answer
I've never encountered this before [before todayDuncan1246 wrote:And something bad is happening when I test it in the editor: the command to toggle fullscreen don't work anymore after the image is drown and the editor become irresponsive... Image size is involved, I suppose? (issue is linked to the keyboard key, I can still close the project but using this key causes crash)

I've since found out that one of my own projects that uses showImage(), hangs the editor if the 'Esc' key is pressed during the slideshow. But this doesn't happen in the regular game... So it might be a bug in the editor. Normally (in the game) the Esc key displays the game menu, but in the editor it instead exits fullscreen in the preview.
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
"So it might be a bug in the editor. Normally (in the game) the Esc key displays the game menu, but in the editor it instead exits fullscreen in the preview."
I hope so! But it happens only when I use the context commands.
Here is the script at this point:
More important question: how I close the drawn image?
I hope so! But it happens only when I use the context commands.
Here is the script at this point:
SpoilerShow
Code: Select all
function newsheet(self, context)
textlist()
local width = context.width
local height = context.height
local offset = context.width * .1
context.drawImage2("mod_assets/textures/dc_octog4_panel.tga",5,5,0,0,640, 480, width, height)
context.drawRect(offset, (0.8 * height), 90, 30)
context.color(0,0,0,255)
context.drawText("CLOSE", offset+10, (0.8 * height)+20)
if ( context.button("CLOSE", offset+10, (0.8 * height)+10, 90, 90) ) then
print("CLOSED")
party.party:removeConnector("onDrawGui", self.go.id, "newsheet")
end
context.font("large")
context.drawParagraph(bufferpage, offset, context.height*.1, width*.8)
end
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?