+Novac Posted June 3, 2012 Share Posted June 3, 2012 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. Quote Link to comment
matejcik Posted June 3, 2012 Share Posted June 3, 2012 hello, 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 ;e) 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 Quote Link to comment
+sTeamTraen Posted June 4, 2012 Share Posted June 4, 2012 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.) Quote Link to comment
+Novac Posted June 4, 2012 Author Share Posted June 4, 2012 OK, clearly I was hoping to use it as a hook. I'll just use my messier method. Thanks for the clarification! Quote Link to comment
Recommended Posts
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.