Chaos Project

RPG Maker => Tutorials => Tutorial Requests => Topic started by: Calintz on January 27, 2008, 01:05:02 pm

Title: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 01:05:02 pm
I'm always seeing all kinds of different CMS's everywhere, and I really want to make one of my own. However, I always run into a pretty big problem...I don't know how to properly organize one of these.

I do know that every >> class Window_""[/b] << needs it's own scene, to call it, correct?? Well, when I look at the way other people have organized their CMS's, they have both the >> class Window_"" << and it's proper scene in the CMS's script.

I was wondering if someone could make me a tutorial, not going into detail about how to make a CMS, but rather a list in order of what needs to be where...Like, do I need to make the window first, or it's scene...When do I call the Scene_Menu, and things like that...


Kudos in advance, and I know it sounds kinda like a bribe, but whoever completes this request for me, gets powered up!! I do this for everyone who completes a request for me.
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 01:13:59 pm
In fact, you can call any window for your scene that already exists. It's rather easy. This would be the template for it:

class Scene_MINE
 
  def main
    # intializing windows
    # some extra processing if you need it
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    # window disposal
    # some extra exit processing if you need it
  end
 
  def update
    # updating stuff and handling
  end
 
end


The best way to make a CMS is to copy the scene and the windows used. Then you simply rename the window classes and let your modified menu scene call them. Let your menu scene stay Scene_Menu, though, so it can override the original. Then start messing around with the window copies and watch what happens. That way you can make a CMS without fully understanding how everything works. You can learn scene creation later and advanced window handling later.

BTW, variables with $ before the identifier (or name) are global, that means EVERY class can see them. Variables with an @ can be seen only within the class itself, but they are "global" within that class. That's why people store windows in @something_window variables: To be able to acces them from other methods. The last ones are local variables which have only a name without any prefix. They are deleted (actually the reference is) if the execution exits the current method.

EDIT:

I don't see anything wrong with accomplish -> reward system. :P
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 01:16:02 pm
I know most of that, like creating a window itself. I do know how to do that, and I know how to add it to the menu, I just don't know what would go where inside a CMS script...

When you say copy the scene and it's windows used, you mean the regular Scene_Menu, and then copy Window_Item and all the rest??
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 01:26:19 pm
Creating an instance of a class (not just windows, this works in general):
@gold_window = Window_Gold.new


Window/Sprite/Bitmap disposal (not necessary for instances of other classes than windows and sprites, rarely necessary for bitmaps):
@gold_window.dispose


And yeah. Copy the code from the scene and then mess around like setting a line commented with a # in front (to "turn if off") and see what happens if that line is not executed.

EDIT:

To define what a window does and how it looks like, you can simply look at the code of that window and mess around with it. I suggest you really first try Window_Gold as it is the most simple.

class Window_Gold < Window_Base
  ...
end
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 01:31:54 pm
Ok, thank you...
I will begins farting around now... ;D

P.S. Looks like first come, first serve, Lol, and the Raging Snowstorm is powered up!!

Edit
I understood every line in Window_Gold, except for this one:
- cx = contents.text_size($data_system.words.gold).width...(What the heck is that "cx"??
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 02:13:21 pm
Just a temporary variable. I'll explain it.

$data_system.words.gold - the word for gold that you set up in the database
self.contents.text_size('TEXTSTRING') - a method that returns an instance of the class "Rect" which has the attributes x, y, width and height, it basically returns the rectangle needed to draw the text
rect.width - get the width value of the returned rectangle
cx = SOMETHING - store the result in the local variable called cx
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 03:27:27 pm
I see...
I have made minor modifications to the Default menu, and I will post it soon...
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 03:31:46 pm
In this case it's used the be able to draw text to look like as if it is draw with one command, but using different colors.
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 04:02:24 pm
I don't understand what you mean??
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 04:31:23 pm
(http://img125.imageshack.us/img125/8523/snap605pg4.th.png) (http://img125.imageshack.us/img125/8523/snap605pg4.png)

The EXP is drawn in a different color. That can only be done if first one color is selected, then the number drawn and the width of the number stored (i.e. in cx), then the color changed and the word EXP drawn with an offset which is equal to cx increased by i.e. 4.
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 04:40:59 pm
Alright, gotcha now!!

I want to add an option to your CMS, you don't have a problem with that!!??
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 04:43:45 pm
Nope.
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 04:56:23 pm
Ok cool...
So back to the topic...

So to make a CMS, simply copy Scene_Menu and all of it's windows, and paste them into one script above main. Then, tinker with their individual properties t'il you basically see fit, right??

I started a CMS, by doing this, and I joined the game statistic into one window kinda like you did in your CMS, but a little differently. I did this, by making a new window >> Window_GameStatistics, and copied the original 3 statistics' draw_text commands into one >>
Spoiler: ShowHide
#============================================================================
# ** Window_GameStatistics
#----------------------------------------------------------------------------
# This window will show all three of the basic game statistics in one window
# instead of three - (Gold, Playtime, and Steps taken)
#----------------------------------------------------------------------------
class Window_GameStatistics < Window_Base
 
  def initialize
    super(0, 0, 160, 150)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    cx = contents.text_size($data_system.words.gold).width
    self.contents.font.color = normal_color
    self.contents.draw_text(22, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(22-cx, 0, cx, 32, $data_system.words.gold, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(4, 28, 120, 32, "Time")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 28, 120, 32, text, 2)
    #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
    self.contents.font.color = system_color
    self.contents.draw_text(4, 54, 120, 32, "Steps")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 74, 12, 32, $game_party.steps.to_s, 2)
  end

end
<< and then just replaced their .disposes and .updates with >> Window_Gamestatistics.update etc...

In the end, this is what I made >>
Spoiler: ShowHide
(http://i212.photobucket.com/albums/cc283/Derek16438/RMXP%20Screenshots/untitled-2.png)


P.S. I added your TUT Viewer to the main menu  ;D
Title: Re: CMS Layout Tutorial...
Post by: Blizzard on January 27, 2008, 05:09:04 pm
Very nice. You're getting the grip of it. :)
Title: Re: CMS Layout Tutorial...
Post by: Nortos on January 27, 2008, 06:05:27 pm
doing well Calintz :) you should add location to your game statistics as well here' s the code from my menus location you can muddle with it to get what you want

class Window_Location < Window_Base
 
def initialize
  super(0, 0, 480, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = "Tahoma"
   self.contents.font.size = 14
   refresh
end

def refresh
   self.contents.clear
   data = load_data("Data/MapInfos.rxdata")
   self.contents.font.color = system_color
   self.contents.draw_text(0, 0, 248, 32, "Location:")
   self.contents.font.color = normal_color
   self.contents.draw_text(90, 0, 208, 32, data[$game_map.map_id].name, 2)
  end
end


btw when I was doing my CMS dubs scripting tut 3 was good help he gives basics of CMS's there
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 27, 2008, 06:24:01 pm
Lol, that's easy now seeing it, however I never would have guessed the actualt syntax used to call it!! :P Thnx Nortos...

- I just finished my edit of your CMS Blizzard, and this is what it looks like now:
Spoiler: ShowHide
(http://i212.photobucket.com/albums/cc283/Derek16438/RMXP%20Screenshots/CMSEdit.png)


- All that's left, is making new icon graphics for the index options, so there's some individuality to the usage of your CMS in my game, on par with the use of it in everyone else's games. ** I even remembered to make sure that when leaving the tutorial viewer, that the highlighted option is still located on it :)

!! Thnx Blizzard
Title: Re: CMS Layout Tutorial...
Post by: Calintz on January 30, 2008, 06:21:14 pm
Two things...
>> Can I animate that little guy in anyway possible, or would that cause unsightely lag??
>> Main Q >> How do I change the x position of menu_index options??
Title: Re: CMS Layout Tutorial...
Post by: Nortos on January 31, 2008, 12:26:37 am
answered your question somewhere else about the animated but for the X location you mean for Blizz's CMS or a different one, Blizz uses different syntax for his commands
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 01, 2008, 07:49:44 pm
Another few days, and My CMS should be out. Some tweaking for bells and whistles, and a little organizing is left.
Title: Re: CMS Layout Tutorial...
Post by: Sally on February 03, 2008, 10:28:03 pm
i wanna make my own inventory menu :P
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 03, 2008, 11:05:52 pm
I just did, Lol... ;)
Title: Re: CMS Layout Tutorial...
Post by: Spoofus on February 04, 2008, 12:24:57 am
made what item menu?
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 04, 2008, 01:10:16 am
Main Menu Index...Like 10 choices on it or so
Title: Re: CMS Layout Tutorial...
Post by: Spoofus on February 04, 2008, 01:52:24 am
oh it must be sexy looking  ;D
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 04, 2008, 02:53:48 am
Very!! Haha
Title: Re: CMS Layout Tutorial...
Post by: Spoofus on February 04, 2008, 04:38:36 am
ooooooooo makes me wanna >.> ....ooops there is minors here...yall hehe ;D
so why dont ya send me a peek huh huh c'mon you know you wanna
Title: Re: CMS Layout Tutorial...
Post by: Sally on February 04, 2008, 06:33:31 am
give us a screenshot ^^
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 04, 2008, 06:12:30 pm
Alright hold up...
I haven't dicked with the layout yet, so it's standard, but I did fool with the menu index, and the Game Statistics window...This script is just getting it's feet off the ground. I haven't added the options selection yet, so there are only 9 currently, but soon there will be 10

Spoiler: ShowHide
(http://i212.photobucket.com/albums/cc283/Derek16438/RMXP%20Screenshots/untitled.png)
Title: Re: CMS Layout Tutorial...
Post by: Spoofus on February 05, 2008, 02:01:41 pm
mmmmmm.. thats a good start there man this will be one good menu
Title: Re: CMS Layout Tutorial...
Post by: Mechis101 on February 17, 2008, 01:32:41 pm
OMG ARE ALL OF THESE FREAKING FORUMS DEAD WHERE THE HELL IS EVERYONE I NEED HELP SOMEONE GO TO TUTORIALS OR TUTORIAL REQUESTS AND HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SORRY ABOUT THAT IM KINDA PEEVED!
Title: Re: CMS Layout Tutorial...
Post by: Calintz on February 17, 2008, 11:49:57 pm
Why are you posting that crap here...
Take your problems somewhere else.
Title: Re: CMS Layout Tutorial...
Post by: Sally on February 18, 2008, 12:23:00 am
make your own topic omg.. newb :P
Title: Re: CMS Layout Tutorial...
Post by: Nortos on February 18, 2008, 12:36:10 am
he has and people hadn't responded to it I just did yesterday but it took a while so he was frustrated