Jump to content

Changing Media for Character/Item


Recommended Posts

I'm building my first Wherigo with Earwigo and I have the need during my story to change the picture of an NPC.


This isn't exactly the scenario I am using but gets the point across:

The Earwigo wiki suggested creating an empty media entry along with two media listings that included pictures, then using something like zmediaHero = zmediaHeroBearded and zmediaHero = zmediaHeroShaven to switch between the two.


I have tried this method, setting my Hero's media as zmediaHero. When the cartridge starts I have Lua statement zmediaHero = zmediaHeroBearded

For good measure, when you enter the zone that sets the Hero as visible, I run that same lua statement once again.

Then when the appropriate item/action is taken, I have Lua statement zmediaHero = zmediaHeroShaven and I also change the name of Hero to Shaven Hero.


In the Builder Emulator and on WhereYouGo, I never see a picture for Hero. So, I must be missing something basic. Any suggestions?


If this fails, I'll go back to my original, messy plan of having two characters named Hero and Shaven Hero and just swapping between the two when necessary.

Link to comment


you apparently didn't finish reading the wiki article ;e) after explaining this trick, it goes on to say:

This way all references in Messages and Dialogs will pick up the right Media object.


You still have to change Media properties of items/characters where you use this media, because they're already assigned at that point in the script



IOW, this only works on media that you show through Messages or Dialogs. If you want to change the media for items, zones, tasks and other object, you need to do it "the usual way", by assigning to the Media property:

Set Value Character:Hero:Media => zmediaHeroShaven

Link to comment

The point being that zmediaHero is just a variable, not a magic "hook". So assigning a new media object to is doesn't automagically change the image associated with a character whose media was set to "zmediaHero". There's no implicit level of indirection. (With Messages and Dialogs, there is, because each call to output a Message or Dialog evaluates "zmediaHero" at that point.)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...