Jump to content
New account registrations are disabed. This website is now an archive. Read more here.

Leon

Legend
  • Content Count

    1,713
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by Leon

  1. I recommend deleting this one and starting from stratch, if that is the case.
  2. I dont know, I like a little extra security. My brother got on my old RmXP World account and made it hell for me to get along with anyone after that.
  3. Sweet, Sweet victory. By the way, DD, as promised, my bill for Tylenol. It comes out to $53.38. Cough it up. xD
  4. The paragraphed method has problems with certain fonts and will squish the lettering of them. I found that aspect of the script quite... unappealing.
  5. Ok, here is a revamp of my first script. I went out strong, and kept pumping out new scripts, but this has been my most used script. It still suprises me that people request it, even though it has been created. The instructions are in the header: #=================================== # Leon's Mission Script v2.0 #---------------------------------------------------------------------- # 2006-09-22 #=================================== =begin Description: I did a drastic overhaul on this Mission/Quest script to make it much better and user friendly. Features: There is 2 new features: 1. If the user doesn't know of the mission, it doesn't appear in the list, nor does a slot for it. 2. Completed missions are in green. 3. Number of missions. (X/Y) X is completed missions, Y can be either known missions, or your game's total missions. Set Mission_Setup to 'true' if you want known missions, false for total. Instructions: Put it above main. The instructions have changed alot more than the features. Just go through the short list below, and you'll know. Just remember, go in order, and if you have 10 different missions in 1 spot, you must have the same number in each other segment of the module, with the exception of the lines of text. (Yes, i made that one all the easier.) Changing the status of the missions is different than before as well. $game_party.mission[mission_id] = x Mission ID: The ID of the mission, as defined in the module. In this example, "Lost Cat" would be 0 X: 1 = they do not know the mission exists. This is optional, unless they forget a mission. 2 = they know the mission, but it is incomplete 3 = the mission is complete. BY DEFAULT, ALL MISSIONS ARE UNKNOWN unless specified in the script before the game begins. Do NOT post my work in any other forums without my permission, and NEVER take credit for my work. =end #================================== # ** Mission_Menu #================================== module Mission_Menu #-------------------------------------------------------------------- # * Mission Name- Write the mission number, and the name you want to appear. # ~ mission_id => "mission name" #-------------------------------------------------------------------- Mission_Name = { 0 => "Lost Cat", 1 => "Old Blade", 2 => "Seize Sentries", 3 => "Hidden Heirloom", 4 => "A Gooey Mess.", 5 => "Hidden Horror" } #-------------------------------------------------------------------- # * Mission_Sprite. holds data on the name of the sprite, it's hue, name, locale, and # * reward all in one. # ~ mission_id => ["sprite name", hue, name, location, Reward] #-------------------------------------------------------------------- Mission_Sprite = { 0 => ["113-Civilian13", 330, "Amy", "Logres", "Potion x 3"], 1 => ["005-Fighter05", 0, "L'eric", "Logres", "Rusty Sword"], 2 => ["002-Fighter02", 0, "Wallace", "Resistance H.Q.", "500 Gold"], 3 => ["122-Civilian22", 30, "Old Woman", "Cyris Home", "Sound Effect"], 4 => ["011-Lancer03", 0, "Soldier", "Cyris Barracks", "Kite Shield"], 5 => ["006-Fighter06", 0, "Lady", "Cyris", "Lion's Head Earring"] } #-------------------------------------------------------------------- # * Defines the mission. Remember, if it is too long for 1 line, you can drop it # * down to line 2. # ~ mission_id => "Line One" #-------------------------------------------------------------------- Mission_L1 = { 0 => "Amy has lost her cat and needs help", 1 => "Somebody said they saw L'eric's blade", 2 => "Head north toward enemy territory, and", 3 => "Seek out the caverns south of Cyris. There", 4 => "A monster to the west of the town every", 5 => "Somewhere in the Belin Caverns, there is a" } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Two" #-------------------------------------------------------------------- Mission_L2 = { 0 => "finding him. He likes to play in the", 1 => "just south of here by the river. He ", 2 => "capture two sentry towers. Be careful ", 3 => "you will find a blue chest. Retrieve its", 4 => "now and then terrorizes the caravans.", 5 => "creature holding an item the lady in" } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Three" #-------------------------------------------------------------------- Mission_L3 = { 0 => " North East side of Tiberian Plains.", 1 => "wants Will to confirm the story, and", 2 => "and don't get caught. Return to Wallace", 3 => "contents and bring it back to the old", 4 => "A soldier in the barracks has asked you", 5 => "Cyris is looking for. She said the monster" } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Four" #-------------------------------------------------------------------- Mission_L4 = { 1 => "if it is true, bring back the sword.", 2 => "once this job is complete.", 3 => "woman.", 4 => "to exterminate it.", 5 => "would be hiding." } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Five" #-------------------------------------------------------------------- Mission_L5 = { } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Six" #-------------------------------------------------------------------- Mission_L6 = { } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Seven" #-------------------------------------------------------------------- Mission_L7 = { } #-------------------------------------------------------------------- # * Same as the above one. # ~ mission_id => "Line Eight" #-------------------------------------------------------------------- Mission_L8 = { } #-------------------------------------------------------------------- # * Mission Set-up #-------------------------------------------------------------------- Mission_Setup = true end #---------------------------------------------------------------------- # * Game_Party #---------------------------------------------------------------------- class Game_Party #-------------------------------------------------------------------- # * Attributes #-------------------------------------------------------------------- attr_accessor :mission #-------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------- alias leon_gp_mission_initialize initialize #-------------------------------------------------------------------- # * Object initialization #-------------------------------------------------------------------- # Leon_Edit add an array for each mission in @mission. # [mission_id, 1] #-------------------------------------------------------------------- def initialize leon_gp_mission_initialize @mission = { 0 => 1, 1 => 2, 2 => 3, 3 => 2 } end end #-------------------------------------------------------------------- # * Ends Game_Party #-------------------------------------------------------------------- #---------------------------------------------------------------------- # * Window_Missionhelp #---------------------------------------------------------------------- class Window_Missionhelp < Window_Base #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize super(0, 0, 400, 60) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------- # * Update #-------------------------------------------------------------------- def update(help_text) self.contents.clear self.contents.draw_text(0, 0, 440, 32, help_text) end end #---------------------------------------------------------------------- # * End Window_Missionhelp #---------------------------------------------------------------------- #---------------------------------------------------------------------- # Window_MissionNum #---------------------------------------------------------------------- class Window_MissionNum < Window_Base #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize super(400, 0, 240, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------- def refresh self.contents.clear mis = Mission_Menu self.contents.font.color = system_color self.contents.draw_text(0, 0, 120, 32, "Missions:") self.contents.font.color = normal_color @mission_comp = [] @mission_know = [] #Calls Mission number of completed missions for i in 0...$game_party.mission.keys.size if $game_party.mission[$game_party.mission.keys[i]] == 3 @mission_comp.push(i) end end #Calls Mission number of missions for j in 0...$game_party.mission.keys.size if $game_party.mission[$game_party.mission.keys[j]] > 1 @mission_know.push(j) end end #if Mission_Setup is false... if mis::Mission_Setup == false if @mission_comp.size == $game_party.mission.size self.contents.font.color = Color.new(40, 250, 40, 255) self.contents.draw_text(0, 0, 208, 32, @mission_comp.size.to_s + "/" + $game_party.mission.size.to_s, 2) self.contents.font.color = normal_color else self.contents.draw_text(0, 0, 208, 32, @mission_comp.size.to_s + "/" + $game_party.mission.size.to_s, 2) end #if Mission_Setup is true... elsif mis::Mission_Setup == true if @mission_comp.size == @mission_know.size self.contents.font.color = Color.new(40, 250, 40, 255) self.contents.draw_text(0, 0, 208, 32, @mission_comp.size.to_s + "/" + @mission_know.size.to_s, 2) self.contents.font.color = normal_color else self.contents.draw_text(0, 0, 208, 32, @mission_comp.size.to_s + "/" + @mission_know.size.to_s, 2) end end end end #---------------------------------------------------------------------- # * End Window_Missionnum #---------------------------------------------------------------------- #---------------------------------------------------------------------- # Window_Missionlist #---------------------------------------------------------------------- class Window_Missionlist < Window_Selectable #-------------------------------------------------------------------- # * Attribute listings #-------------------------------------------------------------------- attr_accessor :mission #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize super(0, 60, 260, 420) self.contents = Bitmap.new(width - 32, height - 32) self.index = 0 refresh end #-------------------------------------------------------------------- # * Mission #-------------------------------------------------------------------- def mission return @data[self.index] end #-------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end mis = Mission_Menu @data = [] for i in 0...$game_party.mission.keys.size if $game_party.mission[$game_party.mission.keys[i]] > 1 @data.push($game_party.mission.keys[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------- # * Draw_Item #-------------------------------------------------------------------- def draw_item(index) mis = Mission_Menu mission_name = @data[index] x = 4 y = index * 32 rect = Rect.new(x, y, self.width - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) if $game_party.mission[mission_name] == 3 self.contents.font.color = Color.new(40, 250, 40, 255) self.contents.draw_text(x, y, 228, 32, mis::Mission_Name[mission_name]) else self.contents.font.color = normal_color self.contents.draw_text(x, y, 228, 32, mis::Mission_Name[mission_name]) end end end #---------------------------------------------------------------------- # * End Window_Missionlist #---------------------------------------------------------------------- #---------------------------------------------------------------------- # Window_Missioncomp #---------------------------------------------------------------------- class Window_Missioncomp < Window_Base #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize(mission) super(260, 365, 380, 115) self.contents = Bitmap.new(width - 32, height - 32) refresh(mission) end #-------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------- def refresh(mission) self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, 52, 440, 32, "Status:") self.contents.draw_text(170, 52, 440, 32, "Reward:") self.contents.font.color = normal_color #person place status reward mis = Mission_Menu if mis::Mission_Sprite.has_key?(mission) if $game_party.mission[mission] > 1 self.contents.draw_text(36, 6, 440, 32, mis::Mission_Sprite[mission][2] + ", " + mis::Mission_Sprite[mission][3]) case $game_party.mission[mission] when 1 self.contents.draw_text(62, 52, 400, 32, "") when 2 self.contents.draw_text(62, 52, 400, 32, "Incomplete") self.contents.draw_text(242, 52, 138, 32, "Unknown") when 3 self.contents.font.color = Color.new(40, 250, 40, 255) self.contents.draw_text(62, 52, 400, 32, "Complete") self.contents.draw_text(242, 52, 138, 32, mis::Mission_Sprite[mission][4]) end bitmap = RPG::Cache.character(mis::Mission_Sprite[mission][0], mis::Mission_Sprite[mission][1]) cw = bitmap.width / 4 ch = bitmap.height / 4 facing = 0 src_rect = Rect.new(0, facing * ch, cw, ch) self.contents.blt(0, 0, bitmap, src_rect) end end end def clear self.contents.clear end end #-------------------------------------------------------------------- # * Ends Window_Missioncomp #-------------------------------------------------------------------- #---------------------------------------------------------------------- # Window_Missiondesc #---------------------------------------------------------------------- class Window_Missiondesc < Window_Base #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize(mission) super(260, 60, 380, 305) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------- def refresh(mission) self.contents.clear mis = Mission_Menu self.contents.draw_text(0, 0, 348, 32, mis::Mission_L1[mission].to_s) self.contents.draw_text(0, 32, 348, 32, mis::Mission_L2[mission].to_s) self.contents.draw_text(0, 64, 348, 32, mis::Mission_L3[mission].to_s) self.contents.draw_text(0, 96, 348, 32, mis::Mission_L4[mission].to_s) self.contents.draw_text(0, 128, 348, 32, mis::Mission_L5[mission].to_s) self.contents.draw_text(0, 160, 348, 32, mis::Mission_L6[mission].to_s) self.contents.draw_text(0, 192, 348, 32, mis::Mission_L7[mission].to_s) self.contents.draw_text(0, 224, 348, 32, mis::Mission_L8[mission].to_s) end end #-------------------------------------------------------------------- # * Ends Window_Missiondesc #-------------------------------------------------------------------- #==================================== # Scene_MissionMenu #==================================== class Scene_MissionMenu #-------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------- # * Main #-------------------------------------------------------------------- def main @missionhelp_window = Window_Missionhelp.new @missionlist_window = Window_Missionlist.new @missionnum_window = Window_MissionNum.new @missioncomp_window = Window_Missioncomp.new(@missionlist_window.mission) @missiondesc_window = Window_Missiondesc.new(@missionlist_window.mission) @mission = @missionlist_window.mission @missiondesc_window.refresh(@missionlist_window.mission) @missioncomp_window.refresh(@missionlist_window.mission) Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @missionhelp_window.dispose @missiondesc_window.dispose @missioncomp_window.dispose @missionlist_window.dispose @missionnum_window.dispose end #-------------------------------------------------------------------- # * Update #-------------------------------------------------------------------- def update mis = Mission_Menu @missionlist_window.update @missionnum_window.update @missionhelp_window.update("Select a mission to see details.") if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) @missiondesc_window.refresh(@missionlist_window.mission) @missioncomp_window.refresh(@missionlist_window.mission) end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new end end end #-------------------------------------------------------------------- # * Ends Scene_Missionmenu #--------------------------------------------------------------------
  6. DD- your noob speak gives me a headahe. I am sending you my bill for all the Tylenol You have cost me.
  7. Marked has his own life to live, as do we, and he should be able to chart its course. Perhaps he is planning to steer away from the Internet a little only to venture into something unknown to use. Let us part with our Captain in a happy way. Drink up, me mateys! Yo ho!
  8. Why doesn't he just give you his account, and you log in on that one, change his user name and pass, and that would be it.
  9. Yeah, that was probably from going from Unicode to ASCII. Thank you for letting me know, I'll fix it asap. EDIT: It is actually a problem with the BB Code tags... I am going to have to change the way it is posted...
  10. It is possible to do it, but I am not up to it at the time. I am a little busy with some other things going on. As for using them, go on ahead, I don't mind.
  11. Ok, we have gone over everything with in Window_Base, and a good bulk in Window_Selectable, so now we must go over Scenes, which includes Window_Command. Now, personally, I don't use Window_Command very often, but it is very useful. Every now and then, I do use it. Anyway, here we go. Now, there is one thing Window_Selectable can do, that Window_Command doesn't. That is making more than one column. Since I use columns, I don't like using Window_Command. But, there are some advantages as well. For instance, they are drawn up a LOT faster than Window_Selectable, and you can make options disabled a lot easier as well. Anyway, you use these in a scene, so why don't we build a scene with a Window_Command inside of it? This way, we kill two birds with a stone. ...Poor birds... Anyway, Scenes are still a member of the whole 'Object' class that almost everything is built. But, we must adhere to some specifics to this scene. For instance, not every Scene uses the method 'initialize', but by using it, you can call in information. There are some tricks I will teach you, but first, the structure. The structure of a scene is super-basic: Initialize (if you need to call in something like the actor's information.) Main (Where all variables are initialized.) Update (Where the scene constantly updates.) Now, this sounds alot like a window! But, there is a catch, if we put the whole scene's works in the 'update' method, we'll begin to lag, which is bad, so we split it up into other methods. (One of my latest scripts has about 9 or 10 methods for one scene.) The upside to splitting a scene into so many methods is it is easier to manage. Ok, let's get into the nitty-gritty of each method in detail, and I'll show you how to do things. As with all things, we start with the beginning; Initialize. Initialize Here we are, at the beginning. The initialize method of a scene may, on the surface, look like 'ok, i am going to define the scene, like the initialize method id's windows. WRONG! Don't feel bad though, that was good logic, and i thought the same thing at first. Anyway, the only time you really use initialize with a scene is if you have to call in information. For example, if it is a status screen, you need to call in the actor. NOTE: To call a scene, you MUST use: $scene = Scene_Name.new Now, the way it works is: class Scene_Name def initialize(actor_index = 0) @actor_index = actor_index end NOTE: I didn't add the last end. As you see, it looks similar to when we call in information to a window... but we added a '= 0' at the end. What this means is if this window is called, but there is no parentheses with a number inside of it, it will automatically equal 0. Nifty, no? Now, the information we call here is a number, but it can call in any variable. Granted, with this, we'll probably be calling a number where the actor is in the party. This, by default is 0-3 (1, 2, 3, 4). Don't worry if you feel confused. By the end, you should understand this. If not, go to the Question and Answer section, and I can answer anything, and amend this. Back on topic! Next, we take that local variable actor_index, and make an instance variable equal it. Now, we have a variable that will equal whatever value is called in. This is important for scenes that need information. It is easy to do, but may seem confusing now. It may be best to come back to this during a review. That reminds me, take notes, your review and test deal with making a scene. By the end of this Lesson (lesson 2), you can make your own status scene, along with a couple others. But, this covers the 'initialize' method, shall we move on? Main This is where we identify the variables, and look the 'update' method. This is where things get cool. First, we'll take a look at what we did before with the whole 'initialize' thing. If you have a variable like that one, that has to be an actor, you can do this: @actor = $game_party.actors[@actor_index] Since in a CMS you will pre-plan things, you cannot get a bad value unless you screw up. Hopefully, you won't do that. But, let's look at a scene's structure for 'main': def main @actor = $game_party.actors[@actor_index] s1 = "Line 1" s2 = "Line 2" s3 = "Line 3" s4 = "Line 4" @other_window = Window_Other.new @actor_needed_window = Window_Actor.new(@actor) @command_window = Window_Command.new(192, [s1, s2, s3, s4]) Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose end Here we go, alot of new stuff. First, we have our @actor = thing that i discussed earlier. Then, the following s1-s4 bit is all making local variables. Following that, we have a window that we have named @other_window. This calls just a basic window. (The variable name you give a window doesn't matter, just make it an instance variable.) After that, a window that has a set of parentheses by the initialize method, so we add our own here in the scene, and put in @actor, because this 'Actor' window shows actor information. (We are assuming this window exists. Assuming we drew up this window earlier, and that it will draw actor information.) Then we have the next big step. @command_window = Window_Command.new(192, [s1, s2, s3, s4]). We'll come back to the Graphics bit, i want to explain the Window Command. With other windows, you made them in a separate class, this one, you call the window straight up, then it has 2 preconditions: (width, [options]). In this case, we ID'ed the options, and put the variable names in, and the width is 192. After taht, you can change it's location from (0, 0) by doing the following: @command_window.x = x (Moves the window to the right 'x' pixels.) @command_window.y = y (Moves the window down 'y' pixels.) @command_window.z = z (For layering. If this window is at the same place of another, and you want this on top, it needs a higher 'z' value.) @command_window.height = ly (Sets the length of the window, set this equal to a multiple of 32) @command_window.opacity = x (Sets the opacity of the window. 0 is transparent.) @command_window.active = true/false (Makes the window active/inactive) @command_window.visible = true/false (Shows/hides the window.) @command_window.index = 0 (Sets the cursor of the window.) @command_window.disable_item(x) Disables the item at the 'x' position. The great thing is the 'disable_item'. This comes in handy for options you dont want the player to use unless they meet a specific requirement. To do this, we use an if statement. For example, in the default Scene_Menu, you have: if $game_system.save_disabled @command_window.disable_item(4) end This means if $game_system.save_disabled is true, it disables item number 5 (0, 1, 2, 3, 4) which is 'Save game'. It is pretty sweet. Pretty much, everything is done for you in teh way of 'building' the options window, but you don;'t have a whole lot of freedom with it. For instance, you can't make multiple columns. But, on to the 'Graphics' information: Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose end This is the basic thing in every scene. I'll explain it, but you don't need to know it in detail, really. Graphics.transition means it will execute the transition, then loops, updating the graphics and input modules,(NOTE: A module is just something that holds generic information for the game. Alot like a constant variable, but more versitle.) then calls the update method, and checks if $scene still equals this scene. If not, it will break the loop, freeze the graphics for a second, and disposes whatever you define to be disposed (which should be all windows, pictures, etc.) Now, we have covered teh initialization, and the main methods. This is where things get tricky. You need to know different commands to make a scene work, and basic commands. You will need to know, mainly, the Input module, if statements, and other things. I will teach you the basic ones, so you can make a basic scene, but nothing really fancy yet. We will have to examine other classes first. I will, however, teach you the basics right now: if case Input return $game_system.se_play That is all you will need to know to make a basic scene. sound simple enough? Well, I'll explain how each works, then you can fiddle with it. Just remember: The best way to learn is look at examples. if Ok, with if, you have 3 different keywords to work with: if, elsif, and else. The way these work is rather simple: if (statement) == x trigger a elsif (statement) == y trigger b else trigger c end Basically, if is the initial statement, elsif means if the same thing equals something else, and else means if the if isnt true, it will go to that instead. Granted, you could just use if, without elsif or else, and you can make one with only using if and else. There is also specific things you must remember about if statements, the 'conditions'. These comparison statements compatable with 'if' are: == equals != or <> does not equal <= is less than or equal to. >= is greater than or equal to. The opposite of if is unless, and is used in the same fashion, but kind of reverse. Sort of like: unless baby? feed_meat else feed_milk end so unless it is a baby, you do would feed it meat, else you would feed it milk. That is if and unless. Next: case case Ok, this is a fun thing here, It is like an if statement with a ton of options. It's structure is: case variable when 0 if it equals 0, trigger. when 1 if it equals 1, trigger. when 2 if it equals 2, trigger. else if it equals none of the above, trigger. end Ok, that is how it works. if the variable equals 0, it will trigger that first one, if 2, it will trigger the one that says 'when 2'. If it is 7, it will trigger the 'else' statement. Now, let's say you want to do something based on age: case $age when 0 .. 2 p "baby" when 3 .. 6 p "little child" when 7 .. 12 p "child" when 13 .. 18 p "youth" else p "adult" end Case statement doesn't need a whole lot of explaination, but the '..' means from 0..2 it will be a baby. if it is 13 .. 18, it will be a youth. See how that works? Next! Input This is a module built into the game. It is used to identify the keys used in the game when pressed. For a basic scene, you only need to concern yourself with 'B' and 'C', but there are many others. to use this, we use an if statement to see if it was pressed. The best thing is you dont have to check if it is true, that is automatic. To do this, we use: if Input.trigger?(Input::C) This goes into the module 'Input', to the 'trigger' command, to see if the the input is 'C'. The different buttons are: A, B, C, X, Y, Z, L, R, DOWN, LEFT, RIGHT, UP, SHIFT, CTRL, ALT, F5, F6, F7, F8, F9 All of those are different buttons you can use. Just remember, they must all be capped. So, you can use: Input.trigger?(Input::SHIFT) to see if shift has been hit. Now, in addition to different keys, there is also different types of pressing a key. After the first Input, use: .press? means the button is being held down. .trigger? means the button was pressed down once. .repeat? Checks if it was pressed multiple times. Next, you have the parentheses, where you put: (Input:: B) , B being the button. return return takes you back to the beginning of the method, if not followed by something. If it is followed by a variable, every time that method is called, it will bring back the value of the variable. This is nice after putting in the input button, because it stops the processing of the method, and goes right back to teh beginning THAT frame. $game_system.se_play() This right here, will play a sound effect that is defined in the parentheses. The most common to put in the parentheses are: $data_system.cancel_se $data_system.decision_se $data_system.buzzer_se These are all defined in the database, and are standardized through the menus in the game. They are pretty self explainitory: cancel is used for the 'B' button, decision is used for the 'C' button, and buzzer is used whenever an action isn't allowed. Ok, so we went through a LOT of information. In the review, we will take alot of this information, and build a simple scene together. After that, try to build your own scenes for a while, until Lesson III, when we get into the default scripts and how to utilize their powers, including adding actor information, party information, system information, and so forth. Until then, you can still toy around with building a scene, and I encourage that. Again, don't forget, you must call a scene using: $scene = Scene_Name.new Til the review, adios!
  12. this is rather easy to do, go into the scripts in your game, into Window_Base Next, find the line that says : def normal_color Under that, you will find: return Color.new(255, 255, 255, 255) Now, the way this works is in Color.new(Red, Green, Blue, Alpha) Just change the numbers from 0-255 and it will change the color of your font. Alpha is the transparency.
  13. Leon

    State Police Warning

    This was issued out about 6-8 months ago, and was broadcast widely through Utah, as well. It's validity, however, I am not 100% sure. But, better yo be safe than sorry.
  14. Well, welcome to the site. If you have any questions pertaining to the project, I am sure someone here can help.
  15. It would be nice to see a labyrinth game based on the Wizardry series. I thought I was the last man who played it. I have never played Lufia, but I am a fan of the SNES
  16. I'll have to check this out...
  17. Well man, I always say there is no such thing as 'good bye'. So, see you later!
  18. Ok, if you guys have any questions, here is the place to ask them, and I will answer them.
  19. All right, we have made some progress with Window_Base. There was one thing someone asked, so I think I'll clear that up first: The correct structure of a 'Window_Base' window, much like the status window, would be: class Window_Status < Window_Base def initialize(actor) super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 22 @actor = actor update end def update self.contents.clear # Insert commands for whatever you want here. # This includes stats, names, labels, and even text colors. end end Not too hard, eh? Yeah, that also has the parentheses there too, at the initialize method. This means, when we call it, we need a variable there. For something like the status window, we want an actor as a variable. For testing, we would use: $game_party.actors[0] This is because it will call up the array of actors in the party, and the first actor (0 position actor) into the window. Also, don't forget to add the 'update' to call the update method. Many forget this... including me. Believe it or not, you can make a status window by now, if you want to give it a try. Now, with that out of the way, how about we look at the methods we can use for Selectable, eh? Initialize tells us it adds @item_max, @column_max, and @index. Now, not many of them do much, just explain how the class works. If you want to know that, read the 'comments' in the script. (Sorry for all of you using an illegal version. If you have that, you may have to learn how to read the code, to understand it.) Anyway, back to the other three: When you make a window that is selectable, you need to specify the commands, as well as the maximum number of selectable items, the amount of columns, and yes, where the cursor begins. Now, we are going to predetermine options. Later, we'll get into the process of pulling them from a list, but not now. It is more of a 'advanced' technique. Anyway, I'll build a class and show you how this can be achieved, quickly, easily, and effeciently: class Window_Name < Window_Selectable def initialize super(0, 0, 160, 192) @commands = ["Items", "Skills", "Equipment", "Status", "Save Game", "End Game"] @item_max = @commands.size self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 22 refresh end I am sure, if anyone is looking for errors, will notice 2: no end to the class, and no refresh method. We'll add these later, don't worry. At any rate, let's pick this apart, with the new things: The array called '@commands' The @item_max variable Well, These are easy to pick apart. The array gives us 'strings' of each command. The reason we want them in string form is if they werent, they would be considered variables. Of course, arrays will be explained in more detail later, but for now, we have 6 commands. Now, the @item_max = @commands.size means it makes the maximum number of selectable items equal to the array '@commands' size. This is important, otherwise the item max would be 1. The @item_max, more specifically, tells us how many 'selectable' items there are in the window. Very handy. Now, @column_max tells us how many columns are allowed for the selection. So, for a horizontal menu, rather than a vertical menu, we could set @column_max = @item_max after @item_max has been defined as @commands.size. The reason is everything triggers in order: @commands @item_max @column_max That simple. Now, the @index, also known as self.index when in the window, is where the cursor begins. in the initialize method, set it to '0' of the window is automatically active. This puts it on the first item. If you want the window inactive, set it to '-1'. The other way to make a window active, is to use: self.active = true I recommend puting this into the selectable window, incase you need to have that item selected while another window is active (sort of like for a CMS). Ok, now we have to go over the 'refresh' method. Believe it or not, depending on if you are making a command window or an item/skill/etc window, this can be long or short. We'll go over the latter of the two later, but for now, concentrate on a command window. def refresh self.contents.clear for i in 0...@commands.size x = 4 y = i * 32 self.contents.draw_text(x, y, 128, 32, @commands[i]) end end end Now, we define or refresh method, put in 'self.contents.clear' because this clears the window before re-printing everything inside (keeps the text from looking fuzzy), then do a for statement. The for statement starts at 0, and goes to ...@commands.size If you remember, 3 dots means it is that number -1, basically. So, in this case, @commands.size - 1, a.k.a. 5. The reason why? 0, 1, 2, 3, 4, 5 will call up the commands, but 6 will yield a 'nil' error, something that sucks. Now, why start at 0? because arrays start at 0. I think I all ready covered that before... but that is a refresher. Next, position x equals 4, because we need to make room for the cursor (the blinking rectangle thingy.). Since it is just '4', we can assume this is a vertical menu. Next, y = i * 32. Well, i is a local variable defined by the for statement. it says i = 0...@commands.size. So it will loop for 0, 1, 2 etc. So, i will equal each in turn, give us the numbers 0, 32, 64, 96, 128, and 160. Then, we draw the self.contents.draw_text, put in x and y variables, then give it the width of the window minus 32, make oy = 32, simply because this is standard for the default font size (it is centered.), then the text is @commands. Well, the first time this is called, that will equal "Items". How?! Simple, it calls up the '0' location of the array @commands that we defined, as a string called 'items'. Then it will call each in turn, and end. That is a basic selectable window. Simple, no? Now, i said I wouldnt cover the other commands, but maybe I will when we get into editing the pre-existing bits of script that are in the game. mainly because we can have some fun and fix a couple small glitches, making the program run easier for you. Anyway, until Section V, adios!
  20. Welcome, Tib. Hey, everyone, be nice to this guy. A great scriptor and a great friend. Enjoy yourself, Tiberius.
  21. very nice. spriters are rare... I am a beginner at the art, but you seem to have some experience from the past.
  22. The one i am working on was inspired by a competition that looks as though it fell through. true, it sounds like it will be short... but it will be a nice, fun little thing.
  23. Sprites can be a big thing, when you think about it. The only problem is 80% of the people bailed on this project. I am currently working on one to bring everyone back into the swing of wanting to work together, but it will take time.
  24. Ok, I apologize for taking so long to continue, ran into some personal issues, but I am back. Now, I am going to explain the different commands that each of the three, and show you how each can be used. Shall we get started with the basics? Since Window_Base is the highest one we can access, we'll start there. Also, we'll cover 'Font', because it is entwined with windows. Window_Base We need to look at each method in Window_Base, and I'll explain how it works, and for what purpose. Remember, to use these in the window, you need to put: self.method name) or just the method's name. We will skip the methods 'initialize' and 'dispose'. They aren't needed to know, it just shows how the window is made, and how it disposes. Anyway, next method is 'text_color'. Now, for windows, there are a few things we need to go over before the methods. That is you can do certain things, such as: self.windowskin = RPG::Cache('windowskin_name') self.x = the placement, horizontally, of the upper left pixel. self.y = the placement, vertically, of the upper left pixel self.z = for layering, the higher the number, the closer to the top of the pile. self.width = the width of the window self.height = the height of the window self.visible = Whether or not the window can be seen by the player. self.contents.font.(command) will edit the font. We'll cover this with the whole 'Font' explanation. Now, the method 'text_color' has a 'n' in parentheses next to it. This means you must call up a variable if you ever call up the method 'text_color', you have to put something in the parenteses. What though? Well, let's look a little in the method: def text_color(n) case n when 0 return Color.new(255, 255, 255, 255) when 1 return Color.new(128, 128, 255, 255) when 2 return Color.new(255, 128, 128, 255) when 3 return Color.new(128, 255, 128, 255) when 4 return Color.new(128, 255, 255, 255) when 5 return Color.new(255, 128, 255, 255) when 6 return Color.new(255, 255, 128, 255) when 7 return Color.new(192, 192, 192, 255) else normal_color end end Well, the 'case' is a statement is new, isn't it? Well, the way it works is you put 'case', then a variable after it. Then, you put 'when' and what the variable could mean, and after that, what it would do, like above. Then, you use an 'else' statement in case the variable doesn't meet the requirements of any of 'when' statements. Consider it as a conditional branch, but you can have many more options. So, according to this, there is 0-7 options, and each one does the same thing. returns a color. Now, to define the color, we have 'Color.new(Red, Green, Blue, Opacity)', each is a number between 0-255. If the number isn't one of these, it will trigger 'normal_color'. Well, since this hasn't been defined, it must be a method. Any of the ones that deal with the color, you use: self.contents.font.color = text_color(n) Infact, the next method: def normal_color return Color.new(255, 255, 255, 255) end This method here, is the 'normal_color' method. This is used to make the text color white, as you can see. It maxes out the red, green, and blue; as well as the 'alpha', or, opacity, as you will. Anyway, that is pretty simple, just make self.contents.font.color equal to normal_color to equal white. def disabled_color return Color.new(255, 255, 255, 128) end This here is alot like the normal_color, but the alpha is halfed. def system_color return Color.new(192, 224, 255, 255) end Ok, you know that blue-colored text? That is the 'system_color'. as you can see, this is just like the ones before. Ok, crisis_color and knockout_color are the same as disabled, normal, and system. I won't explain them. def update super if $game_system.windowskin_name != @windowskin_name @windowskin_name = $game_system.windowskin_name self.windowskin = RPG::Cache.windowskin(@windowskin_name) end end This updates the windowskin. Simple, no? Ok, from here in, I am going to just give the method's name, and describe how to use it, not how it works. I dont want this too long. draw_actor_graphic(actor, x, y) Draw's the actor's sprite. To use it, you specify the actor, x position, and y position in the parentheses, like this: draw_actor_graphic(@actor, 10, 10) NOTE: x is always horizontal, y is always vertical. keep that straight. Sure, they are just variables, but still important to keep straight. Now, in addition to draw_actor_graphic, there is a plethora of other 'draw_actor' things you can do. Here is a list: draw_actor_name(actor, x, y) draw_actor_class(actor, x, y) draw_actor_level(actor, x, y) draw_actor_state(actor, x, y, width = 120) draw_actor_exp(actor, x, y) draw_actor_hp(actor, x, y, width = 144) draw_actor_sp(actor, x, y, width = 144) draw_actor_parameter(actor, x, y, type) Wait, wait, wait... There are a few of these with added things. Three of them has a 'width = x', and one with 'type'. WHat the hell is th-... sorry, anyway, to explain, if you ever aren't sure if the variable will be called in parenthesis, you can always set it equal to something like the width is. If there is a variable, in this case, a number there, it will set the width to that rather than what is show above. But, one of them has a fourth thing: type. What is that? Well, for parameter, there are 7 different types, numbered 0-6. It is easier than drawing up 7 different methods. The types can be found in window_base, but I'll list them for you: 0 - attack 1 - physical defense 2 - magical defense 3 - strength 4 - dexterity 5 - agility 6 - intellect Now, make_battler_state_text sets the compilation of the names of all of the statuses that can affect the hero. You dont need to use this, really, because draw_actor_state does this for you. Well, this is it for Window_Base, in the way of methods. It is a long explanation, so soak it all in. I recommend a notepad and taking notes on some stuff, it tends to help. At any rate, I will continue with Window_Selectable and Window_Command in the next section. Til then, see you around. ~Lizzie out. Credits to Trickster for correcting some of my errors and Kiriashi for reformatting. Read Section IV
×
×
  • Create New...