Author Topic: CMS Layout Tutorial...  (Read 5831 times)

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
CMS Layout Tutorial...
« on: January 27, 2008, 08: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.
« Last Edit: January 27, 2008, 08:06:35 PM by Calintz16438 »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #1 on: January 27, 2008, 08: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:

Code: [Select]
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
« Last Edit: January 27, 2008, 08:15:15 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #2 on: January 27, 2008, 08: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??
« Last Edit: January 27, 2008, 08:18:51 PM by Calintz16438 »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #3 on: January 27, 2008, 08:26:19 PM »
Creating an instance of a class (not just windows, this works in general):
Code: [Select]
@gold_window = Window_Gold.new
Window/Sprite/Bitmap disposal (not necessary for instances of other classes than windows and sprites, rarely necessary for bitmaps):
Code: [Select]
@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.

Code: [Select]
class Window_Gold < Window_Base
  ...
end
« Last Edit: January 27, 2008, 08:29:30 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #4 on: January 27, 2008, 08: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"??
« Last Edit: January 27, 2008, 08:37:57 PM by Calintz16438 »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #5 on: January 27, 2008, 09: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
« Last Edit: January 27, 2008, 09:15:05 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #6 on: January 27, 2008, 10:27:27 PM »
I see...
I have made minor modifications to the Default menu, and I will post it soon...

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #7 on: January 27, 2008, 10: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.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #8 on: January 27, 2008, 11:02:24 PM »
I don't understand what you mean??

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #9 on: January 27, 2008, 11:31:23 PM »


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.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #10 on: January 27, 2008, 11:40:59 PM »
Alright, gotcha now!!

I want to add an option to your CMS, you don't have a problem with that!!??

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #11 on: January 27, 2008, 11:43:45 PM »
Nope.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #12 on: January 27, 2008, 11: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 >>
(click to show/hide)
<< and then just replaced their .disposes and .updates with >> Window_Gamestatistics.update etc...

In the end, this is what I made >>
(click to show/hide)

P.S. I added your TUT Viewer to the main menu  ;D

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20015
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: CMS Layout Tutorial...
« Reply #13 on: January 28, 2008, 12:09:04 AM »
Very nice. You're getting the grip of it. :)
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: CMS Layout Tutorial...
« Reply #14 on: January 28, 2008, 01:05:27 AM »
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
Code: [Select]
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
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #15 on: January 28, 2008, 01:24:01 AM »
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:
(click to show/hide)

 - 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
« Last Edit: January 28, 2008, 01:25:08 AM by Calintz16438 »

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #16 on: January 31, 2008, 01:21:14 AM »
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??

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: CMS Layout Tutorial...
« Reply #17 on: January 31, 2008, 07: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
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #18 on: February 02, 2008, 02:49:44 AM »
Another few days, and My CMS should be out. Some tweaking for bells and whistles, and a little organizing is left.

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: CMS Layout Tutorial...
« Reply #19 on: February 04, 2008, 05:28:03 AM »
i wanna make my own inventory menu :P

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #20 on: February 04, 2008, 06:05:52 AM »
I just did, Lol... ;)

Offline Spoofus

  • CP's Lovable Turtle
  • Astral Trancist
  • *****
  • Posts: 818
  • LV: 19
  • Gender: Male
    • View Profile
Re: CMS Layout Tutorial...
« Reply #21 on: February 04, 2008, 07:24:57 AM »
made what item menu?


My Blog site I am working on: http://spoofus.weebly.com/

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #22 on: February 04, 2008, 08:10:16 AM »
Main Menu Index...Like 10 choices on it or so

Offline Spoofus

  • CP's Lovable Turtle
  • Astral Trancist
  • *****
  • Posts: 818
  • LV: 19
  • Gender: Male
    • View Profile
Re: CMS Layout Tutorial...
« Reply #23 on: February 04, 2008, 08:52:24 AM »
oh it must be sexy looking  ;D


My Blog site I am working on: http://spoofus.weebly.com/

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #24 on: February 04, 2008, 09:53:48 AM »
Very!! Haha

Offline Spoofus

  • CP's Lovable Turtle
  • Astral Trancist
  • *****
  • Posts: 818
  • LV: 19
  • Gender: Male
    • View Profile
Re: CMS Layout Tutorial...
« Reply #25 on: February 04, 2008, 11: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


My Blog site I am working on: http://spoofus.weebly.com/

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: CMS Layout Tutorial...
« Reply #26 on: February 04, 2008, 01:33:31 PM »
give us a screenshot ^^

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #27 on: February 05, 2008, 01:12:30 AM »
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

(click to show/hide)
« Last Edit: February 05, 2008, 01:19:53 AM by Calintz16438 »

Offline Spoofus

  • CP's Lovable Turtle
  • Astral Trancist
  • *****
  • Posts: 818
  • LV: 19
  • Gender: Male
    • View Profile
Re: CMS Layout Tutorial...
« Reply #28 on: February 05, 2008, 09:01:41 PM »
mmmmmm.. thats a good start there man this will be one good menu


My Blog site I am working on: http://spoofus.weebly.com/

Mechis101

  • Guest
Re: CMS Layout Tutorial...
« Reply #29 on: February 17, 2008, 08: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!
« Last Edit: February 17, 2008, 08:34:34 PM by Mechis101 »

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: CMS Layout Tutorial...
« Reply #30 on: February 18, 2008, 06:49:57 AM »
Why are you posting that crap here...
Take your problems somewhere else.

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: CMS Layout Tutorial...
« Reply #31 on: February 18, 2008, 07:23:00 AM »
make your own topic omg.. newb :P

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: CMS Layout Tutorial...
« Reply #32 on: February 18, 2008, 07: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
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources