Images on Scrolls?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Bucnasti
Posts: 22
Joined: Mon Sep 24, 2012 12:41 am

Images on Scrolls?

Post 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.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Images on Scrolls?

Post by Neikun »

I'm just gonna go ahead and keep my eye on this thread. lol
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Bucnasti
Posts: 22
Joined: Mon Sep 24, 2012 12:41 am

Re: Images on Scrolls?

Post 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?
User avatar
Edsploration
Posts: 104
Joined: Wed Sep 19, 2012 4:32 pm

Re: Images on Scrolls?

Post 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.
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Images on Scrolls?

Post 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")
Steven Seagal of gaming industry
User avatar
djoldgames
Posts: 107
Joined: Fri Mar 23, 2012 11:28 pm
Contact:

Re: Images on Scrolls?

Post 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...
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Images on Scrolls?

Post 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.
Steven Seagal of gaming industry
Bucnasti
Posts: 22
Joined: Mon Sep 24, 2012 12:41 am

Re: Images on Scrolls?

Post 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 ???)
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Images on Scrolls?

Post 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 :)
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Images on Scrolls?

Post 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")
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Post Reply