질문과 답변

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 인게임 정보창을 제거하고 싶습니다. 5 겐마 2020.08.19 121
기타 RMMV 직접 만든 애니메이션 적용시 배율에 따른 화질 문제 file 깡토 2020.08.18 95
기타 RMMV 특정스탯이 되면 죽은것으로 처리하고 싶습니다. 2 JDG 2020.08.18 50
맵배치 RMMV 타일셋 이미지 개수 늘리거나 속성 바꾸는거 안되나요? 소용돌이은하에서사는자 2020.08.18 88
맵배치 RMMV rpg mv 새로운 타일맵 추가가 안됩낟 1 소용돌이은하에서사는자 2020.08.17 104
이벤트 작성 RMMV 영상 연속재생 쿨타임 hurakan 2020.08.11 30
맵배치 RMMV mv 맵칩 타일셋 리소스 사이트있나요? 소용돌이은하에서사는자 2020.08.11 185
이벤트 작성 RMMV 텍스트가 출력될때 중간에 끊어버리는 방법이 있나요? 2 송실용 2020.08.11 76
이벤트 작성 RMMV 무비를 반복재생 하고싶습니다 2 hurakan 2020.08.09 150
에러 해결 RMMV 메뉴창 플러그인 에러가 났습니다 송실용 2020.08.09 67
기타 RMMV 전투에서 싸우는 아군을 5명 이상으로 하고싶습니다아. 2 레기우스州 2020.08.09 60
에러 해결 RMMV faild to loading: img 뜨면 어떻게 하나요 폭광 2020.08.09 57
이벤트 작성 RMMV 이벤트도중 이벤트의 이미지를 변경하고 싶습니다. 2 도Vㅏ킨 2020.08.04 320
에러 해결 RMMV 누가 이 게임 아이콘 버그좀 알려주세요 2 file 호구랑 2020.08.03 1030
이벤트 작성 RMMV 알만툴 기능 중에 세이브 데이터를 강제적으로 삭제시키는 기능같은게 있나요? 1 당백전 2020.08.02 208
플러그인 사용 RMMV 플러그인 내 글자 줄바꿈 적용 초코동 2020.08.01 224
스크립트 작성 RMMV MV에서 키보드 이동을 금지시키려면 어떻게 하면 좋을까요? 2 버섯론 2020.07.30 314
플러그인 사용 RMMV 동시 메시지 플러그인 오류 해결법 1 무명시절 2020.07.23 179
이벤트 작성 RMMV 옵션 스크립트 1 hurakan 2020.07.19 183
라이선스 RMMV made with mv는 어떨때 사용하는건가요? 3 Hoodie42 2020.07.18 188
Board Pagination Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ... 82 Next
/ 82