Page 165 of 400

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 16, 2016 4:57 pm
by THOM
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 16, 2016 7:42 pm
by bongobeat
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 16, 2016 9:40 pm
by Isaac
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

Posted: Wed Nov 16, 2016 11:51 pm
by THOM
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

Posted: Thu Nov 17, 2016 2:12 am
by minmay
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.

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 19, 2016 11:59 am
by Duncan1246
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?

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 19, 2016 6:04 pm
by Isaac
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?
There are other hooks that have the graphic context besides onDrawGUI.

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
		},
		
	},
}
https://github.com/JKos/log2doc/wiki/Ob ... icscontext

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 19, 2016 8:06 pm
by Duncan1246
Isaac wrote:
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?
There are other hooks that have the graphic context besides onDrawGUI.

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
Thanks Isaac! I have just found viewtopic.php?f=22&t=8250#p83546 from J Wordsworth and the JKos site, and I do this:
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
Now, how can I reverse context to close the image?
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)

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 19, 2016 9:28 pm
by Isaac
Duncan1246 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 never encountered this before [before today :shock: ].

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.

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 19, 2016 11:05 pm
by Duncan1246
"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:
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
More important question: how I close the drawn image?