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

HeathLocke

Member
  • Content Count

    20
  • Joined

  • Last visited

About HeathLocke

  • Rank
    Newbie
  • Birthday 03/12/1997

Profile Information

  • Gender
    Male

Engines I Use

  • RPG Maker XP
    Yes

Engines

  • Prefered Engine
    RPG Maker XP
  • Engine Level
    Good
  • Class Title
    Programmer / Scripter
  1. All right, this took me an entire weekend of maddening hash debugging. I'm still not sure why, but RMXP's hashes seem to be sorted by something else other than hash. Even on a for loop, inserting the values one by one from 1 to 6 (number of events I was working with), but the end hash would always be 5, 6, 1, 2, 3, 4. I think at some point I even tried to hardcoding the hashes receiving the value in the right order, but the end hash would still have weird order. But after a lot of trial and errors, I managed to make the events run by id order. In the Interpreter 1 script, on setup_starting_event method, at line 92 I think, I changed the for loop to use a number from 1..number of events, and then access the events array with this number. The final code is # Loop (evento de mapa) for i in 1..$game_map.events.size # Se houver um Evento ocorrendo if $game_map.events[i].starting # Se não é uma execução automática if $game_map.events[i].trigger < 3 # Limpar flag de inicialização $game_map.events[i].clear_starting # Trava $game_map.events[i].lock end # Um evento é configurado setup($game_map.events[i].list, $game_map.events[i].id) return end end Hope this helps someone in the future.
  2. I have been working all day on this, and still couldn't fix it. I have managed to pinpoint the source of the problem though, it comes from Game_Map, on the following line @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id)) so I guess the events are being saved in the wrong (for me) order. I have tried many times to manually create the hash with for loops, but couldn't get it working. Hashes are satan's work, probably. I have an idea for an ugly fix that hopefully will work, I should get to it tomorrow. In the meantime I'm open to suggestions of better ways to fix this.
  3. I'm doing some debugging where I have autorun events on the map with the following code: print("The event #{@event_id} was started!"); (followed by local switch shenanigans that go with autorun events) And if I copy and paste the same event, say, 4 times around the map, everything works neatly and I get The event 1 was started! The event 2 was started! The event 3 was started! The event 4 was started! However, if after pasting the four events I try to create a new one with the same settings, I'll get The event 5 was started! The event 1 was started! The event 2 was started! The event 3 was started! The event 4 was started! Is there any way to force the events to be executed by id number? The hash @events (line 80) at Game_Map is already starting with the correct event order but somewhere down the line they get scrambled, apparently. All help is greatly appreciated, and I thank in advance.
  4. Oh, I forgot to check other scripts. I'm used to things not working on my browser, so I assumed it was just on my side. Well, thanks for the reply! Is there a prevision of when/if this is going to be fixed?
  5. I'm not able to add tags to my new script because there isn't any input box. Here is a pic of it: I'm on Waterfox 31.0, and although I have NoScript it is disabled on gdu.
  6. Well, it worked! I'm using a 640x480 picture and then adjusting the rect size as I need. Here is a code snippet for future reference: bitmap = RPG::Cache.picture("pic") self.contents.blt(0, 0, bitmap, Rect.new(0, 0, gridWidth, gridHeight)) I'll mark dolarmark's answer as solved since it answers the thread question. @Heretic86: That's good to know, thanks! In this code I don't think there are any redraws but I hope I'll remember to check if they're altered on future scripts.
  7. I had thought about that, but the sizes would be user adjusted and I didn't wanted to require the user to edit the background images, if possible. But you gave me an idea, I could try making one image screen sized and then just adjust the rect so it crops the rest. I'll give that a try and report back.
  8. I'm editing a script (releasing soon!) and I want to tile some pictures together. The same picture could be repeated like, from 64 times to more than 200. It should be a 32x32 picture, but I wonder if would be bad to create one rect for every picture, because maybe it could cause performance problems or something like that. By creating a bitmap/rect I mean (and would probably do) something like this: #the x and y would be passed on a for loop bitmap = RPG::Cache.picture("picture") rect = Rect.new(x, y, bitmap.width, bitmap.height self.contents.blt(0, 0, bitmap, rect) So, should I do it like this? Or is there any way to clone a picture or something like that? I haven't got time to look at the stock scripts to see if they have something like this but I plan on doing that tomorrow. Thanks in advance for your attention!
  9. I'm making a config menu script and I want to add some BGM and BGS sliders. They're working fine already, but for the changes to be made, the currently playing BGM/S have to be stopped and played again (I'm doing this with bgm_stop and bgm_restore). Looking around I found this thread, and the problem seems to be exactly the same as mine, but none of the solutions in the thread helped me (the last one didn't worked, not sure why). So is there any way to change the volume and actually affect the volume of the music/sound being played? Thanks in advance for the help.
  10. Just found out that the Blizzard's slice text script was for RGSS3. Edited the whole thread.
  11. Hey, sorry for the late reply. Tried that, and while I don't get the error, the string doesn't breaks, it resizes, just as if I didn't used text_slice. Thanks for the help, anyway.
  12. Edit: Just found out that Blizzard's slice_text is for RGSS3. Shame on me. Editing the question so I don't need another thread. I'm trying to add a newline on my script. Using \n, however, returns me a weird character. The string that I'll use will be based on an array index, so I can't (more like don't wanna) do a two-dimensional array and do something like this (unless it's the only case): for i in 0...text_array.size self.contents.draw_text(0,32*i,self.width-32,32,text_array[i]) end Is there any other way to put a line break? Putting characters on the string isn't a problem. (Old post, just in case)
  13. Yeah. Fortunately my images don't change dynamically, so I don't really need FileTest. I was doing it just for a good scripting practice, so I can remove it and things will work just fine.. I'll mark your answer as 'solved' because it really seems the best solution if someone really needs to do a FileTest for their script to work. Thanks a lot for your support and input, man.
  14. Hey man, I'm sorry but I must've messed something up, neither using the picture path nor just the filename are working now. I think I might have encrypted an older version and thought it was working. Since the save files are in the main folder, both File.exists and FileTest.exists can find them, because they're probably not encrypted. So yeah, the problem is still going on.
  15. Hey, thanks! Although you don't use the file path, just the file name (figured that out by trial and error). Can you edit your answer and remove the path? It would be better for people finding this through google. In this case, it would be if FileTest.exist?("picture.png") Again, thanks a lot for your answer.
×
×
  • Create New...