Page 395 of 396

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 28, 2024 1:59 am
by KhrougH
i did it :D

Code: Select all

function connectBreakables()
    local objects = Dungeon.getMap(self.go.level):allEntities()
	for obj in objects do
		local oggetto = findEntity(obj.id)
		if oggetto.obstacle and oggetto.health and oggetto.health:getConnectorCount() < 1 then 
			print("oggetto: "..oggetto.id)
            oggetto.health:addConnector("onDie", self.go.id, "spannatorcia")
        end
    end
end

function spannatorcia(oggetto)
    if oggetto then
        local OG = oggetto.go
        oggetto.go:spawn("torch", OG.x, OG.y, OG.facing, OG.elevation)
    end
end
after some test and imprecations i finally found the way :P

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 28, 2024 6:10 am
by Isaac
KhrougH wrote: Sat Sep 28, 2024 1:59 am

Code: Select all

if oggetto.obstacle and oggetto.health and oggetto.health:getConnectorCount() < 1 then 
Should be: [My mistake for not including it earlier.]

Code: Select all

if oggetto and oggetto.obstacle and oggetto.health and oggetto.health:getConnectorCount() < 1 then 
The reason being that if findEntity(obj.id) ever returns as nil then calling the oggetto object will cause a crash.

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 28, 2024 8:59 am
by KhrougH
right. better! :D

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 28, 2024 9:06 am
by KhrougH
where are files where i can take or modify images like "editorIcon" or "gfxIndex"?
i can't find files who contains these references

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 28, 2024 10:12 am
by Isaac
KhrougH wrote: Sat Sep 28, 2024 9:06 am where are files where i can take or modify images like "editorIcon" or "gfxIndex"?
i can't find files who contains these references
For the editor icons, it requires editing the grimrock2.dat file.
For gfxIndex, they use the three item image atlases found in \assets\textures\gui. [items.dds, items_2.dds, items_3.dds ]

Re: Ask a simple question, get a simple answer

Posted: Sun Sep 29, 2024 10:59 pm
by DaggorathMaster
For gfxIndex, in the definition files you can add:
'gfxAtlas = "mod_assets/textures/atlas/<user_atlas_1>.tga,"'
'gfxIndex = (#),'
To individual game object definitions.

(user_atlas_1, or whatever your own files are named).
Then you can keep the default icons for most things, and add your own for new/changed entities.

The atlas image needs to be exported as dds, BC3 / DXT5 (which gives decent transparency).
GIMP has a free downloadable exporter for that.
No mipmaps needed for the atlas.
The file you save is .dds, but for some reason the game looks for it with a .tga extension.

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 10, 2024 9:08 pm
by KhrougH
DaggorathMaster wrote: Sun Sep 29, 2024 10:59 pm For gfxIndex, in the definition files you can add:
'gfxAtlas = "mod_assets/textures/atlas/<user_atlas_1>.tga,"'
'gfxIndex = (#),'
To individual game object definitions.

(user_atlas_1, or whatever your own files are named).
Then you can keep the default icons for most things, and add your own for new/changed entities.

The atlas image needs to be exported as dds, BC3 / DXT5 (which gives decent transparency).
GIMP has a free downloadable exporter for that.
No mipmaps needed for the atlas.
The file you save is .dds, but for some reason the game looks for it with a .tga extension.
what about 'tiles' icons?

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 10, 2024 9:22 pm
by KhrougH
DaggorathMaster wrote: Sun Sep 29, 2024 10:59 pm The atlas image needs to be exported as dds, BC3 / DXT5 (which gives decent transparency).
GIMP has a free downloadable exporter for that.
last version of GIMP has this exporter already integrated.

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 11, 2024 1:26 am
by Isaac
@KhrougH

Do you have the LoG2 asset pack installed? This gives you nearly all of the scripts and textures of the game, including monsters and some UI elements; atlas textures.

You can use or substitute these in your own scripts and asset definitions.

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 19, 2024 2:07 am
by ChaosLord316
Isaac wrote: Fri Oct 11, 2024 1:26 am
Do you have the LoG2 asset pack installed? This gives you nearly all of the scripts and textures of the game, including monsters and some UI elements; atlas textures.

You can use or substitute these in your own scripts and asset definitions.
Hello, Isaac. I'm a big fan of all the help you do around here, and your "tomb wall fix" was instrumental in making my dungeon that I just released.

I think I ask for a couple people when I ask, where and how would one go about getting and installing the LoGII Asset Pack in 2024? I've tried the links here, but they don't seem to work for me. Any help with this would be greatly appreciated. Thank you.