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

diagostimo

Member
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by diagostimo

  1. class Scene_Menu def main #INITIALIZE YOUR MUSIC Audio.bgm_play("Audio/BGM/" + NAME, VOL, PITCH) #THEN EVERTHING ELSE # #THEN AFTER EVERYTHING ELSE WRITE THE CODE TO END THE MUSIC Audio.bgm_stop #will autoplay any autoplay music set for the map $game_map.autoplay end end also if your map has bgs playing you can use: Audio.bgs_stop at the begining to stop it
  2. oops typo, and looks like you beat me to it :P
  3. its pretty simple, look into the main proccess of your scene "def main", here you will see a load of code get initialized up top, then somewhere central you will see the loop proccess that keeps the scene active: loop do Graphics.update Input.update update if $scene != self break end end then just below the loop you will see all the objects get disposed, so basicly it stays in the loop when the scene is active, then when it changes the loop breaks and continues to dispose, basicly you want to change the music before the loop for your menu music, then after it to change the music back to the maps music you can use this script snippet: $game_map.autoplay
  4. well theres a pretty awesome speech bubble system here that uses window skins to draw the bubble : http://forum.chaos-project.com/index.php?topic=11299.0
  5. sweet, when testing note that the images are drawn in the order you arrange them in the array, from bottom to top, also i have added scrolling to the text field, so throw lots of text in there and test it out :)
  6. i like it, my only tut is the lighting on the front, there should still be a litle lighting on the front from the glow of the eyes, overall very nice, i wish i was that good at drawing :3
  7. ok i have made a fair amount of progress on this, here is the up to date script: the script calls and config within the script have changed slightly so re look over them, now you need to add text files into a directory to be converted, in your main projects folder create a folder called "lore items", spelled exact, then in this folder is where you put txt files to convert, call your text files as follows "lore ID PAGE.txt" with the spaces, obviously compensate the page and id acordingly, so for lore id 1 page 1: "lore 1 1.txt" now how to setup your text files, in a txt file copy and paste this base: #images config[x, y, image_name, opacity] #opacity:255MAX, 0 MIN [0, 0, picture_1, 255], [0, 0, picture_1, 255], [0, 0, picture_1, 255] #text box settings[x, y, width, height, z] [0, 0, 100, 128, 200] then the text for the window then the text for the window then the text for the window ect ect ect ect ect ect ect ect ect ect ect do not add quotation marks "" for anything, the following script converts all the data acordingly, all you need to know is line 1 and 3 are reserved for the comments, line 2 and 4 are the configurations then the rest of the text document is text to be displayed the script to convert data: the converter will not automaticlly work as of yet, but i will add that feature, for now to convert each document use the following script call in an event: $game_system.create_file(ID, PAGE) i know its a pain to do the script call for every id and page now is a bit of a pain but its just for test purposes for now, after it has converted the txt document in the same dirtectory you will se the encrypted .rxdata files, so you can then delete your text files once you no longer need them, dont wory about deleting the data files there automaticly updated when the script runs let me know what you think :)
  8. ok, a some testing of the script i posted last i found a fair few bugs, this is a revised version: class Sprite_Battler < RPG::Sprite alias init_bars initialize alias update_bars_update update def initialize(viewport, battler = nil) init_bars(viewport, battler) if @battler.is_a?(Game_Enemy) @bars = false end end def update if @battler.is_a?(Game_Enemy) if @bars == false create_bars @bars = true else update_bars end end update_bars_update end def create_bars #set full settings @full_hp = @battler.hp @full_sp = @battler.sp #create bitmap @bitmap_bars = Sprite.new @bitmap_bars.opacity = 0 @bitmap_bars.x = @battler.screen_x - 26 @bitmap_bars.y = @battler.screen_y + 7 @bitmap_bars.z = 50 @bitmap_bars.bitmap = Bitmap.new(54, 15) #shell rect = Rect.new(0, 0, 54, 15) @bitmap_bars.bitmap.fill_rect(rect, Color.new(0, 0, 0)) rect = Rect.new(1, 1, 52, 6) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 255, 255)) rect = Rect.new(1, 8, 52, 6) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 255, 255)) #draw hp one_hp_block = @full_hp / 50 current_hp = @battler.hp get_hp = current_hp / one_hp_block rect = Rect.new(2, 2, get_hp, 4) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 0, 0)) #draw sp one_sp_block = @full_sp / 50 current_sp = @battler.sp get_sp = current_sp / one_sp_block rect = Rect.new(2, 9, get_sp, 4) @bitmap_bars.bitmap.fill_rect(rect, Color.new(0, 0, 255)) end def all_dead? $game_party.actors.each {|a| return false if a.hp > 0 } return true end def update_bars if @battler.hp == 0 or all_dead? @bars = nil #bars disposal @bitmap_bars.bitmap.dispose @bitmap_bars.dispose return end #hp unless @bars == nil @bitmap_bars.bitmap.clear #shell @bitmap_bars.opacity = self.opacity if @bitmap_bars.opacity != self.opacity rect = Rect.new(0, 0, 54, 15) @bitmap_bars.bitmap.fill_rect(rect, Color.new(0, 0, 0)) rect = Rect.new(1, 1, 52, 6) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 255, 255)) rect = Rect.new(1, 8, 52, 6) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 255, 255)) #draw hp one_hp_block = @full_hp / 50 current_hp = @battler.hp get_hp = current_hp / one_hp_block rect = Rect.new(2, 2, get_hp, 4) @bitmap_bars.bitmap.fill_rect(rect, Color.new(255, 0, 0)) #draw sp one_sp_block = @full_sp / 50 current_sp = @battler.sp get_sp = current_sp / one_sp_block rect = Rect.new(2, 9, get_sp, 4) @bitmap_bars.bitmap.fill_rect(rect, Color.new(0, 0, 255)) end end end i went a differnt way on implementing the code and this should be a lot more compatible as well as not buggy, this will actually most probably work with most custom battle systems, enjoy :D
  9. battle systems are not my speciality but i whiped this up together: class Spriteset_Battle alias init_bars initialize alias update_bars update alias dispose_bars dispose def initialize @full_hps = [] @full_sps = [] @last_hps = [] @last_sps = [] (0...$game_troop.enemies.size).each {|i| @full_hps.push($game_troop.enemies[i].hp) @full_sps.push($game_troop.enemies[i].sp) @last_hps.push(@full_hps[i] + 1) @last_sps.push(@full_sps[i] + 1) } init_bars end def draw_bars @hpbars = [] @spbars = [] @last_hps = [] @last_sps = [] (0...$game_troop.enemies.size).each {|i| enemy = $game_troop.enemies[i] @last_hps.push(enemy.hp) @last_sps.push(enemy.sp) @hpbars.push(Sprite.new) @hpbars[i].z = 100 @hpbars[i].bitmap = Bitmap.new(640, 480) @spbars.push(Sprite.new) @spbars[i].z = 100 @spbars[i].bitmap = Bitmap.new(640, 480) #draw hp rect = Rect.new(enemy.screen_x - 25, enemy.screen_y, 52, 6) @hpbars[i].bitmap.fill_rect(rect, Color.new(0, 0, 0)) one_hp_block = @full_hps[i] / 50 current_hp = enemy.hp get_hp = current_hp / one_hp_block rect = Rect.new(enemy.screen_x - 24, enemy.screen_y + 1, get_hp, 4) @hpbars[i].bitmap.fill_rect(rect, Color.new(255, 0, 0)) #draw sp rect = Rect.new(enemy.screen_x - 25, enemy.screen_y + 7, 52, 6) @spbars[i].bitmap.fill_rect(rect, Color.new(0, 0, 0)) one_sp_block = @full_sps[i] / 50 current_sp = enemy.sp get_sp = current_sp / one_sp_block rect = Rect.new(enemy.screen_x - 24, enemy.screen_y + 8, get_sp, 4) @spbars[i].bitmap.fill_rect(rect, Color.new(0, 0, 255)) } end def update (0...$game_troop.enemies.size).each {|i| enemy = $game_troop.enemies[i] draw_bars if enemy.hp != @last_hps[i] && @enemy_sprites[i].battler_visible } update_bars end def dispose @hpbars = nil @spbars = nil dispose_bars end end class Sprite_Battler attr_reader :battler_visible end it should work fine below all other custom scripts, let me know if you have any errors, the bars are nothing flash but its better than nothing :)
  10. is this a part of an update method or the main proccess? it looks like it the main proccess as your using the loops to proccess the images, which confuses me where id your Input.update ? really you should call it in each loop before each input check in order for the check to be successful at that frame in time
  11. no the actual file will be visible, but the data will be converted to a format that is inaccessable, converting it all to variables and saving it like a save file, but to a directory so it doesnt clutter your game directory
  12. ok i can make those ajustments, i have a quick question, i have been playing with the text files and have been able to convert the text into arrays to use as configuration, my question is do you want me to make the script convert the data from the text file and save it into a new unaccessable file? e.g: the script checks if file "lore (id) (page).data" exists if it exists it gets the data from that file if it doesnt exist it checks for the file "lore (id) (page).txt" if the txt file doesnt exist it will error as your trying to call an item that has no settings if the text file exists, it reads the data and then creates the .data file (or whatever extension it has) the .data file is used from then on allowing you to remove or delete the text files so someone else cant edit them if you need to change the configuration of an item, you can simply delete the data file, then re add the text file to be loaded creating the new file with new settings i think this would be the best way to ensure that others cant come in and change stuff, it would all be automated by the script the only thing you would have to do is call each item at least once so it converts the data
  13. to be honest i have never looked into the syntax of rgss2 so i couldnt tell you, the only way to tell would be to test it and find out, although it would not be very likely as all the classes as follows would have to be structured the same, or have same variable names: Window Window_Base Window_Selectable if all of those classes have same variable names as ones in rgss1 then it will work, otherwise it wont, and i cant offer compatibilty as i only use rmxp
  14. thought i would share a little progress, heres what i have so far, it is comented how to call it at the moment: im going to start making the pages multi window, i think ill show a page marker in the top right or bottom right like: page 1/Amount, how exactly to you want me to enable the switching of pages? i can do it with the L and R input if you like, im also gonna start making the text field, do you want me to create some sort of border for the text field? or i can make it a new window completely over the current, then if the text is overflowing it will show the prompt arrows to scroll down/up like other windows, im trying to figure out the best way to configure the text, im thinking creating a text file for each item and window, and storing them in there own directory
  15. ill have a crack at it, just a few questions with the basics: do you want an image as the windows back or a windowskin, or the choice to configure the back between differnt windowskins and images what is the rough size you would like the windows to be, bearing that rmxp default screen size is 640 X 480, i can also make this configurable if you like do you want the lore menu to be accessible if no items are obtained, then in the lore menu itself do you want items to appear faded if they are not in possession or just not displayed at all also on window size, if its smaller than the games window size, do you want a background image for your lore menu i cant promise this being fast development as i have alot of course work at the moment, but ill do it in my free time
  16. diagostimo

    Movement

    either create a new event to manage it or add a new line in the same script call, adding a new line means that it runs both script calls in that one script call
  17. diagostimo

    Movement

    if you look at the demo i upladed yoy will see exactly how to use the script calls, basicly use : $game_player.change_frames(AMOUNT, TIME) when changing the players frames, and : $game_map.events[iD].change_frames(AMOUNT, TIME) to change an events frames, fore event relpace ID in the brackets [] to the id of the target event, then replace AMOUNT to the amount of frames to run through, and TIME to the frame time it takes to proceed through them
  18. diagostimo

    Movement

    the only reason i can think you would get that error is if your not adding the first script in, here a demo i got it working in to help, i marked the edited scripts, copy over and replace all the scripts to your project http://www.mediafire.com/?mq9xvgg73z9deml
  19. the arc project(advanced rpg creater) at chaos project: http://forum.chaos-project.com/index.php/board,68.0.html had a discussion at making games portable to devices like such, perhaps you would want to look it up :)
  20. diagostimo

    Movement

    it would be good to know exactly witch script snipet you are getting the error from, for the snippet you replyed to, it should be replaced to look like so: if @frame_amount == 0 # If animation count exceeds maximum value # * Maximum value is move speed * 1 taken from basic value 18 if @anime_count > 18 - @move_speed * 2 # If stop animation is OFF when stopping if not @step_anime and @stop_count > 0 # Return to original pattern @pattern = @original_pattern # If stop animation is ON when moving else # Update pattern @pattern = (@pattern + 1) % 4 end # Clear animation count @anime_count = 0 end end for the first code snippet i posted, place it anywhere below defaults and above main
  21. diagostimo

    Movement

    im guessing you need more control over the changing of the frames, i quickly wrote this up to achieve such: class Game_Character attr_reader :frame_amount alias init_frames initialize def initialize init_frames @frame_amount = 0 @frame_count = 0 @frame_timer = 0 end def change_frames(amount, time=20) @frame_amount = amount @frame_count = time end def increase_frame @frame_timer = @frame_count if @frame_timer == 0 @frame_timer -= 1 if @frame_timer > 0 @pattern = (@pattern + 1) % 4 if @frame_timer == 0 @frame_amount -= 1 if @frame_timer == 0 end alias update_frames update def update increase_frame if @frame_amount > 0 update_frames end end there is 2 small edits that you will have to make to the default scripts before this works properly, (1) go into game character 2 script an look up line 21, you will see the following: # If animation count exceeds maximum value # * Maximum value is move speed * 1 taken from basic value 18 if @anime_count > 18 - @move_speed * 2 # If stop animation is OFF when stopping if not @step_anime and @stop_count > 0 # Return to original pattern @pattern = @original_pattern # If stop animation is ON when moving else # Update pattern @pattern = (@pattern + 1) % 4 end # Clear animation count @anime_count = 0 end wrap that in this condition: if @frame_amount == 0 end (2) look up interpreter 1 script, go to line 141 and add the following above the "if @ message_waiting" condition: for event in $game_map.events.values return if $game_player.frame_amount > 0 or event.frame_amount > 0 end the first edit ensures that the frame will not reset to 0 when the script is running and the second ensures that the event wont proceed until it has finished, so now to use the script: #script calls #for the player: $game_player.change_frames(AMOUNT_OF_FRAMES, FRAME_TIME) #or for events: $game_map.events[EVENT_ID].change_frames(AMOUNT_OF_FRAMES, FRAME_TIME) simply change AMOUNT_OF_FRAMES to the amount of times it will change frame, and FRAME_TIME to the amount of time it takes to procceed to the frame(just like the wait frames command) hope this helps, it will definatly give you more control over the timing of the frames :) also you dont have to add the FRAME_TIME in, if you dont it will throw a default of 20
  22. hmm strange im sure i got that to work yestarday and its giving me nothing but trouble today, i changed the code slightly, this should work now: SAVE_IDS = [1, 2, 4] class Game_Chest attr_accessor :items, :weapons, :armors end class Scene_Save alias decision_items on_decision def on_decision(filename) decision_items(filename) item_file = File.open("item_data", "wb") save_items(item_file) item_file.close end def save_items(file) chests = [] (SAVE_IDS).each {|i| chests[i] = [] chests[i].push($game_system.chests(i).items) chests[i].push($game_system.chests(i).weapons) chests[i].push($game_system.chests(i).armors) } Marshal.dump(chests, file) end end class Scene_Title alias new_game_items command_new_game def command_new_game new_game_items if FileTest.exist?("item_data") item_file = File.open("item_data", "rb") chest_data = Marshal.load(item_file) (SAVE_IDS).each {|i| chest = $game_system.chests(i) chest.items = chest_data[i][0] chest.weapons = chest_data[i][1] chest.armors = chest_data[i][2] } item_file.close end end end class Scene_Load alias read_items read_save_data def read_save_data(file) read_items(file) if FileTest.exist?("item_data") item_file = File.open("item_data", "rb") chest_data = Marshal.load(item_file) (SAVE_IDS).each {|i| chest = $game_system.chests(i) chest.items = chest_data[i][0] chest.weapons = chest_data[i][1] chest.armors = chest_data[i][2] } item_file.close end end end
  23. ok i had some free time so here i have it: SAVE_IDS = [1, 2, 4] class Scene_Save alias decision_items on_decision def on_decision(filename) decision_items(filename) item_file = File.open("item_data", "wb") save_items(item_file) item_file.close end def save_items(file) chests = [] (SAVE_IDS).each {|i| chests[i] = $game_system.chests(i) } Marshal.dump(chests, file) end end class Scene_Title alias new_game_items command_new_game def command_new_game new_game_items if FileTest.exist?("item_data") item_file = File.open("item_data", "rb") chest_data = Marshal.load(item_file) (SAVE_IDS).each {|i| $game_system.chests[i] = chest_data(i) } item_file.close end end end class Scene_Load alias read_items read_save_data def read_save_data(file) read_items(file) if FileTest.exist?("item_data") item_file = File.open("item_data", "rb") chest_data = Marshal.load(item_file) (SAVE_IDS).each {|i| $game_system.chests[i] = chest_data(i) } item_file.close end end end put this above main and below all defaults, just add the id's of the chests that are to be saved into the top array, this will create a new file that contains all the relevant data and that file is used to cross over all the data, enjoy :) ps. let me know if you have any errors, i think i ironed it out but never know
  24. one question, as the script sets up chests with id's would you want to configure set id's to be saved that are accessible across other saves or would you want them all to be accessible other the saves, i ask this as you may only want a couple of chests that are accessable over saves, e.g. a home chest, and have other chests in the game that are unique to that save
×
×
  • Create New...