LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : 1, 2  Next

View previous topic View next topic Go down Message [Page 1 of 2]

EVENTALIST
EVENTALIST
#1 Simple HUD Plugin Empty Simple HUD Plugin
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile

Sample HUD Plugin Script





Description:





This plugin out lines the basis for creating a custom HUD in RMMV either it be Scene_Map over lay or Scene_Battle.

Screen Shots:


Simple HUD Plugin Untitl15
Simple HUD Plugin Wiggle10



Script:



Showing information on map in a window.
Code:
//================================================================================
// SimpleHUD.js
//================================================================================
/*: @author Mr_Wiggles
 *   Date: 10/28/15
 *   Version: 1.0
 * -------------------------------------------------------------------------------
 * @plugindesc Just a simple HUD script to get the ball rolling.
 *
 *
 * @help This plugin is a simple HUD script to show what the bases are for doing such
 * in the user of the plugin games. You can use the event command 'HUD' with the
 * following arguments:
 *   'show' = show HUD; Example 'HUD hide'
 *   'hide' = hide HUD; Example 'HUD show'
 */ //============================================================================
//--------------------------------------------------------------------------------
// Auto run: Sets plugin items that are user defined in RMMV.
//--------------------------------------------------------------------------------
(function() {
  //------------------------------------------
  var parameters = PluginManager.parameters('SimpleHUD'); // Define plugin name.
  // Set interactive variable settings to show in plugin manager.
  //var opacitySetting = String(parameters['Opacity'] || 255);
  //------------------------------------------
  // Define plugin commands that are called from event task.
  //------------------------------------------
  // set alias for Game_Interpreter_pluginCommand
  var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_pluginCommand.call(this, command, args); // calls alias
    // add in custom flags for your plugin.
    if (command === 'HUD') {
      switch (args[0]) {
      case 'hide':
        break;
      case 'show':
        SoundManager.playOk();
        break;
      }
    }
  };
//--------------------------------------------------------------------------------
// Scene_Map Additions/Edits
//--------------------------------------------------------------------------------
  //------------------------------------------
  // map update loop
  //------------------------------------------
  var _Scene_Map_pluginHUD_update = Scene_Map.prototype.update;
  Scene_Map.prototype.update = function() {
    if (this._HUDWindow) {
      this._HUDWindow.update
    } else {
      this._HUDWindow = new Window_HUD(0,0);
      this.addWindow(this._HUDWindow); // *parent function
      //throw new Error('Got to window adding!');
    };
    _Scene_Map_pluginHUD_update.call(this);
  };
  //------------------------------------------
  // Dispose of HUD window when scene is not map.
  //------------------------------------------
  var _Scene_Map_pluginHUD_stop = Scene_Map.prototype.stop;
  Scene_Map.prototype.stop = function() {
    this._HUDWindow.close(); // Dispose of window. *parent function
    _Scene_Map_pluginHUD_stop.call(this);
  };
//--------------------------------------------------------------------------------
// Window HUD
//--------------------------------------------------------------------------------
  function Window_HUD() { // Set function call initialize before object is created.
    this.initialize.apply(this, arguments);
  }
  // Inherit parrent class functions.
  Window_HUD.prototype = Object.create(Window_Base.prototype);
  Window_HUD.prototype.constructor = Window_HUD;
  // class variables
  //------------------------------------------
  // Initialize Window HUD object
  //------------------------------------------
  Window_HUD.prototype.initialize = function(x, y) {
    Window_Base.prototype.initialize.call(this, x, y, 256, 256); // *super()
    this._updateWait = 0;
    this.refresh(); // refresh window contients.
    this.activate(); // *@active = true
  };
  //------------------------------------------
  // Update HUD
  //------------------------------------------
  Window_HUD.prototype.update = function() {
    Window_Base.prototype.update.call(this); // *super()
    // throw new Error('Got to update!');
    if (this._updateWait <= 0) {
       this.refresh();
       this._updateWait = 10;
    } else {
      this._updateWait--; // subtract 1 each time called.
    }
    // SoundManager.playOk();
   };
  //------------------------------------------
  // Refresh HUD if changed
  //------------------------------------------
  Window_HUD.prototype.refresh = function() {
    if (this.contents) {
      if ($gameParty != null) {
        var actor = $gameParty.leader() // set to actor one (player sprite)
        //var actor = $gameParty.allMembers(1);
        //var actor = $gameParty.members(1)
        //throw new Error('Got this far! ' + actor._name);
      }
      var lineHeight = this.lineHeight();
      this.contents.clear();
      if (actor) { // check to make sure Game_Party has
        // enough time/ there is a party member to find in Party.
        this.drawActorName(actor, 0, 0, 100);
        this.drawActorHp(actor, 0, 32, 100);
        this.drawActorMp(actor, 0, 64, 100);
        //throw new Error('Got this far! ' + actor._name);
      }
    } else { // you have to check to make sure the object has been
      // added into the GC.
      SoundManager.playBuzzer();
    }
  };
 //================================================================================
})(); // End of plugin block.

