iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> [CLOSED] Change Face in text window with script?
Ramia
post Mar 25 2012, 01:31 PM
Post #1



Group Icon


Type: Coder




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.

Short answer
CODE
$game_message.face_name = "People1"
$game_message.face_index = 1
$game_message.texts.push("Hello world")


Long answer:

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:

CODE
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
end
end


Somehow event is always nil. What I am doing wrong?

Edit:
Nevermind, got it work.

This post has been edited by Ramia: Mar 27 2012, 07:43 PM
Go to the top of the page
 
+Quote Post
   

Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th July 2014 - 08:50 PM

RPGMakerVX.net is an Privacy Policy, Legal.