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

ForeverZer0

Member
  • Content Count

    383
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by ForeverZer0

  1. I believe it is. I'm just trying to find the correct value at the moment. Should be pretty simple with a matrix transformation if that;s all more it is. I believe I was just over-thinking it... :P
  2. I am trying to emulate a similar feature to that of RMXP's "blend_type" for the Sprite class, and I can't seem to get it quite right. I was curious, does anyone know the calculation that is performed to do the addition and subtraction blends on an image? I'm using C#, and have been getting familiar with the ColorMatrix class, have created functions for altering brightness, saturation, color blending, opacity, color shearing, contrast, etc., but fail at this seemingly simple function. I am using for creating a small utility for RMXP, and it is kinda important that it is accurate to the method that RMXP uses. This is basically the final thing to implement, and I can finish up pretty quickly after that.
  3. They define the parent of the class. Any child of a class inherits all of its parent functionality, but since it is not the exact class, you are free to modify its methods, etc. See if this helps you understand a bit better in a very basic example class Creature attr_reader :name def initialize(name) @name = name end end class Dog < Creature attr_reader :breed def initialize(name, breed) super(name) # Calls the parents initialize method, setting the name # We don't need to re-define @name since it is in the parent class # Since "breed" doesn't apply to all creatures, the Dog class alone uses it @breed = breed end end class Labrador < Dog def initialize(name) super(name, "Labrador") print_some_stuff end def print_some_stuff # Even though we never explicitely set these variables in this class, they # were set in the super class, so they are valid for this class p @name p @breed end end
  4. Yes, thats perfect. Any type of graphical related operation is usually the most costly on performance, so you should always only do it when its necessary. The example you have above is the way to do it. First check if the value has changed, then redraw the Bitmap only if it has, otherwise do nothing. This same method of first checking for inequality and then performing the required action can also be extended into other non-graphical things like iterations, etc. A simple check of equality of two objects, especially basic ones like integers, has much less overhead than performing actions every frame when its not needed. As for your other question, the character sprites are a pain in the ass to reference, hence my remark about the poor structure earlier. They are all privately contained in Spriteset_Map, which is also a private object if Scene_Map. Its kinda against convention to reference the objects through the $scene variable, but a quick and dirty way to get to them is something like this: class Scene_Map attr_accessor :spriteset end class Spriteset_Map attr_accessor :character_sprites end p $scene.spriteset.character_sprites[iNDEX_OF_SPRITE].z
  5. It is probably wiser not to use symbol syntax, more to avoid creating a bad habit than being wrong. Ruby symbols are basically the name of an object, whether it be a method, instance variable, string, or constant. The context of what these objects actually are is ignored, so if you had a a method labeled :mySymbol and a class named :mySymbol, they will both have the same object ID, which COULD lead to possible problems in extremely rare cases. For example: class SymbolTest SymbolTest = 4 end def SymbolTest end All three of these objects have the same object_id, even though one is a class, another is a method, and the other is a constant in a class with the same name.
  6. Actors and characters a not the same. screen_z is a Game_Character method, and you are calling it on a Game_Actor object. Game_Character is used mainly for map objects like the events, player, etc. It holds data that is used to construct the respective sprite in the Sprite_Character class. Game_Actor on the other hand is more for the statistics, equipment, etc, and has no real ties to sprites and screen objects other than the name of their battler graphic. I personally think that Enterbrain didn't do a very good job structuring this particular portion of their scripts. They made it harder than it should have to be to tie these classes together for scripters, although in your case it shouldn't pose a problem. Just reference the correct object.
  7. You don't need to use Win32API to alter the C classes. They are are wrapped into the Ruby runtime, and as such can be modified, aliased, and overwritten the same as any other script. As far as Ruby is concerned, they are scripts, and there is nothing special about them. The only difference is the functions they perform are executed in a lower level language, so pretty much any alteration you make is going to cause a loss in performance, since no Ruby function is going to outperform its C equivalent. Take a look at any custom resolution script out there, I guarantee they will re-write both the Tilemap and Plane classes, which are both wrapped C classes by default.
  8. The Graphics update is running before they are defined. You can do something like: if $game_system != nil # Do some stuff with the Game_System class end Basically just make sure that things are defined before referencing them. That is one drawback of using the Graphics update as an alias. Some stuff won't be created yet when it begins to update. Its usually wiser to alias Game_System's update method, since every scene will likely be calling it, and it is only called after things are created.
  9. module Graphics class << self alias custom_update update def update custom_update if $sprite == nil viewport = Viewport.new(0, 0, 160, 32) viewport.z = 99999 $sprite = Sprite.new(viewport) $sprite.bitmap = Bitmap.new(160, 32) end $sprite.bitmap.clear $sprite.bitmap.draw_text(0, 0, 160, 32, self.frame_count.to_s, 1) end end end Here is a basic example. This style of doing is by creating a meta-class of the Graphics module and aliasing the update method. It give you a separate update method that will run no matter what, as long as the Graphics are being updated. I don't suggest redrawing a bitmap every frame or anything like the example, but its just there to give you the idea.
  10. You can't just make a folder any 'ol where, it is relative to where the program is being ran from. Make an "Images" folder in the same directory as the Game.exe file.
  11. Here is a very basic one I made using RMXP's engine. http://www.rmxpunlimited.net/forums/topic/7003-spritesheet-separatorcombiner/
  12. The above is still wrong... You are missing the original method name in the alias declaration, and the method is recursive, which Ruby does not allow.
  13. There is no point in aliasing anything when you are making it impossible to ever have the original functionality, you may as well just overwrite it. What I meant was something like this: This makes it so that the title is only skipped in the first load. After that, original functionality is restored, and "Returning to Title" doesn't just loop back to the map. As you can seen, there is no loop, and it is all done in one short method. I usually whip one of these little scripts up when writing a script and I have to to constantly keep skipping through the title screen.
  14. Just out of curiosity, why even bother with a "command_new_game" and have it enter a loop, just to break on the next update. And since there is nothing to start the audio, you don't need to stop it. That would only be useful if you actually use a title screen, but since this overwrites instead of aliasing, that won't happen.
  15. Just create a clone of the array when you sets its value, then use that. Since they no longer are pointing to the same reference, changes to one will not effect the other. old_party = $game_party.actors.clone
  16. Does it actually take the seeds, or is the display of the quantity just not updated?
  17. 1. The sound is probably from coming from the animation, I did a quick search for "se_play", and it wasn't found, so that is likely what it is. 2. Don't know. 3. You can actually do it with a a few lines. Create a variable to save $game_map.events when you go to leave a map, before they change to the new map, and then reset them when you return. All you really need is an array or probably more suitable a hash to use to store the events per map, and a small alias to the setup method of Game_Map. I can probably write one in 2 minutes if you need any help.
  18. In my experience, I set the installer to run in compatibility mode, run as administrator, then install. After that you don't need to do anything special except I always run register with the program being run as admin. This method is tried and tested personally a least twenty times and has never failed, using Win7 Ultimate x64. Speaking of things that make keys for things, if you want one that is trustworthy, I have one uploaded on an extremely popular torrent site whose name sounds like a place for Captain Hook to live. Just look for my name as the uploader.
  19. I think as long as the end goal is something realistically achievable, then "yes", the keyword being "realistically". Sure many have beat long odds and came out on top, and there are movies made and books written about them, but it is important to remember this is because they beat the long odds, more often than not, people go down in flames trying to beat these odds. This does not mean that one should not take a step out on faith and try something if it is important to them, but it does mean that in needs to be rooted in logic and have a well thought-out plan to attain it.
  20. class Game_Map attr_writer :map_scrolling alias map_scrolling_init initialize def initialize @map_scrolling = false map_scrolling_init end def map_scrolling? return @map_scrolling end end class Spriteset_Map alias map_scrolling_update update def update $game_map.map_scrolling = (@tilemap.ox != $game_map.display_x / 4) || (@tilemap.oy != $game_map.display_y / 4) map_scrolling_update end end This works. The following will return true/false if the map is currently scrolling or not. $game_map.map_scrolling?
  21. As I said, I pirate everything, but I don't agree with the "they have enough money so it's justified" perspective. It doesn't make any difference if they have trillions of dollars, or twenty, that makes it no less theirs. The point is, they have nothing "less" to show when their products are pirated. In some cases it may stop them from getting more, but you are not actually taking something that they already have. All of their statistics and figures are calculated on the basis that everyone who pirates their stuff would have bought it, when that is far from the truth. Microsoft has not lost $12,000 dollars because I pirated VS 2010 Ultimate. I of course would not have paid that, and simply went with the free Enterprise edition. Same with Photoshop, I wouldn't have bought it, I would just being using a free, albeit less powerful, program like GIMP.
  22. Its not a problem. I noticed you based much of the configuration from it, but you didn't copy-paste the whole script or anything, just used the base as a starting point for your own version of it.
  23. I'm with Polraudio. Xilisoft Ultimate Converter is the way to go. There are also free online services that will do it for you.
  24. I pirate everything. I know its not right, and I completely understand the anger of companies that sell these products. On the other hand, as Marked said, I wouldn't buy these things (software, games, etc.) if I did have to pay for them, so in all reality, the companies whose products I pirate have not lost anything. I'm sure there are many exceptions, but this is likely the case in the overwhelming majority of illegal downloads.
×
×
  • Create New...