Page 1 of 1

help: enter bigger icon graphics

Posted: Wed May 07, 2008 5:42 pm
by zoom
to use a bigger icon like say the axe

1. where do we enter this line?

Code: Select all

gfx.axe_big_icon = dsb_get_bitmap("BIG_AXE_ICON")
startup.lua looks like this :

Code: Select all

function default_exports()
	dsb_export("g_last_party_move")
	dsb_export("g_last_monster_attack")
	dsb_export("g_rclock")
	dsb_export("g_illum")
	dsb_export("g_footprint_counter")
	dsb_export("g_disabled_runes")
end

function test_function()
	dsb_write(debug_color, "TEST")
end

-- Deprecated functions that will still be supported for now
function dsb_rune_enable(rune)
	g_disabled_runes[rune] = false
end

function dsb_rune_disable(rune)
	g_disabled_runes[rune] = true
end

global_startup()
default_exports()

2. in objects.lua we need to enter:

Code: Select all

obj.axe.icon = gfx.axe_big_icon
but where in this entry (objects.lua) ??

Code: Select all

obj.axe = {
	name="AXE",
	type="THING",
	class="WEAPON",
	mass=43,
	icon=gfx.icons[42],
	dungeon=gfx.axe,
	flying_away=gfx.axe_flying,
	flying_toward=gfx.axe_flying,
	flying_side=gfx.axe_flying_side,		
	methods = {
	    { "SWING", 0, CLASS_FIGHTER, method_physattack },
	    { "CHOP", 0, CLASS_FIGHTER, method_physattack },
	    { "MELEE", 5, CLASS_FIGHTER, method_physattack }
	},
	
	ninja_bonus=true,
	base_range=10,
	base_tpower=49,
	impact=33,
	fit_sheath=true,
	hit_sound=snd.dink
}
the graphic could be :
256 colors, 24bit
for animated
use 32bit with alpha if you used a .tga

3. where, in the dsb folder,
do we save an alternate icon graphic file
(BIG_AXE_ICON.bmp, or BIG_AXE_ICON.tga?)
There are no bitmaps anywhere to be found

Posted: Wed May 07, 2008 5:57 pm
by Sophia
Your additions go in your own dungeon's startup.lua and objects.lua, not in the base files. Your custom graphics get saved in your own dungeon's folder, too. Take a look at the test_dungeon as an example of where to put some bitmaps.

Posted: Wed May 07, 2008 7:13 pm
by Parallax
you should make a copy of obj.axe in your own objects.lua file (in your custom dungeon's directory, not in /base) and replace the line

Code: Select all

  icon=gfx.icons[42],
with

Code: Select all

  icon = gfx.axe_big_icon, 
And the graphics file declaration should go into your own startup.lua file, in your own custom dungeon directory. If you declare it as

Code: Select all

gfx.axe_big_icon = dsb_get_bitmap("BIG_AXE_ICON") 
then the graphics file should be in that very directory. If you have a lot of custom graphics, you can specify a path, though. For instance:

Code: Select all

gfx.axe_big_icon = dsb_get_bitmap("../../DSB_CUSTOM/GRAPHICS/ITEMS/WEAPONS/AXE/BIG_AXE_ICON") 
and dsb_get_bitmap will follow that path.

Posted: Fri May 09, 2008 4:06 pm
by zoom
ahh,thanks.
I will try again ;)

edit> I tried again, and successfully changed
a moneybox into an axe. You have to get
used to having more colours and higher
resolution.. I realized it is not easy to make
nice graphics.. any tips ?
I thought about scanning drawings
into the computer,
colouring them and then reduce the
size to 32x32...
oh well..
another way would be pixel pushing, without
drawing on paper but straight into the pc.
not easy. not easy at all.
And I guess you have to be in the mood