질문과 답변

Extra Form
종류 플러그인 사용

 

 https://avangs.info/kin/1819133

에서 이어지는 질문입니다(아직도 답이 안나와서...)


일단 플러그인 전문 올려둡니다


 /*:
 *
 * @plugindesc Shows Multiple Messages Simultaneously
 * @author Jake Jilg "mogwai"
 *
 *
 *  When any of these tags are used, the tag will override default Top/Middle/Bottom
 *
 *  Use tags \[top] \[middle] \[bottom] on the same line to show text at the same time.
 * \[bottom]Hello, how are you doing?\[top]¿Hola cómo estás?
 * 
 * Optional tag parameters (only needed on first line) (must be in this order)
 * 
 * \[pos hue:R,G,B] \[top face:FaceName,Index,HueRotate] face hueRotate is optional
 *
 * example \[middle hue:155,0,250 face:People4,2,150]
 *
 * version 0.3
 */

// ------- globals -------

var subWindowLayer;

var messageWindowBottom = {};
var messageWindowMiddle = {};
var messageWindowTop = {};

var simultaneousAquisition = [];

var okGetNum = {
 "bottom": 2,
 "middle": 1,
 "top"   : 0
};

var okGetFace = {
 2 : [],
 1 : [],
 0 : []
};

var okGetTone = {
 2 : [0,0,0],
 1 : [0,0,0],
 0 : [0,0,0]
};

// ------ aliases ----

// create three window children
(function(alias){
 Scene_Base.prototype.createWindowLayer = function() {
  alias.apply(this, arguments);
  var width = Graphics.boxWidth;
  var height = Graphics.boxHeight;
  var x = (Graphics.width - width) / 2;
  var y = (Graphics.height - height) / 2;
  
  subWindowLayer = this._windowLayer;
 };
})(Scene_Base.prototype.createWindowLayer);

// add our two new message window siblings
(function(alias){
 Scene_Map.prototype.createMessageWindow = function() {
  alias.apply(this, arguments);
  
  messageWindowBottom = this._messageWindow;
  messageWindowMiddle = new Window_Message();
  messageWindowTop    = new Window_Message();
  
  // the mainChild is the reactor
  messageWindowBottom._isMainChild = true;
  messageWindowMiddle._isMainChild = false;
  messageWindowTop._isMainChild    = false;
  
  subWindowLayer.addChild(messageWindowTop);
  subWindowLayer.addChild(messageWindowMiddle);
  
  messageWindowBottom._positionType = 2;
  messageWindowMiddle._positionType = 1;
  messageWindowTop._positionType    = 0;
  };  
})(Scene_Map.prototype.createMessageWindow);

// when they clear, we clear too $gameMessage.clear
(function(alias){
 Game_Message.prototype.clear = function() {
  
  alias.apply(this, arguments);
  if(this.positionType() !== undefined)
   simultaneousAquisition = [this.positionType()];
  else
   simultaneousAquisition = [];
  okGetFace = {
   2 : [],
   1 : [],
   0 : []
  };
  okGetTone = {
   2 : [0,0,0],
   1 : [0,0,0],
   0 : [0,0,0]
  };
 };
})(Game_Message.prototype.clear);

// look for sign to simul-text $gameMessage.add
(function(alias){
 Game_Message.prototype.add = function() {
  
  var pe = simultaneousAquisition;
  if(pe.indexOf($gameMessage.positionType()) === -1)
   pe.push($gameMessage.positionType());
  
  arguments[0] = arguments[0].replace(
  /\\\[(top|middle|bottom)( hue:([\d,]+))?( face:([^\]]+))?]/g,
  function(m, tag, m2, hue, m3, face){
   
   $gameMap._interpreter._waitCount += 5;
   
   if(m2 !== undefined){
    var hues = hue.split(",");
    for(var i = 0; i < hues.length; i++){
     hues[i] = parseInt(hues[i]);
    }
    okGetTone[okGetNum[tag]] = hues;
   }
   
   if(m3 !== undefined){
    okGetFace[okGetNum[tag]] = face.split(",");
   }
   
   if(pe.indexOf(okGetNum[tag]) === -1)
    pe.push(okGetNum[tag]);

   // lets hope this string doesn't come up in-game (it's used to parse)
   return "xThIsTx4G03sOn(" + okGetNum[tag] + "):";
   //      ^ sloppy yet functional
  });
  alias.apply(this, arguments);
    };
})(Game_Message.prototype.add);

// when I close, you close... just like that..
(function(alias){
 Window_Message.prototype.close = function() {
  $gameMap._interpreter._waitCount += 5;
  if(this._isMainChild){
   messageWindowMiddle.close();
   messageWindowTop.close();
  }
  alias.apply(this, arguments);
  
  this.isMakeMessage = false;
 };
})(Window_Message.prototype.close);

