질문과 답변

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
플러그인 사용 RMMV SuperToolsEngine 플러그인이 적용이 안되요 4 file 서하쨩 2024.02.21 27
플러그인 사용 RMMV 대사가 한글자 씩 출력될 때마다 소리가 나게 어떻게 하나요? 2 참치캔통 2024.02.21 64
이벤트 작성 RMMV 아이템을 사용하면 숙소로 복귀하는 이벤트 5 file pokapoka 2024.02.19 30
이벤트 작성 RMMV 보트가 움직여지지 않습니다. 3 file pokapoka 2024.02.19 14
이벤트 작성 RMMV 텍스트의 위치 및 행렬을 옮기고 싶습니다 참치캔통 2024.02.11 55
이벤트 작성 RMMZ 일반 이벤트가 두번 이상 확인해야 진행됩니다. 1 file blahdi 2024.02.11 28
스크립트 추천 RMVXA 변수를 화면에 띄우고 싶습니다. 1 홍홍이1 2024.02.09 29
기타 RMVXA 원샷같은 시스템 메세지창 띄우기 2 file 외눈요리 2024.02.09 58
턴제 전투 RMMV 턴제전투에서 스킥 선택창 어떻게 만드나요 1 ekdtbd 2024.02.08 23
스크립트 사용 RMMV 마우스 좌클로 맵 이동 막는 방법 질문 4 알만툴조아용 2024.02.08 31
기타 RMMZ 그림을 클릭하면 이벤트 발생 1 Sian 2024.02.07 21
스크립트 추천 RMVXA 미니게임을 하는동안 위에 점수판을 띄워주고싶은데 방법이 없을까요? 홍홍이1 2024.02.07 15
기본툴 사용법 RMMV 메세지에서 %1, %2, %3은 무엇을 나타내는 건가요? 2 file pokapoka 2024.02.05 27
기타 RMMV 도트를 그리고 다음 툴에 적용했는데 너무 커요 1 file 알송 2024.02.02 40
에러 해결 RMXP BGM을 발견못하는 오류 file wombat 2024.01.31 19
게임 번역 RMMV 게임 한글패치 자동으로 번역하는게 아니라 수동으로 번역하고 싶어요 알초자 2024.01.30 25
한글 패치 RM2k RM2k의 스팀 한글패치 다크크리에이터 2024.01.27 22
플러그인 추천 RMMV 타이틀의 그림이 움직이게 하는법을 알려주세요 1 file 알초자 2024.01.27 74
이벤트 작성 RMMV 이벤트 위치 설정에 관하여 1 pokapoka 2024.01.25 26
이벤트 작성 RMMZ 자동실행 관련 질문 3 Sian 2024.01.20 53
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