custom image for scroll or note - some help? spell scrolls?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

custom image for scroll or note - some help? spell scrolls?

Post by Komag »

I can't seem to find how this was done in the game. I don't see any obvious images in the asset pack for the spell scrolls showing what runes to use. I thought if I could find that, it might give me some hinds for what I want to do. I tried to search through the script files but found no reference to the gui/scroll_images map images.

I would like to place a note and use a scroll image, but I don't know how to do it
Finished Dungeons - complete mods to play
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: custom image for scroll or note - some help? spell scrol

Post by Decayer »

Code: Select all

defineObject{
	name = "scroll_fireburst",
	class = "Item",
	uiName = "Scroll of Fireburst",
	model = "assets/models/items/scroll_spell.fbx",
	gfxIndex = 113,
	scroll = true,
	spell = "fireburst",
	weight = 0.3,
}
I guess you'd change the model to that of a note and the spell to one of your own making.
Szragodesca
Posts: 59
Joined: Sun Oct 14, 2012 7:13 am

Re: custom image for scroll or note - some help? spell scrol

Post by Szragodesca »

I think what he means is how the game interprets "spell = "fireball"" to display the specific rune combination defined in the spell script. If he could figure out how they do that, he could apply his own images to scrolls.

Is that correct Komag? :?

My guess (makes sense to me) is they either have some sort of layering to it, or one image per rune combination (tons of images) and when the scroll looks up the spell, the spell gives the rune combo, and the rune combo is concatenated onto an image file prefix to return the filename of the image with that rune combination. . .

I bet there's a simpler way though, just hoping scroll displays aren't hardcoded.
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: custom image for scroll or note - some help? spell scrol

Post by Decayer »

I'm thinking that if you have something like this spell definition:

Code: Select all

defineSpell{
	name = "whatever",
	uiName = "Komag's Spell",
	skill = "spellcraft",
	level = 1,
	runes = "E",
	manaCost = 10,
end
in spells.lua, you could put spell = "whatever" in the note's definition and it would work. I haven't tried it, though.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: custom image for scroll or note - some help? spell scrol

Post by Komag »

Szragodesca wrote:I think what he means is how the game interprets "spell = "fireball"" to display the specific rune combination defined in the spell script. If he could figure out how they do that, he could apply his own images to scrolls.

Is that correct Komag? :?

My guess (makes sense to me) is they either have some sort of layering to it, or one image per rune combination (tons of images) and when the scroll looks up the spell, the spell gives the rune combo, and the rune combo is concatenated onto an image file prefix to return the filename of the image with that rune combination. . .

I bet there's a simpler way though, just hoping scroll displays aren't hardcoded.
That's it exactly, I'm not looking to make my own spell scroll, i just want to make a scroll with custom image, like the map for the dismantler crypt.
Finished Dungeons - complete mods to play
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: custom image for scroll or note - some help? spell scrol

Post by Decayer »

There's a setScrollImage(filename) function for items, that sounds like what you want.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: custom image for scroll or note - some help? spell scrol

Post by Komag »

hmm that sounds pretty promising, I'll try it when I have a chance
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: custom image for scroll or note - some help? spell scrol

Post by Komag »

That was it! It works very easily, just place a script near the note or scroll with that line. The "filename" should be the path (starting with "mod_assets/")(and using /, not \) to your custom scroll/note image, which is in proper dds format, but referenced here as being in tga format

Example:

Code: Select all

myScroll1:setScrollImage("mod_assets/textures/gui/scroll_images/supermap.tga")
and you have a supermap.dds file there
Finished Dungeons - complete mods to play
BeNNyBiLL
Posts: 40
Joined: Mon Oct 08, 2012 11:00 pm

Re: custom image for scroll or note - some help? spell scrol

Post by BeNNyBiLL »

Are there any limitations to the dds file as I can't get this to work? I get D3DError - CreateTexture failed. Are there any recommended dimensions I should be using for the image?
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: custom image for scroll or note - some help? spell scrol

Post by Komag »

There are some DDS threads around that help with the formatting (can't remember, but I think I linked to them in the Super Thread), and as far as the size, you can check it compared to the ones in the asset pack
Finished Dungeons - complete mods to play
Post Reply