Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

Sparvy

Utente
  • Numero contenuti

    6
  • Iscritto

  • Ultima visita

  1. //potete copiare e salvare tutto con estensione .js (javascript) e metterlo nella cartella plugin //del vostro progetto //===================================================================== // SelectItemWeaponArmors (For RPG Maker MV) //===================================================================== /*: * @plugindesc modify the select_item command of rpg maker to get * selectable also weapons and armors * @author Francesco Sammaritano * * @param variabile * @desc ID of variable where to store the number (1, 2 or 3) for select * different tipe of items (items, weapons, armors). * @default 6 * * * @help This plugin does not provide plugin commands. * * This plugin modify the select item command, but you have to give to * "itemcategory" variable a value, of: * 1 if you wanna show the normal select items; * 2 if you wanna show a selection of weapons; * 3 if you wanna show a selection of armors. * and this variable ha to be set before that the command choose item is * called, so it'll will run in function of it. * * Example: i wanna show to my player the standard select item window, so * i'll give (in the way you want) to my "itemcategory" variable the value * 1 and i'll insert after this line the command "select item" (you can set * all this thing only using "control variable" and "Select Item" commands * in rpg maker MV */ //----------------------------------------------------------------------------- (function() { var parameters = PluginManager.parameters('SelectWeaponcommand'); var variabile = Number(parameters['variabile']) != 0; // LAVORO MIO MESSO AL SICURO!!! DA NON TOCCARE PERCHE' FUNZIONA!!! function Window_EventItem() { this.initialize.apply(this, arguments); } Window_EventItem.prototype = Object.create(Window_ItemList.prototype); Window_EventItem.prototype.constructor = Window_EventItem; Window_EventItem.prototype.initialize = function(messageWindow) { this._messageWindow = messageWindow; var width = Graphics.boxWidth; var height = this.windowHeight(); Window_ItemList.prototype.initialize.call(this, 0, 0, width, height); this.openness = 0; this.deactivate(); this.setHandler('ok', this.onOk.bind(this)); this.setHandler('cancel', this.onCancel.bind(this)); }; Window_EventItem.prototype.windowHeight = function() { return this.fittingHeight(this.numVisibleRows()); }; Window_EventItem.prototype.numVisibleRows = function() { return 4; }; Window_EventItem.prototype.start = function() { this.refresh(); this.updatePlacement(); this.select(0); this.open(); this.activate(); }; Window_EventItem.prototype.updatePlacement = function() { if (this._messageWindow.y >= Graphics.boxHeight / 2) { this.y = 0; } else { this.y = Graphics.boxHeight - this.height; } }; Window_EventItem.prototype.includes = function(item) { // Francesco, l'ho modificata per poter selezionare più tipi di oggetti. var itypeId = $gameMessage.itemChoiceItypeId(); if ($gameVariables.value(variabile) == 2) { return DataManager.isWeapon(item) /*&& item.itypeId === itypeId;*/ // francesco, prima era DataManager.isItem se non si toglie quel pezzo parte non spuntano armi!!! }; if ($gameVariables.value(variabile) == 1) { return DataManager.isItem(item) && item.itypeId === itypeId; }; if ($gameVariables.value(variabile) == 3) { return DataManager.isArmor(item) /*&& item.itypeId === itypeId;*/ // francesco, prima era DataManager.isItem se non si toglie quel pezzo parte non spuntano armi!!! }; }; Window_EventItem.prototype.isEnabled = function(item) { return true; }; Window_EventItem.prototype.onOk = function() { var item = this.item(); var itemId = item ? item.id : 0; $gameVariables.setValue($gameMessage.itemChoiceVariableId(), itemId); this._messageWindow.terminateMessage(); this.close(); }; Window_EventItem.prototype.onCancel = function() { $gameVariables.setValue($gameMessage.itemChoiceVariableId(), 0); this._messageWindow.terminateMessage(); this.close(); }; })();
  2. salve a tutti, ho modificato un pochino il comando seleziona oggetto di RPG maker MV per permettergli di far scegliere anche un'arma o un'armatura e volevo condividerlo, usatelo se vi piace come gira xD basta copiare il testo qui sotto su un programma tipo sublimetext e salvarlo con estensione .js (javascript) nella cartella plugin del vostro progetto, e poi potrete usarlo dal plugin manager di rpgmaker MV: //============================================================================= // SelectItemWeaponArmors (For RPG Maker MV) //============================================================================= /*: * @plugindesc modify the select_item command of rpg maker to get * selectable also weapons and armors * @author Francesco Sammaritano * * @param variabile * @desc ID of variable where to store the number (1, 2 or 3) for select * different tipe of items (items, weapons, armors). * @default 6 * * * @help This plugin does not provide plugin commands. * * This plugin modify the select item command, but you have to give to * "itemcategory" variable a value, of: * 1 if you wanna show the normal select items; * 2 if you wanna show a selection of weapons; * 3 if you wanna show a selection of armors. * and this variable ha to be set before that the command choose item is * called, so it'll will run in function of it. * * Example: i wanna show to my player the standard select item window, so * i'll give (in the way you want) to my "itemcategory" variable the value * 1 and i'll insert after this line the command "select item" (you can set * all this thing only using "control variable" and "Select Item" commands * in rpg maker MV */ //----------------------------------------------------------------------------- (function() { var parameters = PluginManager.parameters('SelectWeaponcommand'); var variabile = Number(parameters['variabile']) != 0; function Window_EventItem() { this.initialize.apply(this, arguments); } Window_EventItem.prototype = Object.create(Window_ItemList.prototype); Window_EventItem.prototype.constructor = Window_EventItem; Window_EventItem.prototype.initialize = function(messageWindow) { this._messageWindow = messageWindow; var width = Graphics.boxWidth; var height = this.windowHeight(); Window_ItemList.prototype.initialize.call(this, 0, 0, width, height); this.openness = 0; this.deactivate(); this.setHandler('ok', this.onOk.bind(this)); this.setHandler('cancel', this.onCancel.bind(this)); }; Window_EventItem.prototype.windowHeight = function() { return this.fittingHeight(this.numVisibleRows()); }; Window_EventItem.prototype.numVisibleRows = function() { return 4; }; Window_EventItem.prototype.start = function() { this.refresh(); this.updatePlacement(); this.select(0); this.open(); this.activate(); }; Window_EventItem.prototype.updatePlacement = function() { if (this._messageWindow.y >= Graphics.boxHeight / 2) { this.y = 0; } else { this.y = Graphics.boxHeight - this.height; } }; Window_EventItem.prototype.includes = function(item) { // Francesco, l'ho modificata per poter selezionare più tipi di oggetti. var itypeId = $gameMessage.itemChoiceItypeId(); if ($gameVariables.value(variabile) == 2) { return DataManager.isWeapon(item) /*&& item.itypeId === itypeId;*/ // francesco, prima era DataManager.isItem se non si toglie quel pezzo parte non spuntano armi!!! }; if ($gameVariables.value(variabile) == 1) { return DataManager.isItem(item) && item.itypeId === itypeId; }; if ($gameVariables.value(variabile) == 3) { return DataManager.isArmor(item) /*&& item.itypeId === itypeId;*/ // francesco, prima era DataManager.isItem se non si toglie quel pezzo parte non spuntano armi!!! }; }; Window_EventItem.prototype.isEnabled = function(item) { return true; }; Window_EventItem.prototype.onOk = function() { var item = this.item(); var itemId = item ? item.id : 0; $gameVariables.setValue($gameMessage.itemChoiceVariableId(), itemId); this._messageWindow.terminateMessage(); this.close(); }; Window_EventItem.prototype.onCancel = function() { $gameVariables.setValue($gameMessage.itemChoiceVariableId(), 0); this._messageWindow.terminateMessage(); this.close(); }; })();
  3. Problema risolto! Tramite un condizionale faccio scegliere al giocatore il personaggio e in funzione della scelta definisco e setto il valore di una variabile globale (nell'esempio: $giocatore) che richiamo nello script call del messaggio per usarla come identificatore della faccina... in questo modo è possibile scegliere il proprio personaggio e quando questo avrà qualcosa da dire non ci sarà bisogno di condizionali tipo: se il giocatore è l'eroe 1 allora usa sta faccina per dire "ciao". se il giocatore è l'eroe due allora usa quest'altra faccina per dire "ciao" e così via... xD in allegato 2 immagini con l'esempio da me sviluppato... lo so che è una nabbata colossale ma io non ci ero arrivato.. magari può aiutare altre persone come me... ahahahahah ^^
  4. ok facciamo così, 1)provo come hai detto tu; 2) chiedo a Giustino;3)mi studio il javascript se le prime due non bastassero; 4)metto la risposta trovata (perchè prima o poi la troverò u.u) in questa discussione e la chiudiamo ^^ grazie mille per l'aiuto ^^
  5. INTANTO: grazie Segugio per il link con la lista degli script call che è utilissimo! Quello che dici tu va bene, infatti anche con i comandi di base basta andare su messaggio e scrivere \V[n] dove n è il numero della variabile. Il vero problema è che io voglio mettere in funzione di una variabile la faccina visualizzata nel messaggio, in pratica mi serve il codice che serve per richiamare il valore di una variabile in rpg maker MV in modo da poter dedicare una variabile a registrare se (esempio) il personaggio ha la faccia dell' (Actor1, 0) o dell' (Actor1, 1) (maschio o femmina... o tanti valori per tante facce) e poi poter fare una cosa di questo genere... $gameMessage.setFaceImage('Actor1',[variabile_che_fa_spuntare_la_giusta_faccia]) $gameMessage.setBackground(0) $gameMessage.setPositionType(2) $gameMessage.add("testo del messaggio che il personaggio ha da dire") ovviamente conoscere il modo per richiamare il valore di una variabile in MV sarebbe un vantaggio notevole per poter personalizzare al meglio i comandi ed evitarsi combinazioni assurde di comandi base (quelli che ti offre il programma) e alleggerire di un botto il lavoro. Anche (io non lo conosco al momento ma mi ci metterò per imparare almeno le basi) conoscendo il JavaScript non so come richiamare le variabili globali perchè non so come si chiamino in MV... pensavo di poterlo fare con $game_variables[numerodellavariabile] ma da messaggi di errore dicendo che $game non è definito.... qualcuno sa come richiamarle?
  6. Salve a tutti, sono nuovo del sito :3 volevo chiedere come inserire una variabile in uno script ed in particolare in quello di MV che segue: $gameMessage.setFaceImage('Actor1',0) $gameMessage.setBackground(0) $gameMessage.setPositionType(2) $gameMessage.add($game_variables[56]) questo è uno dei miei tanti tentativi, in altri tentativi ho provato a virgolettarlo e doppiovirgolettarto, ma mi ha sempre dato messaggi di errore, io vorrei che se la variabile ha valore 3 mi spunti 3 o se è una parola spunti la parola... qualcuno può aiutarmi?
×