// when I open, you close... just like that..
(function(alias){
 Window_Message.prototype.open = function(textState) {
  var pe = simultaneousAquisition;
  if(pe.indexOf(this._positionType) !== -1)
   alias.apply(this, arguments);
 };
})(Window_Message.prototype.open);

// I want to look pretty for my window message
(function(alias){
 Window_Message.prototype.updateTone = function() {
  var tone = okGetTone[this._positionType] || [];
  if(tone.length > 0){
   this.setTone(tone[0]||0, tone[1]||0, tone[2]||0);
  }else{
   alias.apply(this, arguments);
  }
 };
})(Window_Message.prototype.updateTone);

// a unique face for a unique monicker
(function(alias){
 Window_Message.prototype.drawFace =function(faceName, faceIndex, x, y, width, height){
  var face = okGetFace[this._positionType];
  
  if(face.length === 0)
   return alias.apply(this, arguments);
  
  var punim = face[0] !== undefined ?
   face[0] : $gameMessage.faceName();
  var faceIndex = face[1] !== undefined ?
   parseInt(face[1]) - 1 : $gameMessage.faceIndex();
  var hue =   face[2] !== undefined ?
   parseInt(face[2]) : 0;
  
  width = width || Window_Base._faceWidth;
  height = height || Window_Base._faceHeight;
  var bitmap = ImageManager.loadFace(punim, hue);
  var pw = Window_Base._faceWidth;
  var ph = Window_Base._faceHeight;
  var sw = Math.min(width, pw);
  var sh = Math.min(height, ph);
  var dx = Math.floor(x + Math.max(width - pw, 0) / 2);
  var dy = Math.floor(y + Math.max(height - ph, 0) / 2);
  var sx = faceIndex % 4 * pw + (pw - sw) / 2;
  var sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
  
  var contents = this.contents;
  bitmap.addLoadListener(function(){
   contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
  });
 };
})(Window_Message.prototype.drawFace);


// ------ overwrites -------

// 3 endings for 1

Window_Message.prototype.updateMessage = function() {

 var top = messageWindowTop._textState || this._textState;
 var mid = messageWindowMiddle._textState || this._textState;;
 var bot = messageWindowBottom._textState || this._textState;;
 
 var pe = simultaneousAquisition;
 if(pe.indexOf(0) === -1)
  mid = this._textState;
 if(pe.indexOf(1) === -1)
  top = this._textState;
 
    if (this._textState) {
        while (!this.isEndOfText(this._textState)) {
            if (this.needsNewPage(this._textState)) {
                this.newPage(this._textState);
            }
            this.updateShowFast();
            this.processCharacter(this._textState);
            if (!this._showFast && !this._lineShowFast) {
                break;
            }
            if (this.pause || this._waitCount > 0) {
                break;
            }
        }
        if (this.isEndOfText(bot) && this.isEndOfText(mid) && this.isEndOfText(top)) {
            this.onEndOfText();
        }
        return true;
    } else {
        return false;
    }
};

// 3 message starts for 1
Window_Message.prototype.startMessage = function() {
 
 var text = $gameMessage.allText();
 if(text.match(/xThIsTx4G03sOn\(\d\):/) !== null){
  var txt = text.split(/xThIsTx4G03sOn/g);
  var text = "";
  for(var i = 0; i < txt.length; i++){
   if(txt[i].charAt(1) === (this._positionType+""))
    text += txt[i].substr(4) + "\n";
  }
  text = text.replace(/\n{2}/g,"\n");
 }
 this.isMakeMessage = true;
 
 if(this._isMainChild){
  if(!messageWindowMiddle.isMakeMessage){
   messageWindowMiddle.pause = false;
   messageWindowMiddle.startMessage();
  }
  if(!messageWindowTop.isMakeMessage){
   messageWindowTop.pause = false;
   messageWindowTop.startMessage();
  }
 }
   
    this._textState = {};
    this._textState.index = 0;
    this._textState.text = this.convertEscapeCharacters(text);
    this.newPage(this._textState);
    this.updatePlacement();
    this.updateBackground();
  this.open();
};

// each window has it's own position type
Window_Message.prototype.updatePlacement = function() {
    //this._positionType = $gameMessage.positionType();
    messageWindowBottom._positionType = 2;
 messageWindowMiddle._positionType = 1;
 messageWindowTop._positionType    = 0;
 
    this.y = this._positionType * (Graphics.boxHeight - this.height) / 2;
    this._goldWindow.y = this.y > 0 ? 0 : Graphics.boxHeight - this._goldWindow.height;
};

// if we move the windows to $gameMessage.positionType(), they overlap
Window_Message.prototype.areSettingsChanged = function() {
    return (this._background !== $gameMessage.background());
            //this._positionType !== $gameMessage.positionType()
};


 

 설명: 메시지 창에 \[top], \[middle],\[bottom]이란 단어를 달면 메시지가 해당 지역으로 이동되어 출력됨(자세한 사항은 링크 참조)


