I have made a (maybe a bit too) complex system where player can talk to multiple NPCs, and their response can depend on multiple variables. Easiest way to archive this is make a common event that is called from each NPC, that calculates the possible response and shows it, along with possible choices and responses to those. Just set the desired NPC face on the variable and then call common event.
But since I don't want to make a huge mess of conditional branches in the common event, I would like to know if it is possible to change displayed face in the text window with a script?
I tried to search this and saw couple of answers (including master script list) but all those links were dead. Or my GoogleFu was not strong enough. Again.
Edit: Yes, my GoogleFy failed me again. Found an answer.
$game_message.face_name = "People1"
$game_message.face_index = 1
Since I'm using Advance Text System 3.0c I added feature there that can take face_name and face_index as a parameter and I got it work find.
Then I started to add feature that could check the current event page if there is suitable information which face to draw. And no I have another problem:
elsif @text.sub! (/\A\xb3/,"") != nil #Try to get the face from current event
event = $game_map.events[@event_id]
if event != nil #yes, event is nil, it seem that I can't get current event.
$game_message.face_name = event.page.graphic.character_name
$game_message.face_index = event.page.graphic.character_index
Somehow event is always nil. What I am doing wrong?
Nevermind, got it work.
This post has been edited by Ramia: Mar 27 2012, 07:43 PM