Lomax_Iced Posted November 15, 2015 Share Posted November 15, 2015 Buongiorno :)Andrò subito al dunque: //----------------------------------------------------------------------------- // Galv's Jump Ability //----------------------------------------------------------------------------- // For: RPGMAKER MV // GALV_JumpAbility.js //----------------------------------------------------------------------------- // 2015-11-13 - Version 1.1 - fixed jump distance & jump off map errors // 2015-11-13 - Version 1.0 - release //----------------------------------------------------------------------------- // Terms can be found at: // galvs-scripts.com //----------------------------------------------------------------------------- var Imported = Imported || {}; Imported.Galv_JumpAbility = true; var Galv = Galv || {}; // Galv's main object Galv.pCmd = Galv.pCmd || {}; // Plugin Command manager Galv.JA = Galv.JA || {}; // Galv's stuff //----------------------------------------------------------------------------- /*: * @plugindesc Allows the player to jump by pressing a button. * * @author Galv - galvs-scripts.com * * @param Key * @desc See help file for available keys. This key will also act as "cancel" key * @default c * * @param Jump Distance * @desc The default jump distance in the game. * @default 2 * * @param Blocking Regions * @desc Region ID's that block jumping (cannot be jumped over) separated by commas * @default 255,254 * * @param Jump Sound * @desc Sound effect played when player jumps using the jump button * FileName,volume,pitch. (leave blank for no sound) * @default Jump1, 80, 150 * * @help * Galv's Jump Ability * ---------------------------------------------------------------------------- * JUMP KEY * ---------------------------------------------------------------------------- * This plugin mostly uses default RPGMaker MV controls for the jump key * setup. It also allows use of other keyboard keys but whatever key you * choose, I advise you to test it isn't conflicting with another control. * ---------------------------------------------------------------------------- * Possible keys to use for "Key" setting: * tab * enter // Not recommended as key already used * shift // Not recommended as key already used * ctrl * alt * space // Not recommended as key already used * 0-9 * a-z // Q,W,Z,X are not recommended as they are used * semi-colon * comma * period * single quote * ---------------------------------------------------------------------------- * EVENT COMMENT * ---------------------------------------------------------------------------- * An event can be used to control where the player can and cannot jump. If * the very first event command of an event's page is a comment with: * <blockJump> * Then the player cannot jump over it. Switch the event page to one without * this comment and then the player can jump over it. * ---------------------------------------------------------------------------- * REGIONS * ---------------------------------------------------------------------------- * Region ID's can be set in the settings. The player can not jump over these * regions. Separate multiple region ID's with commas. * ---------------------------------------------------------------------------- * PLUGIN COMMANDS * ---------------------------------------------------------------------------- * JUMPACTION STATUS // STATUS can be TRUE or FALSE to enable/disable * // the player's jump key. * Example: * JUMPACTION FALSE // Disables the jump action key * JUMPACTION TRUE // Enables it again * ---------------------------------------------------------------------------- */ //----------------------------------------------------------------------------- // CODE STUFFS //----------------------------------------------------------------------------- (function() { // GALV'S PLUGIN MANAGEMENT. INCLUDED IN ALL GALV PLUGINS THAT HAVE PLUGIN COMMAND CALLS, BUT ONLY RUN ONCE. if (!Galv.aliased) { var Galv_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { if (Galv.pCmd[command]) { Galv.pCmd[command](args); return; }; Galv_Game_Interpreter_pluginCommand.call(this, command, args); }; Galv.aliased = true; // Don't keep aliasing for other Galv scripts. }; // Direct to Plugin Object Galv.pCmd.JUMPACTION = function(arguments) { Galv.JA.btnStatus(arguments[0]); }; // END GALV'S PLUGIN MANAGEMENT Galv.JA.key = PluginManager.parameters('Galv_JumpAbility')["Key"].toLowerCase(); Galv.JA.jDist = Number(PluginManager.parameters('Galv_JumpAbility')["Jump Distance"]); Galv.JA.regions = function () { var arr = PluginManager.parameters('Galv_JumpAbility')["Blocking Regions"].split(","); for (i = 0;i < arr.length;i++) { arr[i] = Number(arr[i]); }; return arr; }(); Galv.JA.Se = function() { var arr = PluginManager.parameters('Galv_JumpAbility')["Jump Sound"].split(","); var obj = {name: arr[0],pan: 0,pitch: Number(arr[2]),volume: Number(arr[1])}; return obj; }(); Galv.JA.btnStatus = function(status) { $gameSystem.jumpBtnDisable = status === "FALSE" ? true : false; }; // Potential keys user can add: var txt_ids = { "tab":9,"enter":13,"shift":16,"ctrl":17,"alt":18,"space":32,"0":48,"1":49,"2":50,"3":51,"4":52,"5":53,"6":54, "7":55,"8":56,"9":57,"a":65,"b":66,"c":67,"d":68,"e":69,"f":70,"g":71,"h":72,"i":73,"j":74,"k":75,"l":76,"m":77, "n":78,"o":79,"p":80,"q":81,"r":82,"s":83,"t":84,"u":85,"v":86,"w":87,"x":88,"y":89,"z":90,"semi-colon":186, "comma":188,"period":190,"single quote":222, }; // Add key to 'cancel' input. This is so gamepad works and user can still add a keyboard key. Input.keyMapper[txt_ids[Galv.JA.key]] = 'cancel'; // Special jump trigger so the cancel command doesn't call menu and jump Input.isJumpTriggered = function(keyName) { return this._latestButton === keyName && this._pressedTime === 0; }; var Galv_Game_Player_moveByInput = Game_Player.prototype.moveByInput; Game_Player.prototype.moveByInput = function() { if (this.isJumping()) return; if (this._priorityType == 1.5) this._priorityType = 1; if (this.canMove() && Input.isJumpTriggered('cancel')) { if (this.isNormal && !$gameSystem.jumpBtnDisable) this.do_jump(); }; Galv_Game_Player_moveByInput.call(this); }; Game_Player.prototype.do_jump = function() { var jdis = Galv.JA.jumpDistanceXY(); if (jdis.y !== 0) this._priorityType = 1.5; AudioManager.playSe(Galv.JA.Se); this.jump(jdis.x, jdis.y); }; Galv.JA.jumpMax = function(dir,dis) { var m = {x: 0, y:0}; var x = $gamePlayer.x var y = $gamePlayer.y switch (dir) { case 2: m.y = dis; for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x, y + i + 1)) m.y = i;}; break; case 4: m.x = dis; for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x - i - 1, y)) m.x = i;}; break; case 6: m.x = dis; for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x + i + 1, y)) m.x = i;}; break; case 8: m.y = dis; for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x, y - i - 1)) m.y = i;}; break; }; return m; }; Galv.JA.checkBlock = function(x,y) { return Galv.JA.regions.contains($gameMap.regionId(x,y)) || Galv.JA.stopperEvent(x,y); }; Galv.JA.stopperEvent = function(x,y) { var block = false; var events = $gameMap.eventsXy(x,y); for (var i = 0;i <= events.length;i++) { if (events[i]) { if (events[i].page().list[0].code === 108 && events[i].page().list[0].parameters[0] === "<blockJump>") { block = true; break; }; }; }; return block; }; Galv.JA.canJump = function(x,y,d) { if (x < 0 || x > $gameMap.width() || y < 0 || y > $gameMap.height()) { return false; }; return $gameMap.isPassable(x,y,d) && !Galv.JA.eventThere(x,y); }; Galv.JA.eventThere = function(x,y) { var events = $gameMap.eventsXyNt(x,y); if (events.length > 0) return true; return false; }; Galv.JA.getDistance = function() { // For adding distance bonus modifiers return Galv.JA.jDist; }; Galv.JA.jumpDistanceXY = function() { var jump = {x: 0, y:0}; // x,y var can_jump = true; // init true var dis = Galv.JA.getDistance(); // get player jump distance var dir = $gamePlayer.direction(); var px = $gamePlayer.x; var py = $gamePlayer.y; var maxdis = Galv.JA.jumpMax(dir,dis); // Maximum x,y due to hard block region and events var realdis = 0; switch (dir) { case 2: // DOWN for (var i = 0;i < maxdis.y;i++) { if (Galv.JA.canJump(px, py + maxdis.y - i,dir)) { realdis = maxdis.y - i; break; }; }; jump.y = realdis; break; case 8: // UP for (var i = 0;i < maxdis.y;i++) { if (Galv.JA.canJump(px, py - maxdis.y + i,dir)) { realdis = maxdis.y - i; break; }; }; jump.y = -realdis; break; case 4: // LEFT for (var i = 0;i < maxdis.x;i++) { if (Galv.JA.canJump(px - maxdis.x + i, py,dir)) { realdis = maxdis.x - i; break; }; }; jump.x = -realdis; break; case 6: // RIGHT for (var i = 0;i < maxdis.x;i++) { if (Galv.JA.canJump(px + maxdis.x - i, py,dir)) { realdis = maxdis.x - i; break; }; }; jump.x = realdis; break; }; return jump; }; })(); Questo script migliorerà l'abilità di salto, implementando la pressione di un tasto della keyboard (in questo caso la lettera C) In più attraverso una condizione posta dentro un evento si sceglie se attivare la 'Modalità di Salto' oppure disattivarla. Ciao gente a più tardi https://youtube.com/shorts/IeFx6zFuE0A?feature=share https://youtu.be/z8XXIWEDrw8 https://youtu.be/g4-mMbCTX6I https://youtu.be/YZDK0M6BMsw <p> Link to comment Share on other sites More sharing options...
Lusianl Posted November 15, 2015 Share Posted November 15, 2015 Ah ah una caratteristica, è che pur cambiando tool o avanzando con gli anni, il salto su rpg maker rimane una cacataXD http://www.freankexpo.net/signature/1129.pngPremi RpgMaker http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png Link to comment Share on other sites More sharing options...
Ste Posted November 15, 2015 Share Posted November 15, 2015 Seee adoro questo plugin!!!XD Link to comment Share on other sites More sharing options...
Elpropax Posted January 22, 2017 Share Posted January 22, 2017 Scusate ma come lo devo inserire questo plugin? Io ho provato ma non riesco proprio...Non riesco a capirlo... Ogni sogno a cui rinunci è un pezzo del tuo futuro che cessa di esistere-Steve Jobs- Link to comment Share on other sites More sharing options...
Guardian of Irael Posted January 22, 2017 Share Posted January 22, 2017 Cosa non capisci Elpropax? Sai come inserire i plugin? Cioè l'inserirli nella cartella? Attivarli mettendoli su ON in rpg maker? Etc...^ ^ Non sembra un plugin così complesso da inserire. I comandi plugin li trovi come ultimo comando dei comandi evento, puoi impostare true il salto da lì. Di specifico cosa non capisci? ^ ^ (\_/)(^ ^) <----coniglietto rosso, me! (> <) Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^ http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^ http://i.imgur.com/FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^ REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^ 🖤http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gifhttp://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3http://i.imgur.com/MpaUphY.jpg by Idriu E:3Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44) http://i.imgur.com/PgUqHPm.pngUfficiale"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.pngGrazie Testament XD Fan n°1 ufficiale di PQ! :DVivail Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che nonavevo programmi di grafica per fare un banner su questo pc XD (ora ho dinuovo il mio PC veramente :D) Rosso Guardiano dellahttp://i.imgur.com/Os5rvhx.pngRpg2s RPG BY FORUM:Nome: Darth Reveal PV totali 2PA totali 16Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.Bozze vesti non definitive qui.Equipaggiamento:Indossa:60$ e 59$ divisi in due tasche interneLevaitanSpada a due mani elsa lungaGuanti del Defender (2PA)Anello del linguaggio animale (diventato del Richiamo)Scrinieri da lanciere (2 PA)Elmo del Leone (5 PA)Corazza del Leone in Ferro Corrazzato (7 PA) ZAINO (20) contenente:Portamonete in pelle di cinghiale contenente: 100$Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)CordaBottiglia di idromeleForma di formaggioTorcia (serve ad illuminare, dura tre settori)Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)Ampolla BiancaSemi di Balissa CAVALLO NORMALE + SELLA (30 +2 armi) contentente:66$Benda di pronto soccorso x3Spada a due maniFagotto per Adara (fazzoletto ricamato) Link to comment Share on other sites More sharing options...
Elpropax Posted January 22, 2017 Share Posted January 22, 2017 Risolto :) Ogni sogno a cui rinunci è un pezzo del tuo futuro che cessa di esistere-Steve Jobs- Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now