Showing simple information over enemy battler sprites during battle:

Code:
//================================================================================
// EnemyDebug.js
//================================================================================
/*: @author Mr_Wiggles
 *   Date: 11/1/15
 *   Version: 1.0
 * -------------------------------------------------------------------------------
 * @plugindesc This plugin shows extra information on the enemy when battling.
 *
 * @help PIXI.js http://pixijs.github.io/docs/PIXI.Sprite.html
 */ //============================================================================
//--------------------------------------------------------------------------------
// Auto run: Sets plugin items that are user defined in RMMV.
//--------------------------------------------------------------------------------
(function() {
//--------------------------------------------------------------------------------
// Sprite_Enemy
//--------------------------------------------------------------------------------
  var _Sprite_Battler_debug_init = Sprite_Battler.prototype.initialize;
  Sprite_Battler.prototype.initialize = function(battler) {
    _Sprite_Battler_debug_init.call(this, battler);
    this._debugStartTimer = 10;
  };
  //------------------------------------------
  var _Sprite_Enemy_debug_update = Sprite_Enemy.prototype.update;
  Sprite_Enemy.prototype.update = function() {
    _Sprite_Enemy_debug_update.call(this);
    if (!BattleManager._phase === 'battleEnd' || this._enemy.isDead()) {
      if (this._debugWindow) {
        //SoundManager.playOk();
        this._debugWindow.close();
      };
    }
    if (this.bitmap.isReady()) {
      if (this._debugWindow) {
        this._debugWindow.update();
      } else if (this._debugStartTimer <= 0) { // if window was not made create window.
        this._debugWindow = new Window_Enemy_Debug();
        this._debugWindow.move(0 - (this.bitmap.width / 4) - 50, 0 - (this.bitmap.height) - 50, 200, 200);
        this._debugWindow.setBattler(this._battler);
        this.addChild(this._debugWindow);
      } else {
        this._debugStartTimer--;
      }
    }
  };
//--------------------------------------------------------------------------------
// Window Enemy Debug // Look at base File:rpg_core.js Line#(4974)
//--------------------------------------------------------------------------------
  function Window_Enemy_Debug() { // Set function call initialize before object is created.
    this.initialize.apply(this, arguments);
  }
  // Inherit parrent class functions.
  Window_Enemy_Debug.prototype = Object.create(Window_Base.prototype);
  Window_Enemy_Debug.prototype.constructor = Window_Enemy_Debug;
  // class variables
  //------------------------------------------
  // Initialize Window HUD object
  //------------------------------------------
  Window_Enemy_Debug.prototype.initialize = function() {
    Window_Base.prototype.initialize.call(this, 0, 0, 232, 232); // *super()
    this.opacity = 0;
    this._updateWait = 0;
    this.refresh();
    this.activate(); // *@active = true
  };
  //------------------------------------------
  Window_Enemy_Debug.prototype.setBattler = function(battler) {
    this._battler = battler;
  };
  //------------------------------------------
  // Update HUD
  //------------------------------------------
  Window_Enemy_Debug.prototype.update = function() {
    Window_Base.prototype.update.call(this); // *super()
    // throw new Error('Got to update!');
    if (this._updateWait <= 0) {
       this.refresh();
       this._updateWait = 10;
    } else {
      this._updateWait--;
    }
   };
  //------------------------------------------
  // Refresh HUD if changed
  //------------------------------------------
  Window_Enemy_Debug.prototype.refresh = function() {
    if (this.contents && this._battler) {
      //SoundManager.playOk();
      var lineHeight = this.lineHeight();
      this.contents.clear();
      var color1 = this.hpGaugeColor1();
      var color2 = this.hpGaugeColor2();
      var rate = this._battler.hpRate();
      // File:rpg_objects.js Line#(2113)
      this.drawGauge(0, 0, 150, rate, color1, color2);
      this.drawText(this._battler.name(), 0, 0, 150, 'center');
      var color1 = this.mpGaugeColor1();
      var color2 = this.mpGaugeColor2();
      var rate = this._battler.mpRate();
      this.drawGauge(0, 10, 150, rate, color1, color2);
    } else {
      //SoundManager.playBuzzer();
    }
  };
//================================================================================
})(); // End of plugin block.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#2 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
OMG! You have opened the doors to the realm of customized HUDs for RPG Maker MV!

