Page 1 of 1

Eye/Mouth graphics not changing

Posted: Sun Oct 02, 2011 2:40 pm
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...

Re: Eye/Mouth graphics not changing

Posted: Sun Oct 02, 2011 9:00 pm
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

Re: Eye/Mouth graphics not changing

Posted: Sun Oct 02, 2011 9:12 pm
by Kesa
Thank you Thank you ^.^ worked like a charm