Page 1 of 2

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

Posted: Sat Oct 20, 2012 5:06 pm
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

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

Posted: Sat Oct 20, 2012 5:44 pm
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.

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

Posted: Sat Oct 20, 2012 5:49 pm
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.

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

Posted: Sat Oct 20, 2012 6:14 pm
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.

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

Posted: Sat Oct 20, 2012 8:41 pm
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.

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

Posted: Sat Oct 20, 2012 8:53 pm
by Decayer
There's a setScrollImage(filename) function for items, that sounds like what you want.

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

Posted: Sat Oct 20, 2012 10:38 pm
by Komag
hmm that sounds pretty promising, I'll try it when I have a chance

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

Posted: Sun Oct 21, 2012 1:00 am
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

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

Posted: Tue Oct 23, 2012 8:16 pm
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?

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

Posted: Tue Oct 23, 2012 8:22 pm
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