- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 11:29
Alors voila j'aimerais utiliser ce script qui existait sur Ace et qui fonctionnait parfaitement.
Ce plugin permet d'avoir un nombre infini de self switch dans un event à la place de ceux connus (A,B,C et D).
Voici le plugin en question :
Le problème avec celui-ci c'est que si je créé deux pages la commande de module " SelfSwitch page2 true" active bien la page 2 mais si je désactive cette page sur la page 2 (SelfSwitch page2 false) il ne revient pas à la page 1.
Voici deux screens pour que se soit plus clair :
...
Ce plugin permet d'avoir un nombre infini de self switch dans un event à la place de ceux connus (A,B,C et D).
Voici le plugin en question :
- Spoiler:
- Code:
//=============================================================================
// More Self Switches
// Author gameus
// Version 1.0
//-----------------------------------------------------------------------------
// Intro:
// Allows you to use infinite self switches in any event.
//
// Instructions:
// Place in your plugins folder and save as 'MoreSelfSwitches.js'
//
// To create a custom self switch, you must first check the self switch box
// on any page. Then add a comment at the top of the page and follow the format
//
// switch:custom_switch_name
//
// After that, use the Plugin Command and call
//
// SelfSwitch custom_switch_name true/false
//
// Thus allowing as many self switches as you want, with whatever name!
//
// Credits:
// gameus ~ For creating it.
//=============================================================================
/*:
* @plugindesc Allows for infinite self switches in events.
* @author gameus
*
* @help
* Instructions:
* Place in your plugins folder and save as 'MoreSelfSwitches.js'
*
* To create a custom self switch, you must first check the self switch box
* on any page. Then add a comment at the top of the page and follow the format
*
* switch:custom_switch_name
*
* After that, use the Plugin Command and call
*
* SelfSwitch custom_switch_name true/false
*
* Thus allowing as many self switches as you want, with whatever name!
*/
var GameusScripts = GameusScripts || {};
GameusScripts['MoreSelfSwitches'] = 1.0;
(function() {
var gameus_SelfSwitch_initialize = Game_Event.prototype.initialize;
var gameus_SelfSwitch_plugin_command = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
gameus_SelfSwitch_plugin_command.call(this, command, args);
if (command.toLowerCase() == "selfswitch") {
var _switch = args[0];
var _state = Boolean(args[1]);
var _key = [this._mapId, this._eventId, _switch];
$gameSelfSwitches.setValue(_key, _state);
}
};
Game_Event.prototype.initialize = function(mapId, eventId) {
gameus_SelfSwitch_initialize.call(this, mapId, eventId);
var pages = this.event().pages;
for (i = 0; i < pages.length; i += 1) {
var page = pages[i];
for (j = 0; j < page.list.length; j += 1) {
var command = page.list[j];
if (command.code === 408 || command.code === 108)
this.checkCustomSwitch(page, command.parameters[0]);
}
}
};
Game_Event.prototype.checkCustomSwitch = function(page, code) {
var args = code.split(":");
if (args[0] !== null && args[0].toLowerCase() == "switch" && args[1] !== null) {
page.conditions.selfSwitchCh = args[1];
page.conditions.selfSwitchValid = true;
}
};
})();
Le problème avec celui-ci c'est que si je créé deux pages la commande de module " SelfSwitch page2 true" active bien la page 2 mais si je désactive cette page sur la page 2 (SelfSwitch page2 false) il ne revient pas à la page 1.
Voici deux screens pour que se soit plus clair :
...
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 21:40
Merci Tony
- InsalesticMembre
- Nombre de messages : 146
Age : 26
Localisation : France Toulon (83)
Distinction : aucune
Date d'inscription : 05/12/2015
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 22:36
pourquoi ton RPG MAKER est noir ? :O
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 22:39
- InsalesticMembre
- Nombre de messages : 146
Age : 26
Localisation : France Toulon (83)
Distinction : aucune
Date d'inscription : 05/12/2015
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 23:04
ohoh !! pas mal ! ça fait genre RM MV 2.0 !! je pensais a une mise a jour ! :p
ps : tu sais que je ne trouve pas le menu option ? c'est un trooll ?? xD
ps : tu sais que je ne trouve pas le menu option ? c'est un trooll ?? xD
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 23:07
C'est dans outils.
- InsalesticMembre
- Nombre de messages : 146
Age : 26
Localisation : France Toulon (83)
Distinction : aucune
Date d'inscription : 05/12/2015
Re: Soucis avec un plugin "More self switches"
Dim 1 Mai 2016 - 23:11
je dois avoir un rpg maker du bled ..... j'ai pas d'option x)
https://gyazo.com/9a25241d908e20d7763dd6f425ab6784
https://gyazo.com/9a25241d908e20d7763dd6f425ab6784
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 9:17
faut avoir la version officielle à jour.
Stop HS
Stop HS
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 10:00
J'suis pas sur de mon coup, car j'ai pas testé, mais je vois qu'il n'y a pas de transtypage sur l'ajout du selfswitch custom dans la liste de controle :
Essaie de remplacer la dernière fonction par cela, j'ai juste ajouté Boolean devant args[1]
Essaie de remplacer la dernière fonction par cela, j'ai juste ajouté Boolean devant args[1]
- Code:
Game_Event.prototype.checkCustomSwitch = function(page, code) {
var args = code.split(":");
if (args[0] !== null && args[0].toLowerCase() === "switch" && args[1] !== null) {
page.conditions.selfSwitchCh = Boolean(args[1]);
page.conditions.selfSwitchValid = true;
}
};
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 10:35
Merci d'avoir regardé mais maintenant mon event ne passe plus du tout à la page 2 du coup.
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 10:50
a putain, mais non, je suis complètement bourré ce matin, j'ai transtypé le nom du switch, remet comme c'était avant. ^_^.
Je vais reproduire le cas de test est passer en débug
Script corrigé, testé, validé :
Je vais reproduire le cas de test est passer en débug
Script corrigé, testé, validé :
- Code:
//=============================================================================
// More Self Switches
// Author gameus corrigé par Tonyryu
// Version 1.0
//-----------------------------------------------------------------------------
// Intro:
// Allows you to use infinite self switches in any event.
//
// Instructions:
// Place in your plugins folder and save as 'MoreSelfSwitches.js'
//
// To create a custom self switch, you must first check the self switch box
// on any page. Then add a comment at the top of the page and follow the format
//
// switch:custom_switch_name
//
// After that, use the Plugin Command and call
//
// SelfSwitch custom_switch_name true/false
//
// Thus allowing as many self switches as you want, with whatever name!
//
// Credits:
// gameus ~ For creating it.
//=============================================================================
/*:
* @plugindesc Allows for infinite self switches in events.
* @author gameus
*
* @help
* Instructions:
* Place in your plugins folder and save as 'MoreSelfSwitches.js'
*
* To create a custom self switch, you must first check the self switch box
* on any page. Then add a comment at the top of the page and follow the format
*
* switch:custom_switch_name
*
* After that, use the Plugin Command and call
*
* SelfSwitch custom_switch_name true/false
*
* Thus allowing as many self switches as you want, with whatever name!
*/
var GameusScripts = GameusScripts || {};
GameusScripts['MoreSelfSwitches'] = 1.0;
(function() {
var gameus_SelfSwitch_plugin_command = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
gameus_SelfSwitch_plugin_command.call(this, command, args);
if (command.toLowerCase() === "selfswitch") {
var _switch = args[0];
var _state = (args[1].toLowerCase() === "true");
var _key = [this._mapId, this._eventId, _switch];
$gameSelfSwitches.setValue(_key, _state);
}
};
var gameus_SelfSwitch_initialize = Game_Event.prototype.initialize;
Game_Event.prototype.initialize = function(mapId, eventId) {
var pages = $dataMap.events[eventId].pages;
for (i = 0; i < pages.length; i += 1) {
var page = pages[i];
for (j = 0; j < page.list.length; j += 1) {
var command = page.list[j];
if (command.code === 408 || command.code === 108)
this.checkCustomSwitch(page, command.parameters[0]);
}
}
gameus_SelfSwitch_initialize.call(this, mapId, eventId);
};
Game_Event.prototype.checkCustomSwitch = function(page, code) {
var args = code.split(":");
if (args[0] !== null && args[0].toLowerCase() === "switch" && args[1] !== null) {
page.conditions.selfSwitchCh = args[1];
page.conditions.selfSwitchValid = true;
}
};
})();
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 12:26
Super cool je test ca ce soir suis partis au boulot.
Juste une petite question encore est il possible d activer une page d un autre évent sur une autre map ?
Merci.
Juste une petite question encore est il possible d activer une page d un autre évent sur une autre map ?
Merci.
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 13:25
il faudrait faire des ajouts dans le script, mais c'est pas bien méchant.
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 13:47
Ca serait super
La version sur Ace faisait cella et c'était bien pratique pour pas mal de choses.
La version sur Ace faisait cella et c'était bien pratique pour pas mal de choses.
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 15:27
en soit, suffit d'ajouter une commande script, dans un event, sous ce format :
exemple pour activer l'interrupteur local 'page3' de l'eventID 1, sur la map ID 12 :
ça devrait fonctionner
- Code:
$gameSelfSwitches.setValue([mapID, eventID, nomDuSwitch], etat);
exemple pour activer l'interrupteur local 'page3' de l'eventID 1, sur la map ID 12 :
- Code:
$gameSelfSwitches.setValue([12, 1, "page3"], true);
ça devrait fonctionner
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Lun 2 Mai 2016 - 22:04
Ca fonctionne parfaitement merci Tony
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Jeu 19 Mai 2016 - 22:14
J'ai un petit soucis qui apparaît lorsque j'ouvre un menu (n'importe lequel) les "SelfSwitches" ont l'air de se réinitialiser et saute directement à la dernière page de l'event.
Re: Soucis avec un plugin "More self switches"
Jeu 19 Mai 2016 - 23:01
tu peux me décrire la manip simple pour reproduire, je regarderai demain
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Jeu 19 Mai 2016 - 23:21
Non mais je viens de tester sans utiliser mon script d'icône au dessus des event et ça fonctionne, je test encore...
Mon plug eventname :
https://github.com/Trivel/RMMV/blob/master/MrTS_EventNames.js
Mon plug eventname :
https://github.com/Trivel/RMMV/blob/master/MrTS_EventNames.js
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Ven 20 Mai 2016 - 12:16
Re: Soucis avec un plugin "More self switches"
Ven 20 Mai 2016 - 12:35
on est bien d'accord qu'il faut également le plugin de nom et d'icone, pour reproduire l'anomalie?
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Ven 20 Mai 2016 - 12:39
Non pas nécessairement après mes tests même sans, le bug apparaît.
Re: Soucis avec un plugin "More self switches"
Ven 20 Mai 2016 - 16:42
Essai avec cette version :
- Code:
//=============================================================================
// More Self Switches
// Author gameus corrigé par Tonyryu
// Version 1.01
//-----------------------------------------------------------------------------
// Intro:
// Allows you to use infinite self switches in any event.
//
// Instructions:
// Place in your plugins folder and save as 'MoreSelfSwitches.js'
//
// To create a custom self switch, you must first check the self switch box
// on any page. Then add a comment at the top of the page and follow the format
//
// switch:custom_switch_name
//
// After that, use the Plugin Command and call
//
// SelfSwitch custom_switch_name true/false
//
// Thus allowing as many self switches as you want, with whatever name!
//
// Credits:
// gameus ~ For creating it.
//=============================================================================
/*:
* @plugindesc Allows for infinite self switches in events.
* @author gameus
*
* @help
* Instructions:
* Place in your plugins folder and save as 'MoreSelfSwitches.js'
*
* To create a custom self switch, you must first check the self switch box
* on any page. Then add a comment at the top of the page and follow the format
*
* switch:custom_switch_name
*
* After that, use the Plugin Command and call
*
* SelfSwitch custom_switch_name true/false
*
* Thus allowing as many self switches as you want, with whatever name!
*/
var GameusScripts = GameusScripts || {};
GameusScripts['MoreSelfSwitches'] = 1.01;
(function() {
var gameus_SelfSwitch_plugin_command = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
gameus_SelfSwitch_plugin_command.call(this, command, args);
if (command.toLowerCase() === "selfswitch") {
var _switch = args[0];
var _state = (args[1].toLowerCase() === "true");
var _key = [this._mapId, this._eventId, _switch];
$gameSelfSwitches.setValue(_key, _state);
}
};
var gameus_Game_Event_event = Game_Event.prototype.event;
Game_Event.prototype.event = function() {
var eventTmp = gameus_Game_Event_event.call(this);
if(eventTmp){
var pages = eventTmp.pages;
for (i = 0; i < pages.length; i += 1) {
var page = pages[i];
for (j = 0; j < page.list.length; j += 1) {
var command = page.list[j];
if (command.code === 408 || command.code === 108)
this.checkCustomSwitch(page, command.parameters[0]);
}
}
}
return eventTmp;
};
Game_Event.prototype.checkCustomSwitch = function(page, code) {
var args = code.split(":");
if (args[0] !== null && args[0].toLowerCase() === "switch" && args[1] !== null) {
page.conditions.selfSwitchCh = args[1];
page.conditions.selfSwitchValid = true;
}
};
})();
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Soucis avec un plugin "More self switches"
Ven 20 Mai 2016 - 16:45
Magnifique bug corrigé merci Tony
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|