지금껏 발견한 오류(빨간색이 가장 중요, 나머진 중요도 낮음):

1. 창의 위치가 아래가 아니라면 아래윈도우도 같이 나옴(텍스트 입력시 아래도 같은 텍스트)

2. 창의 위치가 같다면 다음 메세지가 바로 나오나 이 플러그인을 켜두면 닫히고 다시 열려 출력됨

3. 모든 커멘드는 창의 위치가 아래에 위치해 있을 때만 제대로 출력됨 창의

만일 창의 위치가 중간이나 위 일때 커멘드를 입력, 예를 들어 "아...\[bottom]아..."(위치는 중간) 이렇게 입력했을 경우

중간 위치의 나와야 될 '아'는 나오지도 않고 아래에서만 '아'가 나옴


제발 이것좀 해결해 주세요 지금 번역기로 겨우 쳐서 포럼에 질문까지 달아봤는데 아무도 관심이 없어요!!!



 

 

 

■ 질문전 필독!
  • 질문할 내용이 이 게시판이나 강좌에 이미 있는지 확인합니다.
  • 하나의 게시물에는 하나의 질문만 합니다.
  • 제목은 질문의 핵심 내용으로 작성합니다.
  • 질문 내용은 답변자가 쉽게 이해할 수 있도록 최대한 상세하게 작성합니다.
  • 스크립트의 전문이 필요할 경우 txt 파일 등으로 첨부해 주시기 바랍니다.
  • 답변받은 게시물은 삭제하지 않습니다.
  • 답변이 완료된 경우 해당 답변해주신 분들께 감사의 댓글을 달아줍니다.
    • 처음 오신 분들은 공지 게시물을 반드시 읽어주세요!

※ 미준수시 사전경고 없이 게시물을 삭제합니다.

Comment '1'
  • ?
    무명시절 2020.07.31 00:36

    2번은 해결 했습니다
    모든 $gameMap._interpreter._waitCount += 5;를 $gameMap._interpreter._waitCount += 0;으로바꿨더니 해결 되더군요
    3번은 안해주셔도 상관 없으니 1번만 어떻게 해주세요!!!


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12387
RMVXA 쯔꾸르창이 전체화면으로 됩니다... 4 마맨 2014.01.11 29505
에러 해결 RMMV NW.js 프로필 오류 해결법 아시는분 있나요? 2 file MSM 2019.03.05 18498
기타 RPG만들기로 만든 게임은 에디트를 사용못하나요? 5 키키두두키 2011.10.09 13475
RMVXA 요즘 혜성 같이 나타난 RPG VX ACE 치트오메틱에 대해서입니다. 1 g223k 2013.04.10 11959
RMVXA RPG VX ACE 에서 조작키 바꾸는 법 3 째워잉 2013.08.17 10801
RMVX RGSS202.dll좀 주실분 2 알피지매니아스 2010.11.14 10514
RMVX RVDATA2 파일은 어떤 프로그램으로 열어야하나요? 2 글쓰니안쓰니 2013.03.28 10132
RMVX rpgvx계 게임을 받았는데 1 하구하구 2010.11.08 9686
RM2k3 2003 그래픽 (캐릭터,몬스터) xp에서도 사용 가능 하나요? 2 마우리 2012.03.20 8895
RMVX 대화창 스킵하는법 6 kaisis 2013.05.06 8720
RMVXA RPG VX ACE 윈도우 7유저의 한글 깨짐 현상. 3 kila233 2012.07.07 8627
RMVX RGSS202E.dll 이 없어요.. 어디서 구하죠? 2 C1님 2011.04.18 8103
RMVX RPGVX 오류(?) 2 『호┠심』군 2010.12.01 8057
RMVXA RPG만들기 VX ACE 이거에서 rgss3a파일 어떻게 열어요? 2 시에마 2013.07.28 7907
한글이 네모로 뜨며 깨집니다.(해결!) 4 file 꺄훌 2012.11.19 7840
기타 rvdata2 확장자는 무슨 제작툴을 쓴건가요? 6 식인곰푸 2014.06.17 7779
RMMV ~~.rpgmvp가 뭔가요? 2 file 무슨상관이라도 2016.08.25 7391
기타 사이트 이용 사운드 소재 란에 있는 사운드/효과음 소재들은 써도 되는 건가요? 2 jojiwell 2019.11.30 7384
RMVX 뱀파이어 액알에서 Die Self Switch A 어떻게 사용하는 건가요? 3 닉네임은2와20 2012.01.16 7268
RMVX 애니메이션 한 프레임당 초가 몇인지 알고싶습니다. 4 톰소여동생 2012.06.29 7181
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 516 Next
/ 516