Page 1 of 2
Images on Scrolls?
Posted: Mon Sep 24, 2012 12:48 am
by Bucnasti
Is there a way to add an image to a scroll? Like the spell scrolls or (if I recall correctly) the map fragments?
I want to add a note to my party when the dungeon starts with a map to the exit of the dungeon.
Re: Images on Scrolls?
Posted: Mon Sep 24, 2012 1:01 am
by Neikun
I'm just gonna go ahead and keep my eye on this thread. lol
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 3:41 am
by Bucnasti
Well I found it in the Scripting reference:
Item:setScrollImage(filename)
Sets custom scroll image to be displayed in the tooltip.
But I can't get it to work. This is my code:
Code: Select all
spawn("note", party.level, party.x, party.y,0):setScrollImage("assets/textures/scroll_images/treasure_map_vault.dds")
but I just keep getting File not found errors. I've tried everything I could think of to reference the texture file and it keeps giving me this error.
Anyone got any ideas?
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 3:48 am
by Edsploration
On the Creating Custom Assets reference page they wrote:we here at Almost Human use .tga as an intermediate format (which we then automatically convert to DDS which the game engine uses) and the formatting of the item definitions follow this convention. To put it simply: keep the file as a .dds but use .tga in its stead in the item definition.
Do you think this could be the issue? I haven't messed with item graphics yet so I'm guessing in the dark a bit.
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 8:45 am
by antti
I tried this out to confirm that it works and it does. I saved a .dds image with an alpha channel and used the following script to set the image in my case:
Code: Select all
imageScroll:setScrollImage("mod_assets/textures/treasure_map.dds")
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 9:25 am
by djoldgames
Bucnasti wrote:Well I found it in the Scripting reference:
But I can't get it to work. This is my code:
Code: Select all
spawn("note", party.level, party.x, party.y,0):setScrollImage("assets/textures/scroll_images/treasure_map_vault.dds")
but I just keep getting File not found errors. I've tried everything I could think of to reference the texture file and it keeps giving me this error.
Anyone got any ideas?
It's working, but it is invalid path to dds file in your code ("gui" directory missing).
Right path in assets is: "assets/textures/gui/scroll_images/treasure_map_vault.dds"
I use the scrolls with my textures with larger dimensions 512x512 and working fine.
Possible problems: If you cannot see any texture (or black square?) you have not set the Alpha channel...
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 9:33 am
by antti
djoldgames wrote:It's working, but it is invalid path to dds file in your code ("gui" directory missing).
Right path in assets is: "assets/textures/gui/scroll_images/treasure_map_vault.dds"
This path is correct in the sense that if you want to refer to pre-existing LoG assets, this is what you should use. But yeah, when using your own assets, the mod_assets is of course the right place.
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 1:25 pm
by Bucnasti
I don't know what I was doing wrong but now this is working:
Code: Select all
spawn("note", party.level, party.x, party.y,2):setScrollImage("mod_assets/textures/scroll_images/map.dds")
Now the next step, I want to put the map in the players hand at the start of the game,
This works just fine:
Code: Select all
party:getChampion(1):insertItem(7,spawn("note"):setScrollText("mod_assets/textures/scroll_images/map.dds"))
but this:
Code: Select all
party:getChampion(1):insertItem(7,spawn("note"):setScrollImage("mod_assets/textures/scroll_images/map.dds"))
gives me the error:
bad argument #2 to 'insertItem' (Item expected, got ???)
Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 1:40 pm
by petri
Try this:
local note = spawn("note")
note:setScrollImage("mod_assets/textures/scroll_images/map.dds")
party:getChampion(1):insertItem(7, note)
Should be a bit easier to read too

Re: Images on Scrolls?
Posted: Tue Sep 25, 2012 1:43 pm
by Montis
You probably set the colons wrong. Can't try myself but I think it could work this way:
Code: Select all
party:getChampion(1):insertItem(7,spawn("note")):setScrollImage("mod_assets/textures/scroll_images/map.dds")