Eye/Mouth graphics not changing

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Eye/Mouth graphics not changing

Post by Kesa »

Hi been a while, pc crashed lost everything including the fix to this problem.

So I did this... in the graphics.lua, oddly enough the mouth chewing works then changes the image to the new one upon eating...weird.

Code: Select all

base_mouth_icon = dsb_get_bitmap("NEW_MOUTH")
gfx.mouth_chewing = dsb_get_bitmap("NEW_MOUTH_CHEWING")
dsb_animate(gfx.mouth_chewing, 4, 3)
gfx.icons[202] = dsb_get_bitmap("NEW_EYE_FRONT")
gfx.icons[203] = dsb_get_bitmap("NEW_EYE_SIDE")
I checked the codes in base inventory_info.lua and idk the codes match just fine. Wish I remembered what it was Sophia helped me with that time long ago...
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Eye/Mouth graphics not changing

Post by Sophia »

I'm sorry to hear about that. :( Welcome back though. :)

You have to assert your changes into the inventory_info table. Your image was loaded after the table was created, and because of the way Lua references work, it's still using the old one. (I created inventory_info well after I had set up the whole base_mouth_icon thing, so it is kind of ugly)

Anyway, try it this way:

Code: Select all

base_mouth_icon = dsb_get_bitmap("NEW_MOUTH")
gfx.mouth_chewing = dsb_get_bitmap("NEW_MOUTH_CHEWING")
dsb_animate(gfx.mouth_chewing, 4, 3)
gfx.new_eye_front = dsb_get_bitmap("NEW_EYE_FRONT")
gfx.new_eye_side = dsb_get_bitmap("NEW_EYE_SIDE")

inventory_info.eye.icon = gfx.new_eye_front
inventory_info.eye.look_icon = gfx.new_eye_side
inventory_info.mouth.icon = base_mouth_icon
User avatar
Kesa
Journeyman
Posts: 67
Joined: Fri Sep 10, 2010 11:44 pm

Re: Eye/Mouth graphics not changing

Post by Kesa »

Thank you Thank you ^.^ worked like a charm
Post Reply