I'm trying to make a plugin that reads dialogue from another file and excecute the right commands.
i know some of it can just be done in the in-game editor, but i want to have my events more organised as well as have pictures of the characters pop up on screen, which is done alongside the text printing. each with multiple possible versions and such.
i think i mainly got it for just text, but I also want to use movementroute in the scene's so the few large one's aside, it would be usseless if i had to break up the scene for every minor movement like just 1 'face up' or such. I would end up with minimal 5 scene object in one actual scene. and if i try to do some by editor to avoid that i would end up doing half of it in game anyway.
the problem is that the entire list of commands starts right from the start.
in the example i use for testing, this is the array/list
text1
text2
movementroute
text3
i can load them seperately. i get the actual text on a new page and wait for player input for the texts. But even though the movement route is 3th in line, it starts the moment i get to see the 1st text message.
and i can also watch the 3th text even though movement should be on wait for completion.
here is part of the code. an self made class DialogueManager manages all functions and holds the dialogue data.
and here is the part for the movement route.
here is the actual scene object that i use as my test. though tecnichly it's more of an array.
the Sai V2 and Ema V2 names are names of pictures, one for body and other for face. the 0 or 1 after that is their position, determines their x value. they seem to work, except that just like movement route it al loads from the start so the images have the position of the last command 'test3'.
i know some of it can just be done in the in-game editor, but i want to have my events more organised as well as have pictures of the characters pop up on screen, which is done alongside the text printing. each with multiple possible versions and such.
i think i mainly got it for just text, but I also want to use movementroute in the scene's so the few large one's aside, it would be usseless if i had to break up the scene for every minor movement like just 1 'face up' or such. I would end up with minimal 5 scene object in one actual scene. and if i try to do some by editor to avoid that i would end up doing half of it in game anyway.
the problem is that the entire list of commands starts right from the start.
in the example i use for testing, this is the array/list
text1
text2
movementroute
text3
i can load them seperately. i get the actual text on a new page and wait for player input for the texts. But even though the movement route is 3th in line, it starts the moment i get to see the 1st text message.
and i can also watch the 3th text even though movement should be on wait for completion.
here is part of the code. an self made class DialogueManager manages all functions and holds the dialogue data.
DialogueManager.ReadScene = function(Chapter, Type, Id){
scene = $gameSystem._Dialogue[Chapter][Type][Id];
// scene holds an array with each element an action, this element is another array with needed info.
for (var i = 0; i < scene.length; i++) { // for each line in the scene.
var line = scene[i];
switch(line[0]){
case 0: // message
DialogueManager.ReadTypePicture(line[2],line[3],line[4]) //shows character pictures
$gameMessage.add(line[1]);
$gameMessage.newPage();
$gameMap._interpreter.setWaitMode('message');
break;
case 1: // movement route
DialogueManager.ReadTypeMovementRoute(line[1],line[2],line[3])
break;
}
}
};
and here is the part for the movement route.
DialogueManager.ReadTypeMovementRoute = function(target,listNames,params){// [1,target,list,params] // params: [wait for complete, repeat, skippable]
var id = DialogueManager.findEventByName(target); // get event id.
var list = [];
//listNames : [["moveup"],["comand with param",[the params]],["end"]] example listnames array, needed to hold params together with comand
for (var p = 0; p < listNames.length; p++) { // making list of commands
list.push({ code: DialogueManager.GetCommand(listNames[p][0]), parameters: listNames[p][1] }); // parameters is just an array in tight order.
}
var route = {list:list, repeat:params[1], skippable:params[2]}; // making route obj
if(id = -1){
$gameMap._interpreter._character = $gamePlayer
$gamePlayer.forceMoveRoute(route); // giving list away
} else {
$gameMap._interpreter._character = $gameMap.event(id)
$gameMap.event(id).forceMoveRoute(route); // giving list away
}
if(params[0] == true) $gameMap._interpreter.setWaitMode("route");
}
here is the actual scene object that i use as my test. though tecnichly it's more of an array.
[0,"test1","Sai V2","Ema V2",0],
[0,"test2","Sai V2","Ema V2",1],
[1,-1,[["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_MOVE_DOWN"],
["ROUTE_TURN_UP"],
["ROUTE_END"]],[true,false,false]],
[0,"test3","Sai V2","Ema V2",0],
the Sai V2 and Ema V2 names are names of pictures, one for body and other for face. the 0 or 1 after that is their position, determines their x value. they seem to work, except that just like movement route it al loads from the start so the images have the position of the last command 'test3'.