JavaScript:
/*:
* @target MZ
* @plugindesc Plugin para mostrar globos de texto en eventos, el jugador o miembros del grupo.
* @url
* @author RafusGarrafus
*
* @command CustomShowBalloon
* @text Mostrar Globo de Texto
* @desc Muestra un globo de texto en el objetivo especificado con el ID del globo proporcionado.
*
* @arg target
* @text Objetivo
* @type select
* @option Este Evento
* @option Jugador
* @option Primer Seguidor
* @option Segundo Seguidor
* @option Tercer Seguidor
* @desc Selecciona el objetivo para mostrar el globo de texto.
* @default Este Evento
*
* @arg balloonID
* @text Tipo de Globo
* @type select
* @option Exclamación
* @option Interrogación
* @option Nota Musical
* @option Corazón
* @option Enojo
* @option Sudor
* @option Frustración
* @option Silencio
* @option Bombilla
* @option Zzz
* @desc Selecciona el tipo de globo de texto a mostrar.
* @default Exclamación
*
* @arg durationSeconds
* @text Duración (segundos)
* @type number
* @decimals 2
* @min 0.01
* @desc La duración del globo en segundos.
* @default 1.25
*/
(() => {
const pluginName = "CustomShowBalloon";
const commandName = "CustomShowBalloon";
const balloonIDs = {
"Exclamación": 1,
"Interrogación": 2,
"Nota Musical": 3,
"Corazón": 4,
"Enojo": 5,
"Sudor": 6,
"Frustración": 7,
"Silencio": 8,
"Bombilla": 9,
"Zzz": 10
};
PluginManager.registerCommand(pluginName, commandName, args => {
const target = args.target;
const balloonName = args.balloonID;
const balloonID = balloonIDs[balloonName];
const durationSeconds = parseFloat(args.durationSeconds); // Duración del globo en segundos
let eventID;
switch (target) {
case "Este Evento":
eventID = $gameMap._interpreter.eventId().toString();
break;
case "Jugador":
eventID = "player";
break;
case "Primer Seguidor":
eventID = "follower:1";
break;
case "Segundo Seguidor":
eventID = "follower:2";
break;
case "Tercer Seguidor":
eventID = "follower:3";
break;
}
if (eventID !== undefined) {
// Mostrar el globo de inmediato
if (eventID === "player") {
$gameTemp.requestBalloon($gamePlayer, balloonID);
} else if (eventID.startsWith("follower:")) {
const followerIndex = parseInt(eventID.split(":")[1]);
const follower = $gamePlayer.followers().follower(followerIndex - 1);
if (follower) {
$gameTemp.requestBalloon(follower, balloonID);
}
} else {
const event = $gameMap.event(parseInt(eventID));
if (event) {
$gameTemp.requestBalloon(event, balloonID);
}
}
const intervalID = setInterval(() => {
if (eventID === "player") {
$gameTemp.requestBalloon($gamePlayer, balloonID);
} else if (eventID.startsWith("follower:")) {
const followerIndex = parseInt(eventID.split(":")[1]);
const follower = $gamePlayer.followers().follower(followerIndex - 1);
if (follower) {
$gameTemp.requestBalloon(follower, balloonID);
}
} else {
const event = $gameMap.event(parseInt(eventID));
if (event) {
$gameTemp.requestBalloon(event, balloonID);
}
}
}, 1250); // Repetir la animación cada 1250 milisegundos (que es la duración base del globo)
setTimeout(() => {
clearInterval(intervalID);
SceneManager._scene._spriteset.removeAllBalloons(); // Detener todas las animaciones de globo
}, durationSeconds * 1000);
} else {
console.error("Error: No se pudo obtener el ID del evento.");
}
});
})();
He creado este plugin, es muy simple, llamas a un comando de plugin desde un evento o evento comun, configuras tus opciones, y listo, es muy muy simple, pero útil, pero tengo un problema, yo no soy programador y parece que si uso Show Text con el plugin de Visustella no se muestra el globo, mientras que si no llamo a un showtext o si lo llamo desde un proyecto sin el plugin de visustella entonces si funciona
I have created this plugin, it is very simple, you call a plugin command from an event or common event, you configure your options, and that's it, it is very very simple, but useful, but I have a problem, I am not a programmer and it seems that I use Show Text with the Visustella plugin the balloon is not shown, whereas if I don't call a showtext or if I call it from a project without the visustella plugin then it does work
Alguna idea de como compatibilizarlo? podeis comentar mejoras que pueda hacer y vere si soy capaz de ello, podeis descargarlo para usarlo en vuestros proyectos si os es util
Any idea how to make it compatible? You can comment on improvements that I can make and I will see if I am capable of it, you can download it to use it in your projects if it is useful to you
No me e presentado, soy nuevo en el foro, llamadme Rafus la mayoria de mis trabajos estarán en castellano y los traducire poco a poco al ingles, tratare de postear en ambos idiomas, no soy programador, solo un fan, asique mis trabajos no estaran muy pulidos, pero siempre estoy encantado de aprender, grarcias por dejarme forrmar parte de esta comunidad.
Muchas de las traducciones al ingles las haré con google transalate en mis posts, por ahorrar tiempo, solo por avisar que alomejor esta escrito raro.
I have not introduced myself, I am new to the forum, call me Rafus, most of my works will be in Spanish and I will translate them little by little into English, I will try to post in both languages, I am not a programmer, just a fan, so my works will not be very polished, but I am always happy to learn, thank you for letting me be part of this community.
I will do many of the translations into English with Google Transalate in my posts, to save time, just to warn you that maybe it is written strangely.