here's a screenshot for your OP ^
Simple HUD Plugin Wiggle10

this is well done, from the invoking of your function, the initialize/update loop, to the disposal when change of scene. Thanks for sharing, this is a time saver and a study guide for all of us trying to break RMMV's default mold.

Fact! out of all of the pre-order plug-ins, and the one's that had surfaced throughout the first week since RPG Maker MV's launch... at the moment, I believe this is the only HUD plugin that's out there for RMMV on one single javascript file!

simple and effective, I'm sure it's only going to get more advanced and awesome +




Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#3 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
I forgot to include a screen shot of what it looked like. Thanks Smile
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#4 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
question, how do you find the names for your functions and parameters? for example I'm looking to add exp but
Code:
this.drawActorExp(actor, x, y, 100);
doesn't work.

I was able to get the face graphic to work for I studied the rpg_windows script in the js folder and found
Code:
this.drawActorFace

also gold, there's $gameparty.gold, drawcurrency, etc.. which to use, where to find??

here's how it's looking so far...
Simple HUD Plugin Gw_hud10
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#5 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
Looks like you two got your hands on a copy. I'm getting there.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
EVENTALIST
EVENTALIST
#6 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
G@MeF@Ce wrote:question, how do you find the names for your functions and parameters? for example I'm looking to add exp but
Code:
this.drawActorExp(actor, x, y, 100);
doesn't work.

Try one of the alternate variable settings that are commented out above that line, you have to define the variable actor to an object container "Game_Actor". In Game_Party file "rpg_objects.js" around line#(4763) is where you see Game_Party's members data pile. One of the listed methods bellow should do it.

Code:
var actor = $gameParty.leader() // set to actor one (player sprite)
var actor = $gameParty.allMembers(id);
var actor = $gameParty.members(id)

id = actor position in Game_Party object handler. # range number (1 to party max or 4)

I think that would be how you would choose a different actor then the leader.
G@MeF@Ce wrote:
also gold, there's $gameparty.gold, drawcurrency, etc.. which to use, where to find??
For gold and such like that you can use the built in filter option for drawing text instead of ".drawText(*args)":
Code:
this.drawTextEx(text, X pos, Y pos)
The filters are found in file "rpg_windows.js" around line#(279) they are the same as the ones when showing in game windows FYI. Also look at ones on line#(364).

Code:

G/        : Show party gold.
/V[id]   : Show variable value using number (id)
/N[id]   : Show actor name using number (id)
/P[id]   : Show party actor name using number (id)

example:
  this.drawTextEx("G/", X pos, Y pos) // will draw gold text + extra

Or you could mimic how Window_Gold in file "rpg_windows.js" around line#(1507) does it in the window class.

Code:

this.drawCurrencyValue($gameParty.gold(), TextManager.currencyUnit, X pos, Y pos, width);

There are many options, id use either ".drawCurrencyValue(*args)" or ".drawTextEx(*args)"


There is also ".drawGauge" it can draw things like Health bars.
Code:
this.drawGauge(x, y, width, rate, color1, color2)
The argument "rate" I believe is a float, percentage (0.0 - 1.0) (0% - 100%).
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#7 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
here's what I got so far:
Simple HUD Plugin Shot10
I'm going to need more practice, I've become used to javascript and HTML5,
javascript and RMMV is a whole new story for me to read, so studying the scripts and reading the help file will help me step up my code game +

still very impressed with your power of code, I look forward to every plugin you script, if you ever run out of ideas, I got a list 8P
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#8 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
It's funny you should say that, i was going to look at writing another shortly after i convert my Noob Made Extractor from reading Ruby to reading Java. Its almost done just a little more debugging and I'll be posting it. Where is the list at? Smile
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#9 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
oh I'm gonna need that noob extractor, looking forward to using it!

here's a list ~> Cool
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#10 Simple HUD Plugin Empty Re: Simple HUD Plugin
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Its uploaded! Very Happy http://gameface101.playogame.com/t2040-a_noob_made_extractor_rmmv_version#25544
EVENTALIST
Show Signature
EVENTALIST

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 2]

Go to page : 1, 2  Next

 

Chatbox system disabled
Personal messaging disabled