Jump to content

Zen Blood

Member
  • Content Count

    170
  • Joined

  • Last visited

1 Follower

About Zen Blood

  • Rank
    Certifiably Sane

Profile Information

  • Gender
    Not Telling

RPG Maker Information

  • RM Skill -
    Jack of All Trades

Recent Profile Visitors

5,391 profile views
  1. Zen Blood

    Show Variables On Save Files

    Hello! I was hoping to program a text line in my save files that indicates where the player is at when they save the game. I've created a global variable ($v_player_location) that is set as a string so I can change the labeled "location" on a whim without having to change the map names in the editor. The player interacts with an event, within that event I have $v_player_location set to whatever location name I want it to be, and then the game saves. The "player location" does indeed show on the save files, but the issue here is that the location for every save file is portrayed as the same string because it's reflecting what $v_player_location currently is, instead of what it was at the time of each individual save. I was able to make the save files show individual play times. def draw_playtime(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "play time: " + header[:playtime_s], 2) end As you can see, it uses the symbol :playtime_s It's been a while since I added the play time, so I'm not sure what "header" is referring to, whether its something I created or a system already in place within the RPGMVXA engine. Don't mind me, I'm half asleep. I've found that "header" is referring to the "def self.make_save_header" line within DataManager. I tried to turn the location into a symbol, too, that would initiate upon a new game and set when the player saves. def draw_location(x, y, width, align) draw_text(x, y, width, line_height, "location: " + contents[:plocation], 4) end This did not work. It seems as though I need to figure out how to tell the program I want to access :plocation within contents, but that one line alone can't do it. I probably have to do some version of the line "header = DataManager.load_header(@file_index)" to access :plocation, from what I can tell. Would anyone happen to have any ideas as to how I can grab the contents of a variable for each individual save and display it on the save files? Edit: Here's another piece of the puzzle that shows how the individual play times where achievable. It was also located in DataManager. Interestingly, it's referenced using "DataManager.load_header(@file_index)" instead of "DataManager.load_header_without_rescue(@file_index)". #-------------------------------------------------------------------------- # * Load Save Header (No Exception Processing) #-------------------------------------------------------------------------- def self.load_header_without_rescue(index) File.open(make_filename(index), "rb") do |file| return Marshal.load(file) end return nil end I had a feeling this would dig into the Marshal load/dump/ect; I'm not entirely sure where to go from here, but I'll keep plugging anyway at it. Another Edit: I read up on a similar question someone had, and a person offered a solution to add the variable under header. I was originally trying to place the variable under "contents". Supposedly, this was what would make the variable work. class << DataManager def self.create_game_objects orig_CGO #This works, I'm just not showing the rest of the script here. #MY OBJECTS $v_player_location = "" #blank at the beginning of the game end alias_method(:new_make_save_header, :make_save_header) def make_save_header header = new_make_save_header header[:plocation] = $v_player_location header end end #END CLASS class Window_SaveFile < Window_Base def draw_location(x, y, width, align) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "location: " + header[:plocation], 4) end end #END CLASS It doesn't, I'm getting an error "can't convert nil into string". This error goes away when I replace header[:plocation] in def draw_location with a string. So that's the issue here. It thinks :plocation is nil, even though I've at least given it a blank string and have it's string changed before a save file is made. Update: This error also goes away when I omit "location " + and keep header[:plocation]. This works well enough for me, but for future sake, I'd like to know why I can include "playtime: " + alongside header[:playtime_s], but not "location " + alongside header[:plocation]. Solution 1: If you're happy with just the variable showing without another string on the same line, this template should work for you. Thank you for reading!
  2. Zen Blood

    Fleshport [Horror]

    If anyone is interested in beta testing (volunteer or paid) within the next couple months, I am accepting one more beta tester. After September 25th, I shall not be accepting any more beta testers.
  3. Thank you, @Kayzee, not only for explaining that to me but for your speedy response too! I did end up finding a work around by temporarily deactivating the event page the script is called in and reactivating it after event #2 started executing its commands. Since it was activated last, it now it takes priority! :)
  4. Hello! Question: Is there any way to check if a ruby method is running? Something akin to, "method.is_running?" I have a script that affects event # 1's move route, but event # 1's move route is being controlled by a separate event, event # 2. Because of this, the script doesn't take priority and event #1 will only carry out event #2's commands. This doesn't happen if event #1 is controlling its own move route, but for reasons I can't do that. So I want to check if the script is running so I can disable event #2.
  5. Zen Blood

    Changing Step Animation With Script Calls

    Ohh! I had noticed @original_pattern being used, but I wasn't comprehending what it was doing exactly. It helps to have another perspective. With that info, I think I got it fully working now. Thank you so much @Kayzee!
  6. Good evening! I have a script I'm creating so that the player can have multiple outfits and change to the correct outfit when they're performing an animated action. For instance, if the player collides with an event that causes them to trip, I want the player's graphic to change to the appropriate "tripping" sprite set for the outfit they currently have equipped, and then play out the tripping animation in a specific way. The script is actually working pretty well so far, except for one little detail. For the "tripping" animation, I want to change the player's sprite so that the sprite is at a specific point in its step animation and to stay there until I command the sprite to be reset. Currently, this is how I have the sprite setup: The leftmost sprite is the player standing vertically. The middle sprite is the player mid-fall. The rightmost sprite is the player horizontally on the floor. I know how to do this within an event. In a move route command, you would select 'script' and write in: @pattern = #insert 0 - 2 here # 0 = right leg out (leftmost sprite) # 1 = resting # 2 = left leg out (rightmost sprite) Which would cause the target to temporarily jump to that sprite in its stepping animation. For some reason, it resets back to the "resting" sprite, but at least it's doing something right. Calling @pattern = 2 in my custom class doesn't do anything, even though calling $game_player.jump(1, 0) forces the player to jump like it's supposed to do. If I can't use a script call to simply do this, I'm thinking I could probably use the script call for 'Set Move Route' and ask it to call @pattern = 2 there. I've been looking up ways to script a move route, but so far they've only left me confused. Here's my notes on an example: I tried using this, and while the game doesn't crash, nothing happens either. As a test, I tried replacing "45" with "13" (stepping backwards) and had the same result. So it must not be executing at all. I realize I could achieve what I want to do easily via Galv's Move Route Extras (which I do actually have implemented), but just in case I decide to remove that script or use my script for another game, I do not want it depending on someone else's script to work. As a last resort, I may use it anyway. Update: I am now seeing if I can manipulate instance variables from another class. class Game_Character < Game_CharacterBase attr_accessor :step_anime attr_accessor :pattern end Now from my custom class I can call $game_player.step_anime = 2 and $game_player.step_anime = false in an attempt to set the player's sprite and pause their stepping animation once its set. I actually works to a degree! But after the player sprite goes to the last frame it will immediately pop back to the middle frame. I'd still like to learn how to make this work exactly how I want it to, but I can use this as-is if I'm willing to compromise on the time it takes for the player to "get up" (which would be making it shorter so that there's no time for the animation to reset back to the middle frame). Thank you very much for your time.
  7. Zen Blood

    Global Array Becomes Null After Exiting Game?

    It's been a while, but I finally have gotten around to setting up the hash and variables beyond initiating them. I was able to initiate the hash and variables upon the game starting just fine! However, when I set up how the hash loads, I get this error. Here's what the three script snippets look like right now: Would anyone happen to know what I'm doing wrong?
  8. I finally finished two important scripts for my game! Here's a video showing off what they do. They currently aren't available for public use, but I may release them one day!

    1. Rikifive

      Rikifive

      Sp00py; but nice! :D 

    2. Zen Blood

      Zen Blood

      Thank you, @Rikifive^_^

    3. Asharonapaul
  9. Zen Blood

    Global Array Becomes Null After Exiting Game?

    @Rikifive Thank you for the additional information. Am I seeing hashes in some of the examples you gave me? I've actually been looking into those to use as part of a script for a rather complex mechanic I'm not sure if I can pull off. Nevermind, I've got that all figured out! I have a question about editing previously made methods for the RPGMVXA engine. You showed me that I needed to add a line of code to this method: def self.create_game_objects $game_temp = Game_Temp.new #original command $game_system = Game_System.new #original command #ect; $your_array = [0,10,25,55,99] #my command end If I do not include the original commands in the body of that method, will they be excluded from the method? If I want to keep them, do I put "super"? If I don't want to keep them and not including them doesn't change anything, how would I exclude them? Sorry if this is rather basic knowledge. Some scripts I've seen have both excluded and included original commands, and it has me rather unsure why.
  10. I just recently created a a flexible, easy to implement Line of Sight script for Ace! I think I'll be posting it for public use once my game has been published for a while. So, if you're interested, keep your eyes peeled! I'm pretty proud of it, I think I'm really starting to get a hang if this whole scripting thing. Too bad this may be my last RPG Maker project!

    1. PhoenixSoul

      PhoenixSoul

      Wait, why is that?

    2. Kayzee

      Kayzee

      Moving on from RPG Maker and not giving up on game development I hope!

       

      I am at least partly interested myself. My current project could make use of it maybe. Right now I manage to fake it pretty well, but some real line of sight and path-finding might be a good idea.

    3. Zen Blood

      Zen Blood

      @PhoenixSoul 
      I'm thinking of either moving onto RPG Maker MV or creating a 3D game next. :) 

      @Kayzee
      I definitely won't be giving up on game development!

      Good luck with your project.

  11. Zen Blood

    Global Array Becomes Null After Exiting Game?

    @Rikifive Thank you so much for taking the time to explain all of this! Not only will it be helpful for this specific case, but I think I can use this knowledge to help implement other features.
  12. Zen Blood

    Fleshport [Horror]

    Event: I am now accepting positions for beta testers. Please read this if you're interested. There are currently 4/5 volunteers and 3/5 paid beta testers.
  13. Thank you, Traverse. I think I may understand how to proceed now! Edit: Lord have mercy on my sad little soul, I confused terrain tags with region IDs. I'll probably run into a similar problem, so I think the advice still helps. Thank you again. One more edit: I can't believe it- I got it to work!! Now I don't have to be committed to setting obstacles that block off LoS. I can just stick a Region ID tag on them. This is too good to be true.
  14. Another quick question! I'm looking to revamp and clean up how I program field of vision for a certain event. I've come to the conclusion that maybe using terrain tags would be an effective, versatile way to mark where walls and other obstacles are that would hide the player. The set up would essentially be something like: Is $game_map.events[1] facing left? Is $game_player.x less than $game_map.events[1].x ? Is terrain tag #1 greater than $game_player.x and terrain tag #1 less than $game_map.events[1].x ? Is terrain tag #1's Y coordinate equal to $game_player.y ? If so, then player is hidden. Basically, it checks to see that when the enemy is facing left and the player is in front of them, is there a terrain tag of #1 between the player and the enemy, and is there a terrain tag #1 on the same Y coordinate as the player. My problem is, is that I'm struggling to find the right script calls that relate to terrain tags. How would I call a specific terrain tag? How would I call to check its coordinates? I've found script calls like "$game_player.terrain_tag" and "$game_map.terrain_tag", but the neither seem to return the # of the terrain tag, or the x/y position of that specific terrain tag. I'm making up things like "$game_map.terrain_tag[1].x" to see if they work, but nothing has for the time being. Thank you for your time!
  15. Zen Blood

    Fleshport [Horror]

    Thank you, Shadow. I appreciate hearing that!
×