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

Zeriab

Member
  • Content Count

    188
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Zeriab

  1. My script solves the 'Script Hanging' issue. You must in some way let the current script report their status to the report button. Do you know what takes a lot of time to load?
  2. I don't care if your storyline in essence have been done millions of times as long as it is fun to play. Anyway I would still like to know if you decide to use it. Though only use it if it fits your game.
  3. What are you going to use a loading bar for? The problem with creating a modular loading bar is that I can't possible know how much stuff the script have to do and how long it will take. This means that you will have to feed the loading bar with information if I create one.
  4. Thanks. Go ahead and use it if you want to. If you use it I would like to hear any problems or issues you might have with it.
  5. Welcome Advent Cloud! Could you tell us more about yourself? What are your skills and stuff like that?
  6. Thanks for taking your time trying my system. You got it right. The trick is to make a pattern that will get the pig into the pen. Perhaps I should have explained that better. Then again. The main focus is towards other eventers. To show them a principle they can use themselves. That's also the reason behind the big issues section. I hope to get them thinking. You can still use it without being an eventer. It is currently not as suitable for them. There are some stuff that should be changed before it becoming a good system for the general RPG Maker.
  7. It's nice knowing my FAQ also help experienced users.
  8. I just noticed you had something similar in the RGSS tutorials forum. This might help people who are not willing to download your pack. (Who knows, there might be some) I am happy to help.
  9. Thanks all for the nice welcome. Satiel did drag me from CA and I do remember seeing some of you there. I already like this forum. :rolleyes: @Leon: Standards are good. I think we should stick with the standards given in the SDK. That way we will have a higher chance of consistency with scripts outside of this forum. If you do have another idea I am willing to listen. Just pm me. @DD: I'm not as touchy as Satiel. As long as I can understand what you write I probably won't mind. Also I will try my best to post a lot.
  10. You are free to modify it to your needs. You have my permission :rolleyes:
  11. Ah, yes. I knew there was something I forgot to tell. I am a scripter and an eventer. I would call myself an expert eventer and... well... Let's just say an expert scripter thought it's not entirely true.
  12. Frequently asked questions - RMXP ByZeriab and Kiriashi - Version 2.2 Table of Contents: Click the title to go to the section. What is RMXP? What is a switch? What is a variable? What is a script? What is RGSS? What is the Database? What are layers? What is compile game disk? What is a RTP? What is the RPG Maker XP RTP? What is the maximum... What are the default width and height dimensions of the game window? What music types are supported by RMXP? Where can I learn to script using the RGSS? How do you set the player's starting point? How do you make an NPC? How do I make a quest, where you have to find an item? How do I import maps, made on another computer? How do I import new resources? How do I send my game to my friends? How do I distribute my game without the RTP? I added a call script, now a popup box with "????????" or "Syntax error" occurs. I don't hear any sound, while my speakers are on and my sound card drivers are set. I get an error message saying "Failed to initialize DirectX Audio" when I try to start up RMXP. What do I do? I have inserted a new script and the font doesn?t show up. How to fix this? I have problems with my map. The player can walk over solid stuff. How do I fix this? I have used 'Erase Event' to remove an event, but when I come back later it has appeared. How can I solve this? It says "Incompatible versions". What should I do? | Sources Special thanks | Help ______________________________________________________________________ What is RMXP? RMXP, short for RPG Maker XP, is a game making tool made by Enterbrain You can find their english website here: http://www.enterbrai...kool/RPG_XP/eng What is a switch? A switch is an object that can be true or false, on or off. To learn how to use switches, look at this tutorial by Dubealex: http://www.creationa...php?showtopic=6 What is a variable? A variable is an object that contains a number you can change with events. To learn how to use variables, look at this tutorial by Dubealex: http://www.creationa...hp?showtopic=65 What is a script? The term 'script' have many different meanings (cf. Google and Wikipedia). When used in context with RMXP the general meaning is: "This is a programming term that refers to a set of instructions (a program) that is executed by another program rather than the computer's processor." - http://www.satellite...-glossary-s.htm This basically means that a script is being interpreted and not compiled. What is the RGSS? The RGSS, short for the Ruby Game Scripting System, is a set of commands written in an interpreted language to automate certain application tasks or a type of computer code than can be directly executed by a program that understands the language in which the script is written. Scripts do not need to be compiled to be executed. Anyone can write scripts in RGSS to be used in RMXP games. Add new scripts above the script "Main" in your game unless instructed otherwise. Source: http://en.wikipedia....cripting_System What is the Database? The Database can be found under Tools\Database (F9). You can also get to this by pressing F9. The Database is the Menu that contains all the game specific settings, such as: what imported tilesets are used for what; what items are in the game, and how they interact with the characters; what monsters are in the game, how they fight, how strong they are, how they look, what groups they travel in; it also stores character data such as how they look, what their stats are and how they improve as the char levels. This is also where you setup common events, and other settings that affect the whole game such as the battle music or the tileset for the menus. This is also where you set what picture is used for the title screen and game over screen, but this is not where you import graphics, here your just picking which already imported graphic to use. The Resource Manager is used to import graphics. What are layers? Layers are the multiple levels in which you are to place objects. The first layer is for putting down the ground usually. The second layer is for putting down the rest the objects. What is unique about RPG XP is the third layer, which is basically just the second layer, over the second layer. Then, finally, you have the event layer, where you basically place events. What is compile game disk? It is an option under File in the editor. It compiles your game into 1 file that you can run on another computer. If you press it a dialog show appear asking you for an address. For a folder to be more explicit. This is your output folder where the file will be placed after creation if you accept the dialog. (Click ok) You have the option to create an encrypted archive. This means that you can't get access to the game through the editor nor access to your resources when installing the game from the created file. What is RTP? RTP means Run Time Package. A package required to run a program, often filled with data used by much programs of the same kind. For RMXP RTP, look below. What is RPG Maker XP RTP RPG Maker XP RTP is a system for reducing the total size of a ?game disk? made with RMXP. RPG Maker XP RTP contains the graphics, music (MIDI, etc.) and DLL files used when creating a game with RMXP ? basically a collection of common materials. When a game is created with RTP data, once it is finished, you won?t have to add this data to the actual ?game disk,? which consequently allows you to significantly reduce the game file size. Source: http://www.enterbrai...kool/RPG_XP/eng What is the maximum... ...number of maps : 999 ...number of events per map : 999 ...dimensions of a map : 500 x 500 ...database items : 999 each (tilesets, common events, actors, skills...) ...height of a tileset : Unlimited. However, lag increases when it is bigger. More limitations can be found here: http://www.creationasylum.net/index.php?showtopic=204 What are the default width and height of the game window 640 pixels width, 480 pixels height. What music types are supported by RMXP? By default, RMXP support .MP3, .WAV, .MID, .WMA and .OGG. MP3 and WMA are streamed, this means they are loaded while playing. OGG is usually much smaller, but can not stream, so need to be loaded fully before playing. Additional formats like the Playstation PSF and miniPSF can be played with scripts. Where can I learn to script RGSS? Look in the sticky topic located under Rpg Game Making\RGSS Scripts located here: http://www.creationa...?showtopic=8327 How do you set the player's starting point? Go to the event layer (F8). Right click on a tile. Select 'Player's Starting Position' from the drop down menu. How do you make an NPC? Go to the event layer (F8). Make an event somewhere by either double clicking on a square with the left mouse button, right clicking and selecting New Event... or selecting the square and pressing [Enter] This will open the event dialog. To the left there is a white field with 'Graphic:' in words just above it. Double click on this (left mouse button) and select the graphic you want. When this is done go to the big white field to the right. Here is all the event commands listed. Select it and insert a new command. Here you can make the NPC do what you want it to do. Remember that you can a short pop up message by right-clicking and pressing What's this? You can also get this by pressing F1. You will get the description on the button you have select. You can move the selection with the arrow keys. How do I make a quest, where you have to find an item? There is a bazillion ways to do this. I will try to cook the general concepts down into an example. If you don't know what a switch is or are unsure of how to use them you should read What is a switch? before continuing. Phase 1: Activation of the quest Let's say you talk to this person who gives you the quest. If the quest is given you let the event turn on a switch. We could use switch 21 - Quest Start and turn it ON. (This could be any switch) You should make sure that the person does not continue to give the quest. (This is strictly speaking not necessary) Make a new event page and set as precondition the switch 21 - Quest Start. (Should be the same as the switch you turned ON in the previous page. Remember to set the event graphic) Here you can set the action for when the Quest is active, but not finished. Phase 2: Getting the item Let's say that you could not get the item before. The event from which you can get the item shall like the event starting the quest have a condition for when the quest start. That is. New page, Precondition set to 21 - Quest Start (2nd page) Here you should turn another switch to ON. Let it be 22 - Item Gotten. You can make some actions. (Tell the player a story or whatever) Make a new page (3rd). Set Precondition to 22 - Item Gotten. Here you can set actions if the player tries to trigger the event again. Phase 3: Ending the quest Go back to the event that starts the quest and make a new page (3rd). Set precondition to 22 - Item Gotten. Here you should tell the player that he or she has completed the quest. Afterwards turn switch 23 - Quest Finished ON. New page (4th). Precondition set to 23 - Quest Finished. For the item event. New page (4th). Precondition set to 23 - Quest Finished. Here you can make actions for when the player triggers the events after the quest is completed. Final notes: As you might notice a lot of switches are used. You could actually add an event and then check whether the player has it or not with a conditional branch during the quest. This will eliminate the need for the 22 - Item Gotten switch. How do I import maps, made on another computer? Copy both projects on 1 computer. Open both of them. In the project tree window to the lower left: Right-click on one of the maps you want to copy and press copy in the dropdown menu. Now go to the other project and select a map in the tree structure. Right-click and press paste. The map will then be copied into the allocated place in the tree structure. Keep doing this until you have copied all maps over. Note that the Player's Starting Position is not copied over. Also note that the map id most probably changes. This means that you might have to change some events. How do I import new resources? There is an Icon near the little music note, it is the folder with 3 documents (icon). This'll take you to the import/export system. You can also access the import/export by Tools\Materialbase (F10). Here you click the Import... button and find the file you want to import. Here you left click on the color you want transparent. You can also right-click for a semi-transparent color. Click OK and you are done. How do I send my game to my friends? Look at What is compile game disk? Send the resulting file to them. They may have to install the RTP found here: http://www.enterbrai...g/download.html Look below if you want to know how to distribute it without the RTP. How do I distribute my game without the RTP? Dubealex has made a tutorial about this, which can be found here: http://www.creationa...?showtopic=1303 I added a call script, now a popup box with "??<b>??????" or "Syntax error" occurs.</b> You have made an error in the syntax from the call script. Please note that everyline will be interpreted as a new script, unless you have the fix for this. I don't hear any sound, while my speakers are on and my sound card drivers are set. Press F1 while in game. Make sure the thirth (Play BGM and ME in game) and the fourth (Play BGS and SE in game) are set. I get an error message saying "Failed to initialize DirectX Audio" when I try to start up RMXP. What do I do? Just install/reinstall your Sound Card Audio Driver. I have inserted a new script and the font doesn?t show up. How to fix this? Open the scripts and go to MAIN. Find this line: $scene = Scene_ ... .new and just before that line add: Font.default_name = $fontface = $defaultfonttype = "Tahoma" Font.default_size = $fontsize = $defaultfontsize = 22 Still having problems? Try installing the font files located here: Fonts.zip (direct) (mirror1 ? direct) (mirror2) (mirror3) (mirror4) I have problems with my map. The player can walk over solid stuff. How do I fix this? You might not have set the 'passabilities' in the Database > Tab Tileset. If you still have problems try to use a dummy tile. Make one of the tiles, that are completely transparent, unpassable and use it to disable passability on the map on the 3rd layer. If you want to check the passibilty in your map, just choose some "visible" dummy tile and fill with the bucket tool one area in the map. A little trick to actually "see" passability/unpassability on your map. After you finished editing just bucket it back with a passable/unpassable tile. I have used 'Erase Event' to remove an event, but when I come back later it has appeared. How can I solve this? First you must understand what Erase Event does. When you enter a map it is loaded into the memory. Erase Event removes the event from this temp map. The state of the map is NOT stored when loading another map. (The same as going to another place). When you now go back again the map will be loaded with the events in their original positions. This is why it doesn't work. To solve it simply use switches. Turn on a switch where you have your Erase Event-command. Then make a new page and put the switch you just turned on as a precondition for the new page. Problems with switches? Look at What is a switch?. It says "Incompatible versions". What should I do? Make a new project and replace the Game.rxproj inside the demo with the new one. If you still can't start it, open Game.ini and change RGSS102E.dll to RGSS100J.dll. If it already is RGSS100J.dll, change it to RGSS102E.dll. Sources: Official English Site - http://www.enterbrai...kool/RPG_XP/eng Creation Asylum - http://www.creationasylum.net Google - http://www.google.com Oxford English Dictionary - http://www.oed.com Wikipedia - http://www.wikipedia.com Special thanks: Aus "ace" Wallace Blizzard Constance deadly_diablo kitramos Marlune Me? zuzagi Help: Ineed YOUR help in making this FAQ better. Have anything else to add? New questions with or without answers? Please do post tell me and chances are that I will post it. Is anything wrong? Some information doesn't work or is in fact wrong? Or does it just need an update? Getting this kind of information is valuable as well. The information as good and as accurate as possible while having good depth. Something wrong with the terminology? Wrong terms used? Is it not called a 'Conditional Branch', but a 'Fork' instead? If people try to find a button they think is named something different that what it actually is... A lot of time is a wasted. As you can see there might be a lot you can help with, but before posting your help there is something you must know: By contributing to this FAQ you agree that distribution of this work in parts or as a whole is left entirely at my discretion. You also agree that once integrated you lose the right to demand your work's removal.
  13. Gamos A minigame I made a while ago in rm2k. You have to push boulders to appropriate places without getting stuck. In the RM2K version a max of 10 boulders / 10 places per level/puzzle is present. You may implement it into your own game. Just give credits. Note: I do considers this as a finished project. but I will be delighted to add more levels and perhaps a better tutorial/explanation. RM2K version donated to crankeye.com Screenshots: (RM2K) [01] [02] [03] Download RM2K Version (rar) Download RM2K Version (zip) Screenshots: (RMXP) [01] [02] [03] Download RMXP Version (rar) Download RMXP Version (zip) Recently I found an old boulder-pushing DOS-Game I've made ages ago and thought; "Hey, I'm going to convert the levels." That's what I did. I created a MapPack from the levels using the RMXP-version Before making the maps I converted Gamos from the Postality Knights-version into a legal-version. Therefore you might see text in the tutorial and information not looking right. (I didn't fix that.) Just select the example levels, complete the few from the basic RMXP-version and select yes to go to the levels in the MapPack. You have 2 usable items in the game. 1. Skip level (unlimited uses) 2. Restart level (unlimited uses) They should be should be selfexplanary Anyway here's the MapPack: (67 levels) Download the MapPack (unknown author(s)) Known issues in RMXP-version: The the present state of the boulders is not saved when saving this game. This means: When loading a game in a map with Gamos utilized the boulder will reset to their original positions while the hero's position will not change. This can easily be countered by dusenabling the save-option while playing the game. I have in the MapPack preserved the ability to save during the levels. Just save if you want as you just can restart the level when you load by using the Restart level item.
  14. Snake Look-alike on Load Script Version: 1.0 Introduction The SLOLS has been made by Zeriab. Thanks goes to RMXP for making this possible Credits should be given. The purpose of SLOLS is to provide the player an opportunity to interact with something during loading sequences. I think the loading time will not seem as long as normally if the player as something to do while the program is loading. They don't experience the time it takes to load as bad even though the script reduced the loading speed. In the game itself the principle is to collect dots by moving a bigger dot into them. There is no time limit. There is no way to die or get stuck or etc. Steering is done by the arrow keys. When the loading is finished a sound will be played and visual aids will be used to let the player know that the loading is finished. The player can then continue by pressing a trigger key (fx. ENTER) There is no need to press enter. The player can play the game as long as he or she wants unless the script loaded does something that changes this. Screenshots Demo The demo has been combined with my Letter Ninigame to show a example of use. If the Letter Minigame is used credits mentionen in the Letter Minigame should be given. You download my demo from one of the following links. http://rapidshare.de/files/34811243/SLOLS.rar.html http://www.uploadtemple.com/view.php/1159485902.rar http://www.bigupload.com/d=0361F1BA http://www28.websamba.com/Vobbys/SLOLS.rar http://www28.websamba.com/Vobbys/SLOLS.zip Script #============================================================================== # ** Snake Look-alike on Loading Script #------------------------------------------------------------------------------ # Zeriab # v 1.0 # 28-09-2006 #============================================================================== class Scene_SLOLS # The variable the number of dots collected will be stored Cheese_Variable = 25 # The size of the margin in pixels Margin = 10 # The thickness of the border in pixels Border_Thickness = 3 #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(scene=Scene_Map.new) @next_scene = scene end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Creates Bar Window (Loading bar) @bar_window = Window_SLOLS_Bar.new # Creates Info Window @info_window = Window_SLOLS_Info.new(Margin, Border_Thickness, Cheese_Variable) # Creates Game Window @game_window = Window_SLOLS_Game.new(Margin, Border_Thickness, Cheese_Variable) # Execute transition Graphics.transition # Scene Objects @scene_objects = [@bar_window, @info_window, @game_window] # Main loop loop do # Sleeps a short while to let the other thread work. sleep(0.01) # Update game screen Graphics.update # Update input information Input.update ## Frame update update # Abort loop if screen is changed break if $scene != self end # Prepare for transition Graphics.freeze # Dispose Scene Objects @scene_objects.each { |x| x.dispose } end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Updates Scene Objects @scene_objects.each { |x| x.update } # If B or C Button Is Pressed if Input.trigger?(Input::B) || Input.trigger?(Input::C) # If the loading thread is finished (not alive) if !$loader.is_a?(Thread) || !$loader.alive? # Play Decision SE $game_system.se_play($data_system.decision_se) # Switch to map screen $scene = @next_scene return else # Play Buzzer SE $game_system.se_play($data_system.buzzer_se) return end end end end #============================================================================== # ** Window_SLOLS_Bar #============================================================================== class Window_SLOLS_Bar #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @contents = Sprite.new(Viewport.new(0, 416, 640, 64)) @contents.bitmap = Bitmap.new(640, 64) @left_block = Sprite.new(Viewport.new(540-48, 424, 48, 48)) @left_block.bitmap = Bitmap.new(64, 64) @right_block = Sprite.new(Viewport.new(100, 424, 48, 48)) @right_block.bitmap = Bitmap.new(640, 64) @blocks = [@left_block, @right_block] @bar = Sprite.new(Viewport.new(270, 446, 100, 4)) @bar.bitmap = Bitmap.new(200, 4) @bar_f = Sprite.new(Viewport.new(270, 446, 100, 4)) @bar_f.bitmap = Bitmap.new(100, 4) @bar_fx = 0 # The sprites used @sprites = [@contents,@bar,@bar_f] refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh @contents.bitmap.clear bar_color = Color.new(225,225,225,255) fin_color = Color.new(255,255,0,0) @bar.bitmap.fill_rect(0,0,25,4,bar_color) @bar.bitmap.fill_rect(50,0,25,4,bar_color) @bar.bitmap.fill_rect(100,0,25,4,bar_color) @bar.bitmap.fill_rect(150,0,25,4,bar_color) @bar_f.bitmap.fill_rect(0,0,100,4,fin_color) @blocks.each {|x| x.bitmap.fill_rect(0,0,64,64,fin_color)} end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- def update @bar.ox -= 1 @bar.ox = @bar.ox % 100 @bar.update if @bar_fx == 0 && (!$loader.is_a?(Thread) || !$loader.alive?) @bar_fx = 1 @count = 3 $game_system.se_play($data_system.load_se) end if @bar_fx > 0 && @bar_fx < 255 @bar_fx += @count @bar_f.bitmap.fill_rect(0,0,100,4,Color.new(255,255,0,@bar_fx)) @blocks.each {|x| x.bitmap.fill_rect(0,0,48,48,Color.new(255,255,0,@bar_fx))} case @bar_fx when 10..20 @count = 50 when 180..230 @count = 5 end end end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose @sprites.each { |x| x.bitmap.dispose} @sprites.each { |x| x.dispose} end end #============================================================================== # ** Window_SLOLS_Game #============================================================================== class Window_SLOLS_Game #Player Settings Size = 5 Default_Speed = 3 Trail_Length = 19 #Cheese Settings Cheese_Size = 3 Cheese_Colors = [Color.new(10,200,20,255)] Max_Cheese_Amount = 200 #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(margin, border_thickness, cheese_variable) # The margin and border thickness @margin = margin @border_thickness = border_thickness @cheese_variable = cheese_variable # Width of the playing field @width = 480-(@margin*2) - (@border_thickness*2) # Height of the playing field @height = 416-(@margin*2) - (@border_thickness*2) # Player info @player_x = 200 @player_y = 208 @player_trail = [] @player_dir = 6 #2 - up, 4 - left, 6 - right, 8 - down @speed = Default_Speed # The cheese array @cheese = [] @cheese.push(make_cheese) # The amount of cheese caught during this season. @cheese_amount = 0 # Create the Sprite for viewing the border @border = Sprite.new(Viewport.new(@margin, @margin, 480-@margin, 416-@margin)) @border.bitmap = Bitmap.new(480-(@margin*2),416-(@margin*2)) # Creates the main Sprite @contents = Sprite.new(Viewport.new(@margin + @border_thickness, @margin + @border_thickness, @width, @height)) @contents.bitmap = Bitmap.new(@width,@height) # Refreshes refresh # Updates update end #-------------------------------------------------------------------------- # * Make Cheese # --------------------- # Generates a pointer to a place where a cheese will be at least 3 pixels # away from the player #-------------------------------------------------------------------------- def make_cheese result = [] # Total size. (Sum of player size and cheese size) size = Size + Cheese_Size loop do # Generating the x and y coordinates x = rand(@width - (size + 5)*2) y = rand(@height - (size + 5)*2) # Adjusts the x and y coordinates so the cheese will not be # placed in the player if x > @width / 2 - (size + 5) x += 2*(Size + 5) end if y > @height / 2 - (size + 5) y += 2*(Size + 5) end # Makes sure that no cheese exists in that exact same place # Does not consider the size of the cheese. if !@cheese.include?([x,y]) result = [x,y] break end end return result end #-------------------------------------------------------------------------- # * Check Player # -------------------- # Checks if the player have caught a cheese. (Is touching one) # Returns the indices of the cheese in an array #-------------------------------------------------------------------------- def check_player result = [] # Checks every cheese for i in 0...@cheese.size # Distance in the x-plane d = (@cheese[i][0] - @player_x).abs # Distance in the y-plane d_y = (@cheese[i][1] - @player_y).abs # Makes 'd' contain the largest distance if d < d_y d = d_y end # If the largest distance is less than the size of the player and the # cheese the player must be touching the cheese. if d < (Size + Cheese_Size - 1) result.push(i) end end return result end #-------------------------------------------------------------------------- # * Draw Cheese # i : The index on the cheese # color : The color wanted for the cheese # -------------------- # Draws the designated cheese with the given color #-------------------------------------------------------------------------- def draw_cheese(i, color) cheese = @cheese[i] size = Cheese_Size # Draws the cheese @contents.bitmap.fill_rect(cheese[0]-(size-1),cheese[1]-(size-1), (size*2)-1, (size*2)-1, color) end #-------------------------------------------------------------------------- # * Delete Cheese # i : The index on the cheese # -------------------- # Deletes the cheese by first drawing it black and then removing the cheese # from @cheese. #-------------------------------------------------------------------------- def delete_cheese(i) draw_cheese(i, Color.new(0,0,0,0)) @cheese.delete_at(i) end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh @border.bitmap.clear # Draws a white block @border.bitmap.fill_rect(0,0,480-@margin, 416-@margin,Color.new(225, 225, 225, 255)) # Draws a smaller black block to give the border @border.bitmap.fill_rect(@border_thickness, @border_thickness, @width, @height, Color.new(0, 0, 0, 0)) end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- def update @contents.update # Checks if the player gets any cheese array = check_player if array.size > 0 # Removes all the cheese for i in array # Cheese counters $game_variables[@cheese_variable] += 1 @cheese_amount += 1 # Deletes the old cheese delete_cheese(i) # Creates a new one @cheese.push(make_cheese) # Might create another one if @cheese.size < Max_Cheese_Amount # Creates an extra cheese if enough cheese have been caught if @cheese_amount > @cheese.size * @cheese.size + 1 # Creates a new one @cheese.push(make_cheese) end end end end # Draws the cheese for i in 0...@cheese.size draw_cheese(i, Color.new(10,200,20,255)) end # Makes sure the trail isn't too short while @player_trail.size < Trail_Length # Adds the player positions into the trail @player_trail.push([@player_x,@player_y]) end coords = @player_trail.shift # Draws the trail @contents.bitmap.fill_rect(coords[0]-(Size-1),coords[1]-(Size-1), (Size*2)-1, (Size*2)-1, Color.new(0,0,0,255)) #Calculates the steps per shade step = 200 / (Trail_Length) for i in 0...Trail_Length-1 # Calculations coords = @player_trail[i] s = step*(Trail_Length-i) # Draws the trail @contents.bitmap.fill_rect(coords[0]-(Size-1),coords[1]-(Size-1), (Size*2)-1, (Size*2)-1, Color.new(200-s,200-s,100-(s/2),255)) end # Draws the player @contents.bitmap.fill_rect(@player_x-(Size-1),@player_y-(Size-1), (Size*2)-1, (Size*2)-1, Color.new(200,200,100,255)) # If UP Is Pressed if Input.trigger?(Input::UP) @player_dir = 8 unless @player_dir == 2 end # If DOWN Is Pressed if Input.trigger?(Input::DOWN) @player_dir = 2 unless @player_dir == 8 end # If LEFT Is Pressed if Input.trigger?(Input::LEFT) @player_dir = 4 unless @player_dir == 6 end # If RIGHT Is Pressed if Input.trigger?(Input::RIGHT) @player_dir = 6 unless @player_dir == 4 end # Moves the player accordingly to the directions case @player_dir when 8 # Down @player_y -= @speed when 2 # Up @player_y += @speed when 4 # Left @player_x -= @speed when 6 # Right @player_x += @speed end # Warping the player @player_x = (@player_x) % @width @player_y = (@player_y) % @height end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose @contents.bitmap.dispose @contents.dispose end end #============================================================================== # ** Window_SLOLS_Info #============================================================================== class Window_SLOLS_Info # Instructions Instructs = [ 'Navigate using the','arrow keys.', 'Collect green dots.', 'This is done by','going into them.', 'A sound will play','when the loading','is finished', '','Enter to continue' ] #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(margin, border_thickness, cheese_variable) # The name of the arrow images @arrow_file_names = ["Down_Arrow.png", "Left_Arrow.png", "Right_Arrows.png", "Up_Arrow.png"] # The arrow images @arrow_images = [] for i in 0..3 # Makes sure that the program keeps running if one or more of the files # given don't exists. (read: wrong filename or missing file) begin # Reads the bitmap bitmap = Bitmap.new('Graphics\\Pictures\\'+@arrow_file_names[i]) rescue Exception => ex # Creates a blank 32x32 bitmap if the reading fails bitmap = Bitmap.new(32,32) # Prints the exception if in Debug mode. if $DEBUG p ex end end # Pushes the resulting bitmap into the array @arrow_images.push(bitmap) end # The margin and border thickness @margin = margin @border_thickness = border_thickness @cheese_variable = cheese_variable # Height with border excluding margin @height = 416-@margin # The instructions Sprite @instru = Sprite.new(Viewport.new(480 + @border_thickness, 48 + @border_thickness, 159 - @margin - @border_thickness*2, 282 - @margin*4 + 4)) @instru.bitmap = Bitmap.new(159 - @margin - @border_thickness*2, 282 - @margin*4 + 4) @instru.bitmap.font.color = Color.new(225, 225, 225, 255) @instru.bitmap.font.size = 20 # The main Sprite @contents = Sprite.new(Viewport.new(480, 0, 160, @height)) @contents.bitmap = Bitmap.new(160, @height) @contents.bitmap.font.color = Color.new(225, 225, 225, 255) @contents.bitmap.font.size = 22 refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # Simplifying the variables used border = @border_thickness spacing = @margin + border # Removes any old contents, garbage and so on. @contents.bitmap.clear # Draws the white block used for the border of the score @contents.bitmap.fill_rect(0,@margin,159-@margin,22+border*2, Color.new(225, 225, 225, 255)) # Draws the white block used for the border of the instructions @contents.bitmap.fill_rect(0,48,159-@margin,282+border*2-@margin*4+4, Color.new(225, 225, 225, 255)) # Draws a black block on the white block creating the border. @contents.bitmap.fill_rect(border, 48+border,159-spacing-border, 282-@margin*4+4, Color.new(0, 0, 0, 0)) # Draws the left arrow @contents.bitmap.blt(0,373-@margin,@arrow_images[1],Rect.new(0,0,43,43)) # Draws the down arrow @contents.bitmap.blt(43+@margin,373-@margin,@arrow_images[0], Rect.new(0,0,43,43)) # Draws the right arrow @contents.bitmap.blt(43*2+@margin*2,373-@margin,@arrow_images[2], Rect.new(0,0,43,43)) # Draws the up arrow @contents.bitmap.blt(43+@margin,330-@margin*2,@arrow_images[3], Rect.new(0,0,43,43)) # Draws the text 'Instructions:' @contents.bitmap.draw_text(border, 48, 150-border*2, 22, 'Instructions',1) # Draws the intructions for i in 0...Instructs.size # Gets the string str = Instructs[i] # Draws the string @instru.bitmap.draw_text(2, 22*(i+1), 150-border*2, 20, str,1) end end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- def update # Simplifying the variables used border = @border_thickness spacing = @margin + border # Updates the sprite @contents.update # Removes old contents @contents.bitmap.fill_rect(border, spacing, 159-spacing-border, 22, Color.new(0, 0, 0, 0)) # Draws the amount of dots collected @contents.bitmap.draw_text(border, spacing, 153-spacing, 22, $game_variables[@cheese_variable].to_s, 2) # Draws the text 'Dots:' @contents.bitmap.draw_text(border+2, spacing, 157-spacing, 22, 'Dots:') end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose @contents.bitmap.dispose @contents.dispose end end I have collected them all in 1 file which can be downloaded here: http://www28.websamba.com/Vobbys/SLOLS.txt Instructions You must have these pictures in your graphics\pictures folder or the arrow keys shown on the picture will be missing: The Script: This script used the global variable $loader. It can run without $loader being initialized in which case the script considers the loading as done. To use $loader you must set it to a Thread. The syntax is: Thread.new( [arg]* ) {| args | block } -> aThread (Reference) An example: $loader = Thread.new { MyClass.new } To get the SLOLS scene use this syntax: $scene = Scene_SLOLS.new(scene=Scene_Map.new) scene will be used to set the scene that comes after Scene_SLOLS. The scene to be used after finished loading and player pressing trigger. An example; syntax for standard scene: (Scene_Map) $scene = Scene_SLOLS.new # or $scene = Scene_SLOLS.new(Scene_Map.new) The script will store the amount of dots in the variable number specified by Cheese_Variable in Scene_SLOLS. (Near top) There also are the Margin (in pixels) and the Border_Thickness (in pixels). Changing these may break the design. The info bar with the instructions is a bit fragile. FAQ None yet Compatibility Should be independent which increases compatibility. Credits and Thanks I would like to thank everyone using their time to try and use SLOLS. I would like to thank everyone reading this topic. Thanks. Author's Notes I don't recommend letting the script being 'loaded' change the $scene as makes the SLOLS stop rather suddenly from my point of view (Players position). And finally: ENJOY! - Zeriab
  15. Letter Minigame Version: 1.2 Version History Version 1.2: Fixed an issue which might cause immense amounts of memory to be used. Version 1.1: Adds $letter_minigame.score - works also after $letter_minigame.dispose. Gives a solution to the F12 issue present in the earlier demo. Introduction The Letter Minigame has been made by Zeriab. Thanks goes to RMXP for making this possible and Near Fantastica for the Anti Event Lag Script. Credits should be given. The purpose in the Letter Minigame is to get a good score by collecting as many letters in the maze as possible within the time limit. Different letters give different amount of points. You can see how much each letter gives by looking at the letters on this island. The more points the rarer the letter. A yellow letter = 10 points A green letter = 15 points A azure letter = 20 points A red letter = 25 points A purple letter = 30 points A black letter = 100 points Screenshots Demo You download my demo from one of the following links. http://rapidshare.de/files/32564515/Letter_Minigame.rar.html http://www.uploadtemple.com/view.php/1157849623.rar http://www.bigupload.com/d=8C2A764D http://www28.websamba.com/Vobbys/Letter_Minigame.rar Script -=Extensions=- #=============================================================================== # Author: Zeriab Date:03-06-2006 # Last Modified: 04-06-2006 # # Game_Event: (Extension) # ---------------------- # Adds the ability to change the id # Adds the ability to copy the event #=============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # * Sets @id and @event.id to the given value #-------------------------------------------------------------------------- def id=(value) @id = value @event.id = value end #-------------------------------------------------------------------------- # * Copies the event #-------------------------------------------------------------------------- def copy temp = Game_Event.new(@map_id, @event.dup) temp.id = @id return temp end end #=============================================================================== # Author: Zeriab Date:09-06-2006 # Last Modified: 09-06-2006 # # Game_Map: (Extension) # ---------------------- # Adds the ability to change the height and width #=============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Sets height of the map to a given value #-------------------------------------------------------------------------- def height=(value) @map.height = value end #-------------------------------------------------------------------------- # * Sets width of the map to a given value #-------------------------------------------------------------------------- def width=(value) @map.width = value end end -=Maze_Generator=- #=============================================================================== # Author: Zeriab Date:03-06-2006 # Last Modified: 07-06-2006 # # Pointer: # ---------------------- # Points to a specific position on the map #=============================================================================== module Maze_Generator class Pointer attr_reader :x # Stored x attr_reader :y # Stored y attr_accessor :tail #A possible tail behind the pointer #-------------------------------------------------------------------------- # * Object Initialization # x : x-coordinate for starting point # y : y-coordinate for starting point #-------------------------------------------------------------------------- def initialize(x, y) @x = x @y = y end #-------------------------------------------------------------------------- # * Checks the pointers location # true is returned if the pointer is inside $game_map # false is returned if the pointer is outside $game_map #-------------------------------------------------------------------------- def check if (x / $game_map.width) == 0 and (y / $game_map.height) == 0 return true else return false end end #-------------------------------------------------------------------------- # * Get the tile value #-------------------------------------------------------------------------- def get(layer) return $game_map.data[x,y,layer] end #-------------------------------------------------------------------------- # * Set the tile value #-------------------------------------------------------------------------- def set(value, layer) $game_map.data[x,y,layer] = value if @tail != nil @tail.set(value,layer) end end #-------------------------------------------------------------------------- # * The to_s-method. # Information about the pointer returned as a string #-------------------------------------------------------------------------- def to_s return 'Pointer - x=' + @x.to_s + ', y=' + @y.to_s + ' - hasTail=' + (!(@tail==nil)).to_s end end end #=============================================================================== # Author: Zeriab Date:04-06-2006 # Last Modified: 04-06-2006 # # Event_Spawner: # ---------------------- # Creates a list during initialization which later is used for choosing events # The events given when initialized is removed from the map. # If the max_chance is bigger than the total sum of the events chance value # the possibility to not retrieving an event is present. # In that case 'nil' is returned. #=============================================================================== module Maze_Generator class Event_Spawner #-------------------------------------------------------------------------- # * Object Initialization # max_chance : The total chance used for choosing among the events # array_of_events : Numbers on events paired with their chance value #-------------------------------------------------------------------------- def initialize(max_chance, array_of_events) @max_chance = max_chance @array_of_events = array_of_events counter = 0 for tuple in @array_of_events tuple[0] = $game_map.events.delete(tuple[0]) counter += tuple[1] end if counter > @max_chance @max_chance = counter end end #-------------------------------------------------------------------------- # * Gets an event randomly from the list # returns 'nil' if no event is chosen #-------------------------------------------------------------------------- def get_event result = nil chance = rand(@max_chance) + 1 for tuple in @array_of_events chance = chance - tuple[1] if chance <= 0 and tuple[0] != nil result = tuple[0].copy break end end return result end end end #=============================================================================== # Author: Zeriab Date:03-06-2006 # Last Modified: 07-06-2006 # # Maze_Generator: # ---------------------- # Creates a maze on the current map. #=============================================================================== module Maze_Generator class Maze #-------------------------------------------------------------------------- # * Object Initialization # x : x-coordinate for starting point # y : y-coordinate for starting point # max_chance : The total chance used for choosing among the events # array_of_events : Numbers on events paired with their chance value # value : value of the tileset assigned to the maze # layer : the layer that will be crawled #-------------------------------------------------------------------------- def initialize(x, y, max_chance, array_of_events, value=0, layer=1) x = x % $game_map.width y = y % $game_map.height @value = value @layer = layer % 3 @events = Event_Spawner.new(max_chance, array_of_events) @counter = 1000 pon = Pointer.new(23,54) pointer = Pointer.new(x,y) pointer.tail=pon pointer.set(@value,@layer) crawl(pointer) $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Crawls the map # pointer : The start pointer. #-------------------------------------------------------------------------- def crawl(pointer) k = 0 list = [pointer] while list.length > 0 k += 1 k += 1 r = rand(list.length) pointer = list.delete_at(r) array = getDirection array2 = relax(pointer, array) for i in 0...array2.length list.push(array2[i]) end end end #-------------------------------------------------------------------------- # * Get the directions. (Randomized) # Returnes an array of length 2..4 containing the numbers 1..4 #-------------------------------------------------------------------------- def getDirection array = [1,2,3,4] r = rand(3)+2 while (array.length-r) > 0 r2 = rand(array.length) array.delete_at(r2) end return array end #-------------------------------------------------------------------------- # * Relaxes the given pointer with the given array # Creates paths for the valid directions # Returns the valid pointers #-------------------------------------------------------------------------- def relax(pointer, array) result = [] while array.length > 0 key = array.pop case key #--------------------------------------------------- # * up #--------------------------------------------------- when 1 p2 = Pointer.new(pointer.x, pointer.y - 2) if p2.check && p2.get(@layer) != @value p3 = Pointer.new(pointer.x,pointer.y - 1) p2.tail = p3 p2.set(@value,@layer) result.push(p2) end #--------------------------------------------------- # * rigth #--------------------------------------------------- when 2 p2 = Pointer.new(pointer.x + 2, pointer.y) if p2.check && p2.get(@layer) != @value p3 = Pointer.new(pointer.x + 1,pointer.y) p2.tail = p3 p2.set(@value,@layer) result.push(p2) end #--------------------------------------------------- # * down #--------------------------------------------------- when 3 p2 = Pointer.new(pointer.x, pointer.y + 2) if p2.check && p2.get(@layer) != @value p3 = Pointer.new(pointer.x,pointer.y + 1) p2.tail = p3 p2.set(@value,@layer) result.push(p2) end #--------------------------------------------------- # * left #--------------------------------------------------- when 4 p2 = Pointer.new(pointer.x - 2, pointer.y) if p2.check && p2.get(@layer) != @value p3 = Pointer.new(pointer.x - 1,pointer.y) p2.tail = p3 p2.set(@value,@layer) result.push(p2) end end end #---------------------------------------------------------------------- # * If result = [] (Dead end) an event might be placed in the current # position. #---------------------------------------------------------------------- if result == [] new_event = @events.get_event if new_event != nil new_event.id = @counter new_event.moveto(pointer.x,pointer.y) $game_map.events[@counter] = new_event @counter += 1 end end #---------------------------------------------------------------------- return result end end end -=Letter Minigame=- #=============================================================================== # Author: Zeriab Date:08-06-2006 # Last Modified: 27-07-2006 # # Letter_Minigame # ---------------------- # Counts the amount of letters collected and controls the score displaying in # the top-right corner #=============================================================================== class Letter_Minigame attr_reader :array_of_points attr_reader :array_of_bitmaps attr_reader :array_of_sprites attr_reader :array_count #-------------------------------------------------------------------------- # * Object Initialization. # array_of_events : Numbers on the events used. # array_of_points : The amount of points for the corresponding event in # array_of_events. Linked by placement. #-------------------------------------------------------------------------- def initialize(array_of_events, array_of_points) @array_of_points = array_of_points getSprites(array_of_events) @array_count = Array.new(array_of_points.size,0) end #-------------------------------------------------------------------------- # * Adds a letter to the to corresponding group. # letter : indicating the position the letter have in # the array_of_points with 0 as first letter. #-------------------------------------------------------------------------- def add(letter) @array_count[letter] += 1 update_letter(letter) end #-------------------------------------------------------------------------- # * Gets an array sprites and and array of their base bitmaps from an array # of events. # array : An array of eventnumbers which sprites is wanted. #-------------------------------------------------------------------------- def getSprites(array) @array_of_bitmaps = [] @array_of_sprites = [] counter = 0 for i in array event = $game_map.events[i] bitmap = RPG::Cache.character(event.character_name, event.character_hue) #--------------------------------------------------- cw = bitmap.width / 4 ch = bitmap.height / 4 sx = event.pattern * cw sy = (event.direction - 2) / 2 * ch #--------------------------------------------------- sprite = Sprite.new(Viewport.new(640-64,10+(32*counter),cw,ch)) sprite.visible = false sprite.bitmap = bitmap sprite.src_rect.set(sx, sy, cw, ch) #--------------------------------------------------- new_bitmap = Bitmap.new(cw*3,ch) new_bitmap.blt(0,0,sprite.bitmap,sprite.src_rect) sprite.bitmap = new_bitmap.dup #--------------------------------------------------- @array_of_bitmaps.push(new_bitmap.dup) @array_of_sprites.push(sprite) new_bitmap.dispose counter += 1 end end #-------------------------------------------------------------------------- # * Single Letter Update # letter : Number on the letter which will be updated #-------------------------------------------------------------------------- def update_letter(letter) sprite = @array_of_sprites[letter] value = @array_count[letter] var = (value.to_s.length - 1) * 11 sprite.bitmap.dispose sprite.bitmap = @array_of_bitmaps[letter].dup sprite.bitmap.draw_text(28,12,64,64,'x ' + value.to_s) sprite.src_rect.width = 64 + var sprite.viewport.rect.width = 64 + var sprite.viewport.rect.x = 640 - sprite.viewport.rect.width sprite.update end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update(x = 640, y = 10, step = 32) counter = 0 for element in @array_of_sprites sprite = Sprite.new(Viewport.new(x-64,y+(step*counter), 64, element.viewport.rect.height)) sprite.bitmap = element.bitmap element.dispose value = @array_count[counter] var = (value.to_s.length - 1) * 11 sprite.bitmap.dispose sprite.bitmap = @array_of_bitmaps[counter].dup sprite.bitmap.draw_text(28,12,64,64,'x ' + value.to_s) sprite.src_rect.width = 64 + var sprite.viewport.rect.width = 64 + var sprite.viewport.rect.x = 640 - sprite.viewport.rect.width @array_of_sprites[counter] = sprite sprite.update counter += 1 end end #-------------------------------------------------------------------------- # * Hide #-------------------------------------------------------------------------- def hide for sprite in @array_of_sprites sprite.visible = false end end #-------------------------------------------------------------------------- # * Show #-------------------------------------------------------------------------- def show for sprite in @array_of_sprites sprite.visible = true end end #-------------------------------------------------------------------------- # * Score #-------------------------------------------------------------------------- def score temp = 0 for i in 0...@array_of_points.size temp += @array_of_points[i] * @array_count[i] end return temp end #-------------------------------------------------------------------------- # * Disposal #-------------------------------------------------------------------------- def dispose for element in @array_of_sprites element.dispose end for element in @array_of_bitmaps element.dispose end @array_of_bitmaps.clear @array_of_sprites.clear #@array_of_points.clear #@array_count.clear end end #============================================================================== # ** Scene_Menu #------------------------------------------------------------------------------ # This class performs menu screen processing. #============================================================================== class Letter_Result_Menu #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize @menu_index = 0 end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "Okay" @command_window = Window_Command.new(160, [s1]) @command_window.index = @menu_index # Make letter window @letters_window = Window_Letters.new @letters_window.x = 0 @letters_window.y = 64 # Make letter amount window @amount_window = Window_Letter_Amount.new @amount_window.x = 0 @amount_window.y = 416 # Make results window @results_window = Window_Letter_Results.new @results_window.x = 160 @results_window.y = 64 # Make level window @level_window = Window_Letter_Level.new @level_window.x = 160 @level_window.y = 0 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update if $letter_minigame != nil $letter_minigame.update end # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @command_window.dispose @letters_window.dispose @amount_window.dispose @results_window.dispose @level_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @letters_window.update @results_window.update @results_window.update @level_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B or C button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Dispose of $letter_minigame $letter_minigame.dispose # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Play decision SE $game_system.se_play($data_system.decision_se) # Dispose of $letter_minigame $letter_minigame.dispose # Switch to map screen $scene = Scene_Map.new return end end end #============================================================================== # ** Window_Letters #------------------------------------------------------------------------------ # This window displays amount of each Letter. #============================================================================== class Window_Letters < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 352) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if $letter_minigame != nil counter = 0 for sprite in $letter_minigame.array_of_sprites self.contents.blt(0,-22+32*counter,sprite.bitmap,sprite.src_rect) counter += 1 end end end end #============================================================================== # ** Window_Letter_Amount #------------------------------------------------------------------------------ # This window displays the total amount of letters. #============================================================================== class Window_Letter_Amount < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear word = $data_system.words.gold if $game_party.gold == 1 then word = word.chop end amount = 0 for element in $letter_minigame.array_count amount += element end cx = contents.text_size(word).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, amount.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, word, 2) end end #============================================================================== # ** Window_Letter_Results #------------------------------------------------------------------------------ # This window displays the score of the level and how it is computed. #============================================================================== class Window_Letter_Results < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 416) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if $letter_minigame != nil array_count = $letter_minigame.array_count array_of_points = $letter_minigame.array_of_points array_of_sprites = $letter_minigame.array_of_sprites counter = 0 sum = 0 for sprite in array_of_sprites firstpart = (array_count[counter].to_s.length + 1) * 11 + 36 secondpart = (array_of_points[counter].to_s.length + 1) * 11 value = array_of_points[counter] result = value * array_count[counter] sum += result y = 32*counter if y > 351 then y = 550 end self.contents.blt(0,-22+y,sprite.bitmap,sprite.src_rect) self.contents.draw_text(firstpart,-10+y, 480,64,'x ' + value.to_s) self.contents.draw_text(firstpart + secondpart + 7,-10+y, 480,64,'= ' + result.to_s) counter += 1 end self.contents.draw_text(0,336,480,64, 'Total Score: ' + sum.to_s) end end end #============================================================================== # ** Window_Letter_Level #------------------------------------------------------------------------------ # This window displays some level information #============================================================================== class Window_Letter_Level < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh text = $game_map.width.to_s + 'x' + $game_map.height.to_s + ' at speed ' + $game_variables[2].to_s self.contents.font.color = system_color self.contents.draw_text(0,-16,480,64,text) end end I have collected them all in 1 file which can be downloaded here: http://www28.websamba.com/Vobbys/Letter_Minigame_All.txt I don't recommend it, but I acknowledge the fact that some people don't want to copy each class into a separate place in the script editor. Note that I haven't tested using that file. Instructions Here I will try to explain how the scripts is used. I have split this section in two. One for the Maze Generator. This generates the maze and places the events. This is not linked with the Letter Minigame. One for the Letter Minigame. This controls the letters collected and the visual effects. This is not linked with the Maze Generator. A normally made level could be used. You can look at the scripts in the end of the scripts editor. I have also edited some of the normal scripts in the demo. These has been marked by having a * in front of its name in the script chooser. This is the Maze_Generator module. To call it use this syntax: Maze_Generator::Maze.new(x, y, max_chance, array_of_events, value=0, layer=1) x : x-coordinate for starting point y : y-coordinate for starting point max_chance : The total chance used for choosing among the events array_of_events : Numbers on events paired with their chance value value : value of the tileset assigned to the maze (default=0) layer : the layer that will be crawled (default=1) An example could be: Maze_Generator::Maze.new(49,49,300,[[2,22],[3,19],[5,17], [6,14],[7,10],[9,2]],0,1) Notice the how you should write the array_of_events. The first number is the number on the event you want. In this example the script will start in 49,49 and spread out from there. It will change the tiles on layer 1 to 0 if it's not already 0. You can encapsulate the maze by making a border of tiles with 0 as value. Otherwise it will be restricted by the map borders. In dead ends it might place an event. The second value you see in each pair shows the change that the corresponding event is spawn. It is compared to the total probability. There is a 22/300 chance of event number 2 being spawned in a dead-end. There is a 19/300 chance of event number 3 being spawned in a dead-end and so on. The originally placed events WILL be deleted. Don't let the user save the game in a map where you have used the Maze_Generator as the changes will not be saved. This is the letter minigame itself. Managing how many of which letters are collect and showing the stats. To call it use this syntax: $letter_minigame = Letter_Minigame.new(array_of_events, array_of_points) array_of_events : Numbers on the events used. array_of_points : The amount of points for the corresponding event in array_of_events. Linked by placement. $letter_minigame is the reference used by the results screen. An example could be: $letter_minigame = Letter_Minigame.new([2,3,5,6,7,9],[10,15,20,25,30,100]) This will take and use the graphics from event number 2,3,5,6,7 and 9 The latter shows the amount of points each element is worth. The first element will have the graphic from event number 2 and be worth 10. The second element will have the graphic from event number 3 and be worth 15 and so on. The events you should collect must contain this line as a script: $letter_minigame.add(position) position : Position of the element in the array. First position = 0 For example the syntax $letter_minigame.add(0) Should be put in the events which has the graphic of event number 2 and are 10 points worth. $letter_minigame.add(1) Should be put in the events which has the graphic of event number 3 and are 15 points worth and so on. Now when the minigame is finished used this syntax to call the results screen. $scene = Letter_Result_Menu.new This will gather information from $letter_minigame You might have an interest in changed the results screen accordingly to your needs. Feel free to do so The command $letter_minigame.score returns the score. This works even after the $letter_minigame.dispose command is used. That is because .dispose leaves the little information needed for calculation the score. You can for example use this for giving prizes afterwards. FAQ How could I make a maze that has no timer on it with this script? Cause I wanna make a maze, and put a boss in it, but I want the maze to be randomized, and I don't want the timer either. The other thing is, how can I set this up so that I can have just the 1 boss event in it in a specific spot, and not have to worry about that spot being in a wall, or unreachable because the maze wasn't made right. It will continue to spread outwards like that. Symbol Explination: S: Starting point P: Very high possibility of being a passable square (non-wall), above 90% I'd say. Probability decreases near edges. O: Might be a wall, might not. No significant difference is probability. X: Is most certainly a wall. So you can put your boss on the starting point for certainty or on one of the P's for a very good chance of not being in a wall. (Don't put the boss near an edge in this case) There might also be another solution you can use. You see the X's are most certainly a wall. What now if the wall was passable and the other wasn't? That way the script would create the wall. As the script create an acyclic graph (you don't have to understand this term) you be certain that there is a way from outside into any, yes? ANY of the X-squares. If you do not have a rim around the maze you can however not be sure of a way from one X to another. Something like this might do the trick: Maze_Generator::Maze.new(49,49,0,[],48) The 48 tells the script to use the tile graphic with id 48. Before 0 was used. 48 is generally water. I don't know the system for this. I just found out with trial and error. If you are creating a wall rather than a path you can also encase an area or the maze itself by putting the title with id-48 on the P's. There will be a walkable path around the P. You have to something like because I haven't scripting in the possibility to have just one and no more than one of a certain event places somewhere in the maze. I or you could try to simply put the event on the last square touched by the crawler. (Script edit) I hope you will find my answer satisfying. How do I set up item prizes? For example, if I had 250 points, I win a potion or something like that. Using this command will return the score: $letter_minigame.score For non-scripters you can use the Call Script command with $game_variables[10] = $letter_minigame.score, where the 10 is the variable number. Just set it to the number of the variable you want to use. Now that you have the score in a variable I assume that you can do the rest. Compatibility Is not compatible with saving and loading. The map will reset if loaded. Might be SDK compliant. Credits and Thanks I would like to thank RMXP ? Underground personal for creating a scripting contest which inspired me to create this work. I would like to thank everyone using their time to try this and finally I would like to thank everyone reading this topic. Thanks. Author's Notes I suggest using Near Fantastica's anti event lag script due to the often high amount events. This script can create more than 1000 events. I suggest however that you refrain from designing level where this is an eminent possibility. Using the event command Erase Event will not entirely delete the event. The event still exists in the $game_map.events and lags about as much as a blank events. And finally: ENJOY! - Zeriab
  16. Pig Puzzles Version: 1.0 Introduction The event system Pig Puzzles has been made by Zeriab. The event system plus this topic has been made as an experiment directed at eventers. (There are no instructions for example) You can still use it in your games. I would recommend having your eventer take a look at it anyway. Thanks goes to RMXP for making this possible. Credits should be given. The purpose in Pig Puzzles is to guide the lost pig into the closure made for it. The pig will continuously repeat the few instructions given to it. (Different per level) In the system provided there are 4 different instructions you can give the pig, which basically is which of the ways the pig should move. That?s basically all there is to the game. Note that I haven?t used much energy on the mapping, so try to look away from it. You can easily add more instructions by increasing the base and add more pages to the pig. You could also use the principle of this system for other purposes. Just look in the game and read the comments. I hope they will be sufficient. Screenshots Event System You should be able to download the event system from at least one of the links in the spoiler. http://rapidshare.com/files/11123099/Pig_Puzzles.rar.html http://www.megaupload.com/?d=6BUYW4RI http://www.i-file.org/?d=06A3CA631 http://www.savefiles.net/d/weizobdptp.html http://www.upitus.com/download.php?file=3a5a2629 http://d01.megashares.com/?d01=ca076ac http://www.sendmefile.com/00495037 http://www.sharebigfile.com/file/56744/Pig-Puzzles-rar.html http://filecargo.com/dw.php?id=1168464016&...g%20Puzzles.rar http://www.titanicshare.com/download.php?id=BF0CF485 http://www.fileskip.com/download/fRa6cXNnJH http://www.bestsharing.com/files/Tt8TVo201...uzzles.rar.html http://www.mediafire.com/?3mnmr1ymmmy http://fisier.net/106909 http://www.axifile.com?4616105 http://www.filesend.net/download.php?f=b30...f06d39f8482a38f http://www.teeups.com/download/UnfePLZf61 http://www.zshare.net/download/pig-puzzles-rar.html http://www28.websamba.com/Vobbys/Pig%20Puzzles.rar FAQ None yet Issues As you'll probably notice this system is not perfect. If you are an eventer you could try to solve some of the issues. Just use this section in any way you want. If you use it I hope you will learn from the experience. ;) Note: I have not thought about the difficulty level of the problems, so don't be surprised if it vary a lot. (When you find errors you usually don't find them in order of how difficult they are to solve) If you reset while the pig is moving you will notice the pig sometimes move after the reset. Fix the issue I can tell you there exist a simple fix. This does not necessarily mean it is easy though. Good luck ;) When you enter the digits you use digit 0 to exit. I.e. you cannot enter 0 as an instruction. In the system provided there are 4 instructions (1,2,3,4) yet they need a base of 5 because 0 has to be included. The instruction 0 has complications the other instructions have not, which is why it cannot be directly implemented. Make it possible to include the 0 instruction where it behaves in the same way as the other digits. It might be a good idea to store the instructions with more than 1 variable. The way you enter the instructions are present in the event you trigger. As there are more levels there are dublicates of the instructions. Why have dublicates if you just can have a common event. Make an common event that does the job and can be called where ever You can see how users of the system can change the show messages in the top of the event. Let's say the user wants the text to be different from one event to another. How would you solve that? Would you go back to the original setting and copy the NPC with a full instruction set and not just a call to a common event or will you make several common events where you just alter the text in them? Well... It could be the user wants every NPC to say something different, or perhaps the user wants groups of NPCs where each group says something different and every NPC in a group say the same thing. Is your answer to the previous question the same in both situations? Here's a thought. You know the engine part? The part where calculations are done, the part below the warning comment. What if you wanted to split the event so the engine part was present in the common event and the user-editable part was in the NPC. How would you do it? Try to think about these questions: Can it be done? How much should be put in the common event part and how much should be put in the NPC? I.e. how should the work be distributed? How should the communication between NPC event and common event be established? How complex will the solution be? How much is gained versus the amount of extra work and code? Is it worth the trouble? There is no reason wasting your time on a super complex solution if it is better you kept the old version and didn't do anything at all. There is basically just 2 issues and something to think about in this section. There might be other issues lurking around in the system. How would you go about finding unknown issues. In fact you don't even know if there is any issues or not. Develop strategy for finding issues At least thinking about it would help. You can never be sure there aren't any issues left, but you can try to limit the amount of issues. (Note the word 'try') Also be aware that it is possible not finding any issues. This is more something for you and hopefully you will be able to create better event systems. I am going to leave this open and just event with: Don't make the conclusion: "I found no issues, therefore there are no issues" Credits and Thanks I would like to thank everyone using their time to try and use Pig Puzzles. I would like to thank everyone reading this topic. Thanks. Author's Notes I am certain I can make this thread better, so if there are anything you find confusing, bad or good. Please do help me by telling me this. If you find something to be confusing I can try to clarify it. If you find something to be bad I can try to make it better. If you find something to be good I can let it stay. (Think if I removed something good) That is why I want you comments, that and because they make me happy ^_^ Oh, and finally: ENJOY! - Zeriab
  17. Picture Scrolling System (Event Based) I was helping someone who had problems with the Making an Introduction located at http://www.rmxp.org/ccoa/index.htm This person had made some errors. When I fixed I thought: "Hey, I can make this into a smarter more user friendly system" By smarter I meant it was easier for the editor to set up. Especially the ability to easily set a rather long wait. In case you didn't know. You can max set a wait to 999 frames. You can max set a variable to 99 999 999. By more user friendly I mean giving the user the ability to scroll the text faster and skip it at their command. Anyway enough talk. Here's the event: Page 1: Page 2: Remember to set the condition of page 2 to Local Switch A is ON. Also the actions shown on page 2 are just there for an example. If you ever want to come back to the map you used it in, remember to turn a switch ON and make a new page with the condition or something similar. You can likewise do the actions in the end of page 1 let the switch turn on and leave Page 2 blank. It's up to you. If I have done my comments properly I shouldn't need to talk what you should do to set it up. Also you may post this wherever you want. You have my permission. You are also free to extend it, make it more simple, in fact to edit it in anyway. It would be nice if you try to keep the comments or update them so it's easy to set it up. Well, that's that. - Zeriab
  18. Here's some links to pages you might want to read before start scripting RGSS. Tutorials for learning RGSS: Dubealex's RGSS Script Tutorials: RGSS & Ruby Lesson - Chapter 1 RGSS & Ruby Lesson - Chapter 2 RGSS & Ruby Lesson - Chapter 3 Astro's RGSS Script Tutorials: (mirror) Lesson 1: Comments, Classes, and Variable Syntax Lesson 2: Variable scope, attributes, constants, return, and super Lesson 3: Advanced Methods and If Lesson 4: Case, Loops, and Iterators Lesson 5: Numbers Lesson 6: Strings RPG's RGSS tutorials Tutorial 1 : The Basics Tutorial 2 : Variable Tutorial 3 : Control Flow - Part A Tutorial 3 : Control Flow - Part B Tutorial 3 : Control Flow - Part C Tutorial 4 : Containers & Methods - Arrays and Hashes (Part 1) Tutorial 4 : Containers & Methods - Blocks and Methods (Part 2) RGSS Syntax: Near Fantastica RGSS Syntax List RGSS References at Dubealex.com Other useful stuff: Misc. Ruby Stuff by Aoshiwik If you want to learn ruby (not connected to RGSS) go to Rubycentral.com Go here for a list of the built-in Ruby classes and modules RadRails.com <-- An excellent Ruby SDK (Software Developer Kit). Based on Eclipse. If you have anything to add, please say so.
  19. Yup. I am here. I came here because Satiel asked me too, so I thought I might as well check it out. I don't really know what else to say... I'll probably lurk around and post occasionally - Zeriab
×
×
  • Create New...