[XP] Game Guy's Custom Message System

Started by G_G, March 21, 2009, 05:16:17 pm

Previous topic - Next topic

G_G

March 21, 2009, 05:16:17 pm Last Edit: March 28, 2009, 02:17:18 am by game_guy
Game Guy's Message System
Authors: Game_guy
Version: 2.0
Type: Custom Message System
Key Term: Custom Message System



Introduction

A custom message system by your truly game_guy. Now with new \x[] commands.


Features
New Features are in red

  • Has commands that deal with anything about an actor.
  • Message window animates in from either the right or left.
  • Animation is allowed to be turned off.
    • Has commands that deal with skills
    • Has commands that deal with items
    • Has commands that deal with weapons
    • Has commands that deal with armors
    • Has commands that deal with enemies
      [/color]



    Screenshots

    There are more features than what appear in the screenie
    Spoiler: ShowHide
    This is when it starts animating.

    Heres the full message
    http://i307.photobucket.com/albums/nn318/bahumat27/message2.png



    Demo

    Just use the script :P


    Script

    Place above Blizzards Scripts, below ccoa's ums and below everything else
    Spoiler: ShowHide

    #==============================================================================
    # ** Game_guy's Window_Message
    #------------------------------------------------------------------------------
    #  This message window is used for more \x[] options.
    #==============================================================================

    =begin

    Intro: A custom message window with more \x[] options.

    Features:
    Displays anything that has to do with actors. Name Weapon, armor etc.
    Same for skills, items, weapons, armor, and enemies
    Has the option of animating the message window with 3 different directions

    Intructions:
    Place above blizzard's scripts, and below SDK and the RTP Scripts. Use the following
    commands in a message window:

    # Actor Message Commands #
    x = actor id
    \an[x] - Display an actors name - \n[x] can be used too
    \alevel[x] - Display an actors level
    \ahp[x] - Display an actors current hp
    \amaxhp[x] - Display an actors max hp
    \asp[x] - Display an actors current sp
    \amaxsp[x] - Display an actors max sp
    \aclass[x] - Display an actors class
    \aweapon[x] - Display an actors currently equipped weapon if one is equipped
    \ashield[x] - Display an actors currently equipped shield if one is equiiped
    \ahelmet[x] - Display an actors currently equipped helmet if one is equipped
    \aarmor[x] - Display an actors currently body armor if one is equipped
    \astr[x] - Display an actors current strength
    \adex[x] - Display an actors current dexterity
    \aagi[x] - Display an actors current agility
    \aint[x] - Display an actors current intelligence
    \aatk[x] - Display an actors current attack
    \apdef[x] - Display an actors current power defense
    \amdef[x] - Display an actors current magic defense

    # Skill Message Commands #
    x = skill id
    \sname[x] - Display a skills name
    \sdesc[x] - Display a skills description
    \scost[x] - Display a skills sp_cost

    # Item Message Commands #
    x = item id
    \iname[x] - Display an items name
    \idesc[x] - Display an items description
    \icost[x] - Display an items cost

    # Weapon Message Commands #
    x = weapon id
    \wname[x] - Display a weapons name
    \wdesc[x] - Display a weapons description
    \wcost[x] - Display a weapons cost

    # Armor Message Commands #
    x = armor id
    \aname[x] - Display an armors name
    \adesc[x] - Display an armors description
    \acost[x] - Display an armors cost

    # Enemy Message Commands #
    x = enemy id
    \ename[x] - Display an enemies name
    \ehp[x] - Display an enemies hp
    \esp[x] - Display an enemies sp
    \estr[x] - Display an enemies strength
    \edex[x] - Display an enemies dexterity
    \eagi[x] - Display an enemies agility
    \eint[x] - Display an enemies intelligence
    \epdef[x] - Display an enemies power defense
    \emdef[x] - Display an enemies magic defense
    \eexp[x] - Display an enemies experience given out when dead
    \egold[x] - Display an enemies gold given out when dead

    # Misc. Message Commands #
    x = event id
    \px - Display Player's X
    \py - Display Player's Y
    \ex[x] - Display an Events X
    \ey[x] - Display an Events Y

    =end



    module GameGuy
      module Message
        Animate = true # Animates the window from the direction you specify
        Direction = 1 # Choices are 0, or 2. 0 Animates it from the Left, 1 animates it from the right
      end
    end


    class Window_Message < Window_Selectable
     
      alias window_message refresh
     
      def refresh
        text = $game_temp.message_text
        #====================================================#
        # Everything that has to do with the map is below
        #====================================================#
       
        # Display Player X Coordinate with \px
        text.gsub!(/\\px/) do
          $game_player.x != nil ? $game_player.x : ""
        end
       
        # Display Player Y Coordinate with \py
        text.gsub!(/\\py/) do
          $game_player.y != nil ? $game_player.y : ""
        end
       
        # Display Events X Coordinate with \ex[x]
        text.gsub!(/\\ex\[([0-9]+)\]/) do
          $game_map.events[$1.to_i] != nil ? $game_map.events[$1.to_i].x : ""
        end
       
        # Display Events Y Coordinate with \ey[x]
        text.gsub!(/\\ey\[([0-9]+)\]/) do
          $game_map.events[$1.to_i] != nil ? $game_map.events[$1.to_i].y : ""
        end
        #====================================================#
        # Everything that has to do with Actors is below
        #====================================================#
       
        # Display Actor Name with \aname[x]
        text.gsub!(/\\[Aa][Nn]\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
        end
       
        # Display Actor Level with \alevel[x]
        text.gsub!(/\\[Aa]level\[([0-9]+)\]/) do
          $game_actors[$1.to_i].level != nil ? $game_actors[$1.to_i].level : ""
        end
       
        # Display Actor Current HP with \ahp[x]
        text.gsub!(/\\[Aa]hp\[([0-9]+)\]/) do
          $game_actors[$1.to_i].hp != nil ? $game_actors[$1.to_i].hp : ""
        end
       
        # Display Actor Max HP with \amaxhp[x]
        text.gsub!(/\\[Aa]maxhp\[([0-9]+)\]/) do
          $game_actors[$1.to_i].maxhp != nil ? $game_actors[$1.to_i].maxhp : ""
        end
       
        # Display Actor Current SP with \asp[x]
        text.gsub!(/\\[Aa]sp\[([0-9]+)\]/) do
          $game_actors[$1.to_i].sp != nil ? $game_actors[$1.to_i].sp : ""
        end
       
        # Display Actor Max SP with \amaxsp[x]
        text.gsub!(/\\[Aa]maxsp\[([0-9]+)\]/) do
          $game_actors[$1.to_i].maxsp != nil ? $game_actors[$1.to_i].maxsp : ""
        end
       
        # Display Actor Class with \aclass[x]
        text.gsub!(/\\[Aa]class\[([0-9]+)\]/) do
          $game_actors[$1.to_i].class_id != nil ? $data_classes[$game_actors[$1.to_i].class_id].name : ""
        end
       
        # Dislpay Actor Weapon with \aweapon[x]
        text.gsub!(/\\[Aa]weapon\[([0-9]+)\]/) do
          $game_actors[$1.to_i].weapon_id != nil ? $data_weapons[$game_actors[$1.to_i].weapon_id].name.to_s : ""
        end
       
        # Display Actor Shield with \ashield[x]
        text.gsub!(/\\[Aa]shield\[([0-9]+)\]/) do
          $game_actors[$1.to_i].armor1_id != nil ? $data_armors[$game_actors[$1.to_i].armor1_id].name.to_s : ""
        end
       
        # Display Actor Helemt with \ahelmet[x]
        text.gsub!(/\\[Aa]helmet\[([0-9]+)\]/) do
          $game_actors[$1.to_i].armor2_id != nil ? $data_armors[$game_actors[$1.to_i].armor2_id].name.to_s : ""
        end
       
        # Display Actor Armor with \aarmor[x]
        text.gsub!(/\\[Aa]armor\[([0-9]+)\]/) do
          $game_actors[$1.to_i].armor3_id != nil ? $data_armors[$game_actors[$1.to_i].armor3_id].name.to_s : ""
        end
       
        # Display Actor Accessory with \aaccessory[x]
        text.gsub!(/\\[Aa]accessory\[([0-9]+)\]/) do
          $game_actors[$1.to_i].armor4_id != nil ? $data_armors[$game_actors[$1.to_i].armor4_id].name.to_s : ""
        end
       
        # Display Actor Strength with \astr[x]
        text.gsub!(/\\[Aa]str\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].str : ""
        end
       
        # Display Actor Dexterity with \adex[x]
        text.gsub!(/\\[Aa]dex\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].dex : ""
        end
       
        # Display Actor Intelligence with \aint[x]
        text.gsub!(/\\[Aa]agi\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].int : ""
        end
       
        # Display Actor Agility with \aagi[x]
        text.gsub!(/\\[Aa]int\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].agi : ""
        end
       
        # Display Actor Attack with \aatk[x]
        text.gsub!(/\\[Aa]atk\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].atk : ""
        end
       
        # Display Actor Power Defense with \apdef[x]
        text.gsub!(/\\[Aa]pdef\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].pdef : ""
        end
       
        # Display Actor Magic Defense with \amdef[x]
        text.gsub!(/\\[Aa]pdef\[([0-9]+)\]/) do
          $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].mdef : ""
        end
       
        #====================================================#
        # Everything below has to do with Skills
        #====================================================#
       
        # Displays Skills Name with \sname[x]
        text.gsub!(/\\[Ss]name\[([0-9]+)\]/) do
          $data_skills[$1.to_i] != nil ? $data_skills[$1.to_i].name : ""
        end
       
        # Displays Skills Description with \sdesc[x]
        text.gsub!(/\\[Ss]desc\[([0-9]+)\]/) do
          $data_skills[$1.to_i] != nil ? $data_skills[$1.to_i].description : ""
        end
       
        # Displays Skills SP Cost with \scost[x]
        text.gsub!(/\\[Ss]cost\[([0-9]+)\]/) do
          $data_skills[$1.to_i] != nil ? $data_skills[$1.to_i].sp_cost : ""
        end
       
        #====================================================#
        # Everything below has to do with Items
        #====================================================#
       
        # Displays Items Name with \iname[x]
        text.gsub!(/\\[Ii]name\[([0-9]+)\]/) do
          $data_items[$1.to_i] != nil ? $data_items[$1.to_i].name : ""
        end
       
        # Displays Items Description with \idesc[x]
        text.gsub!(/\\[Ii]desc\[([0-9]+)\]/) do
          $data_items[$1.to_i] != nil ? $data_items[$1.to_i].description : ""
        end
       
        # Displays Items Cost with \icost[x]
        text.gsub!(/\\[Ii]cost\[([0-9]+)\]/) do
          $data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : ""
        end
       
        #====================================================#
        # Everything below has to do with Weapons
        #====================================================#
       
        # Displays Weapons Name with \wname[x]
        text.gsub!(/\\[Ww]name\[([0-9]+)\]/) do
          $data_weapons[$1.to_i] != nil ? $data_weapons[$1.to_i].name : ""
        end
       
        # Displays Weapons Description with \wdesc[x]
        text.gsub!(/\\[Ww]desc\[([0-9]+)\]/) do
          $data_weapons[$1.to_i] != nil ? $data_weapons[$1.to_i].description : ""
        end
       
        # Displays Weapons Cost with \wcost[x]
        text.gsub!(/\\[Ww]cost\[([0-9]+)\]/) do
          $data_weapons[$1.to_i] != nil ? $data_weapons[$1.to_i].price : ""
        end
       
        #====================================================#
        # Everything below has to do with Armors
        #====================================================#
       
        # Displays Armors Name with \aname[x]
        text.gsub!(/\\[Aa]name\[([0-9]+)\]/) do
          $data_armors[$1.to_i] != nil ? $data_armors[$1.to_i].name : ""
        end
       
        # Displays Armors Description with \adesc[x]
        text.gsub!(/\\[Aa]name\[([0-9]+)\]/) do
          $data_armors[$1.to_i] != nil ? $data_armors[$1.to_i].description : ""
        end
       
        # Displays Armors Cost with \acost[x]
        text.gsub!(/\\[Aa]cost\[([0-9]+)\]/) do
          $data_armors[$1.to_i] != nil ? $data_armors[$1.to_i].price : ""
        end
       
        #====================================================#
        # Everything below has to do with Enemies
        #====================================================#
       
        # Displays Enemies Name with \ename[x]
        text.gsub!(/\\[Ee]cost\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""
        end
       
        # Displays Enemies HP with \ehp[x]
        text.gsub!(/\\[Ee]hp\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].hp : ""
        end
       
        # Displays Enemies SP with \esp[x]
        text.gsub!(/\\[Ee]sp\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].sp : ""
        end
       
        # Displays Enemies Strength with \estr[x]
        text.gsub!(/\\[Ee]str\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].str : ""
        end
       
        # Displays Enemies Dexterity with \edex[x]
        text.gsub!(/\\[Ee]dex\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].dex : ""
        end
       
        # Displays Enemies Agility with \eagi[x]
        text.gsub!(/\\[Ee]agi\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].agi : ""
        end
       
        # Displays Enemies Intelligence with \eint[x]
        text.gsub!(/\\[Ee]int\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].int : ""
        end
       
        # Displays Enemies Power Defense with \epdef[x]
        text.gsub!(/\\[Ee]pdef\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].pdef : ""
        end
       
        # Displays Enemies Magic Defense with \emdef[x]
        text.gsub!(/\\[Ee]mdef\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].mdef : ""
        end
       
        # Displays Enemies Experience with \eexp[x]
        text.gsub!(/\\[Ee]exp\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].exp : ""
        end
       
        # Displays Enemies Gold with \egold[x]
        text.gsub!(/\\[Ee]gold\[([0-9]+)\]/) do
          $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].gold : ""
        end
       
        #====================================================#
        # Calls Old Window_Message Refresh
        #====================================================#
       
        # Call Old Window_Message refresh
        window_message
      end
    end

    #====================================================#
    # Updates Scene_Map to animate Window_Message
    #====================================================#

    class Scene_Map
     
      #====================================================#
      # Stores old def update
      #====================================================#
      alias re_update update
     
      #====================================================#
      # Run New Update
      #====================================================#
      def update
        if GameGuy::Message::Animate
          @message_window.update
          if $game_temp.message_window_showing
            if @message_window.x != 80
              if GameGuy::Message::Direction <= 0
                @message_window.x += 20
              elsif GameGuy::Message::Direction >= 1
                @message_window.x -= 20
              end
            end
            return
          else
            if GameGuy::Message::Direction == 0
              @message_window.x = -560
            elsif GameGuy::Message::Direction >= 1
              @message_window.x = 640
            end
          end
        end
        #====================================================#
        # Run Old Update
        #====================================================#
        re_update
      end
    end



    Instructions

    Place above blizzard's scripts, and below SDK and the RTP Scripts. Use the following
    commands in a message window:

    Intructions:
    Place above blizzard's scripts, and below SDK and the RTP Scripts. Use the following
    commands in a message window:

    # Actor Message Commands #
    x = actor id
    \an[x] - Display an actors name - \n[x] can be used too
    \alevel[x] - Display an actors level
    \ahp[x] - Display an actors current hp
    \amaxhp[x] - Display an actors max hp
    \asp[x] - Display an actors current sp
    \amaxsp[x] - Display an actors max sp
    \aclass[x] - Display an actors class
    \aweapon[x] - Display an actors currently equipped weapon if one is equipped
    \ashield[x] - Display an actors currently equipped shield if one is equiiped
    \ahelmet[x] - Display an actors currently equipped helmet if one is equipped
    \aarmor[x] - Display an actors currently body armor if one is equipped
    \astr[x] - Display an actors current strength
    \adex[x] - Display an actors current dexterity
    \aagi[x] - Display an actors current agility
    \aint[x] - Display an actors current intelligence
    \aatk[x] - Display an actors current attack
    \apdef[x] - Display an actors current power defense
    \amdef[x] - Display an actors current magic defense

    # Skill Message Commands #
    x = skill id
    \sname[x] - Display a skills name
    \sdesc[x] - Display a skills description
    \scost[x] - Display a skills sp_cost

    # Item Message Commands #
    x = item id
    \iname[x] - Display an items name
    \idesc[x] - Display an items description
    \icost[x] - Display an items cost

    # Weapon Message Commands #
    x = weapon id
    \wname[x] - Display a weapons name
    \wdesc[x] - Display a weapons description
    \wcost[x] - Display a weapons cost

    # Armor Message Commands #
    x = armor id
    \aname[x] - Display an armors name
    \adesc[x] - Display an armors description
    \acost[x] - Display an armors cost

    # Enemy Message Commands #
    x = enemy id
    \ename[x] - Display an enemies name
    \ehp[x] - Display an enemies hp
    \esp[x] - Display an enemies sp
    \estr[x] - Display an enemies strength
    \edex[x] - Display an enemies dexterity
    \eagi[x] - Display an enemies agility
    \eint[x] - Display an enemies intelligence
    \epdef[x] - Display an enemies power defense
    \emdef[x] - Display an enemies magic defense
    \eexp[x] - Display an enemies experience given out when dead
    \egold[x] - Display an enemies gold given out when dead

    # Misc. Message Commands #
    x = event id
    \px - Display Player's X
    \py - Display Player's Y
    \ex[x] - Display an Events X
    \ey[x] - Display an Events Y




    Compatibility

    I havent tested it with any other message systems but I think it'll work for Ccoa's UMS.


    Credits and Thanks


    • Game_guy for making it and adding tons of new features the normal message system doesnt have.
    • Enterbrain for making the default everything.
    • Special Thanks to StarrodKirby86, Landith, KingMunkey, Sally - For beta testing it



    Author's Notes

    Give proper credits, and comment about it. This is the final version. Maybe a few of ccoa's ums features might go in here who knows.

Sally


G_G


Calintz

This is gonna be promising I can tell.
This script wasn't made to do EVERYTHING, rather add-on to the default, right!?

This is a WIP yet, right?? It will be supported and progressed??

Sally

Quote from: Calintz16438 on March 21, 2009, 07:18:24 pm
This is gonna be promising I can tell.
This script wasn't made to do EVERYTHING, rather add-on to the default, right!?

This is a WIP yet, right?? It will be supported and progressed??


well i think that, when he says its compatable with other message systems its made to do extra functions.

Calintz

Right, but I am concerned whether or not this is gonna be continuously updated or not.

Landith

It will be, I was talking to game_guy while he was making it and he plans to add as many features as he can.

Calintz

Very nice...I look forward to the updates.

G_G

Yes it is being updated I have everything for Skills setup right now. I'm working on items. If you notice one of the features it says its being updated.

Database worthy by chance?

Calintz

Easy there game_guy. I saw the note, Lol, I was just confirming.
Will you take requests for features??

G_G

Like what? Depends if its possible. :P well when I say possible i mean possible for my scripting knowledge but request away and I'll see if I can do it.

Calintz

You see how you have the Weapon posted?? Well maybe whenever displaying the name of a weapon or item, the icon will display next to it?

G_G

Deja Voo O.o landith said the same thing I will try but no guarentees.

Calintz

That's fine...
Also, if you could add the left justify, center justify, and right justify to the message window, that would be awesome!!

G_G

if it matters this is compatible with Ccoa's

Calintz

Even so, I hate how her system automatically uses a different choice box than the default. I would like to remove her script if a message system comes out with ONLY the features I need, and not all the extra.

Shadonking

i agree with Calintz16438 there ccoa's layout for choices is rubish. plus there are loads of features that i wont use.

iv got a few features that would be cool.

an alert box (a message box that shows in the centre of the screen with fit box to text feature)
use picture as background (like ccoa's) but with more freedom of chaging the text position.
and letter by letter is a nice little feature (with skip, for those people that dont like to read the text).





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

G_G

*updates* The long awaited final version!!!!!!!!!!!!!! (Might still add some more features down the road but for the most part its the final version)

Sorry I havent found a successful way to display the icon next to the name. I might continue to work on trying to get it who knows. I might add some of ccoa's ums features in here.

Jackolas

was trying to get the icon into it myself...
was successful.. until I noticed that if you unequipped your gear the game crashed.

tried a lot of stuff but after 1 hour I found out that the error is also in the normal script:

Scrip "game_guy's Window_Message'line 168: NoMethodError occurred
undefined method 'name' for nil:NilClass

so the script work until you unequipped your gear :S

G_G

Well shit umm I'll try to fix it,but instead of placing the icon code next to the actors weapon place it where it says the weapons name where you can yse
\wname[1] that way it displays the weapons icon and name if you can