Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Wecoc

1
RMXP Script Database / Re: [XP] Grid-Free Doodads
January 30, 2017, 12:06:20 pm
Thank you KK20 for testing it all.

Fortunately, many of these bugs were easy to fix, I already fixed them and upload the demo(s) again.
But there's one I don't know how to fix or if it's even possible...

QuoteWhen placing Areas, if you scroll around the map, it sometimes would not be in the position of the mouse cursor.

I knew using Mouse.tile_x and Mouse.tile_y for that would not be a good idea after all. I believe I fixed it, now it's done with Mouse.x and Mouse.y

QuoteWhy is it that if I place Areas, change the map size, then check the placed Areas again, Areas that I newly place are gone but the ones you pre-defined that came in the demo are still there?

I see what happens, you have to quit the program and restart it after defining new Areas so they will not be erased when changing the map properties on the editor after that.
I have no idea how to fix this.

QuoteWhile placing a doodad, if you edit it, but press Input::B, it takes you back to the main menu and places the doodad you currently had selected (should function like I pressed 'Finished Edition' (by the way, the correct word is "Editing")

Ok silly mistake (and silly misspell, lol). Fixed.

QuoteWindow cursor index should be reset to zero. For example, if you edit a doodad, go all the way to the bottom ("Condition"), press Input::B, then Edit Doodads again, you get this

Fixed on the Edit window, I don't know if the same problem is anywhere else. I've been trying some combinations and everything seems fine.

QuoteYou should handle invalid syntax when making Conditions.

Good point. Done!

I also fixed another bug I found; hue changes were not working properly on animated doodads.

If somebody finds other bugs please let me know.
2
RMXP Script Database / Re: [XP] Grid-Free Doodads
January 29, 2017, 02:02:33 pm
Quote from: Blizzard on January 29, 2017, 03:31:59 amHow did you implement them in the backend? With tiles or events?


I thought events would probably increase lag much more, so I created an entire new type.

The Doodads are default RPG::Sprite stored on Spriteset_Map, but their properties are defined using a new class "Doodad", and saved to Doodads.rxdata, which is created the first time you insert a doodad.
The Area info is saved in Map(ID).rxdata in a very easier way as many other default properties of the map; my first plan was doing the same with all the doodads data but I had some troubles with that so I decided to store all their info in a new rxdata.

Some project compilators still work anyway, some others will need some changes to compile Doodad.rxdata with the others.

Also, talking about lag, I tested it adding 200 animated doodads in the map and lag is nearly the same as you can see here.
Spoiler: ShowHide

OH MY GOD ALUXES WHAT THE HELL ARE YOU DOING?! RUUUNN!!
3
RMXP Script Database / [XP] Grid-Free Doodads
January 28, 2017, 03:47:09 pm
Grid-Free Doodads
Authors: Wecoc
Version: 1.01
Type: Doodad System
Key Term: Game Utility



Introduction

Grid-Free Doodads is a system that implements on your game the use of Doodads, in other words, tiles which are not fixed on the default editor grid.

With this you can get an effect very similar to those made with parallax mapping but this time controlled on the game, with extra options. Also, the size of the game file will be much lower, solving this way the main problem found on games that use parallax.

This system was inspired by the Grid-Free Doodads plugin for RPG maker MV, made by Yanfly.
It contains a total of 7 scripts: Mouse and Keyboard support, a script containing all the info you need to know to use this system in your game, and the system by itself divided in 4 parts.


Features


  • Unlimited Doodads per map

  • You can see the Doodads on the project as normal tiles (not on the Editor)

  • Area Support to use Regions like in VX/Ace/MV --> No passable Doodads

  • Animated Doodads with unlimited frames, yay!

  • Doodads which appear under a condition




Screenshots

Spoiler: ShowHide













Demo

Grid-Free Doodads 1.01 (English)
Grid-Free Doodads 1.01 (Espa├▒ol)


Script

You will find the 7 scripts in the demo, place them in your game (first you should save a copy of you game on its current state). Place them over main and over other custom scripts. You will find more detailed Instalation info inside the script Doodad Info.


Instructions

Inside the script Doodad Info

Spoiler: ShowHide
#==============================================================================
# ** [XP] Grid-Free Doodads v1.01 ENG
#------------------------------------------------------------------------------
# ** PART 0 - Doodad Info
#------------------------------------------------------------------------------
#  Grid-Free Doodads is a system that allows the use of Doodads, in other
#  words, tiles which are not fixed on the default editor grid.
#
#  This allows an effect very similar to parallax mapping but controlled on the
#  game, with extra options. Furthermore the size of the game file will be
#  much lower, which is the main problem on games that use parallax.

#  This script was inspired by the 'Grid-Free Doodads' in MV, made by Yanfly.
#  Version: 1.01 (English)
#------------------------------------------------------------------------------
# Features:
#
# - You can see the Doodads on the project as normal tiles, but not on the editor
# - Doodads are placed and configured in Debug Mode.
# - The system consists of 7 scripts (4 parts + info + Mouse & Keyboard support)
# - This system has integrated an Area Support.
# - This demo contains Doodads inside the Graphics/Doodads/ folder.
#   There you can define your own Doodads, inside folders and sub-folders.
#
#------------------------------------------------------------------------------
# Credits:
#
#   Wecoc - Grid-Free Doodads
#   Glitchfinder - Key Input & Mouse
#
#------------------------------------------------------------------------------
# Installation:
#
# 1. Copy the 7 demo scripts to your project in the same order (you should first
#    save a copy of your project in its current state)
#    The scripts must be placed over main and over the other custom scripts.
# 2. Copy the folder Doodads of this demo inside the folder Graphics of your
#    project.
# 3. If you are not using RTP, define the icon used to show folders in the game,
#    in the very start of the script Doodad Setup.
#
#------------------------------------------------------------------------------
# Tutorial:
#
#  Once you have installed Grid-Free Doodads, you can access the main menu by
#  pressing F8 in Debug mode.
#
# 1. Place a Doodad
#
#  To place a Doodad on the map, go to the Place Doodads option in the setup
#  main menu. The list of folders inside the folder Doodads will be displayed.
#  You can create as many folders and sub-folders as you want.
#
#  After selecting the doodad you want to insert, you can place it on the map
#  using the Mouse.
#
# - If you press the arrow keys you will scroll the screen over the entire map.
#
# - If you press Q/W you change the Doodad priority. Priority is the height of
#   the Doodad on the map, and works exactly like tiles (0-5), but they have an
#   extra priority (-1) so you can place them under the player and events.
#
# - If you press CTRL you can fix the doodad in a 16x16 grid. The length of the
#   grid is defined on the script Doodad Setup.
#
# - If you press E you will access to the Doodad configuration.
#
# - If you click with the Mouse, the Doodad will be placed on its current place,
#   and you will instantly have the possibility to insert the next one.
#
# - If you press CTRL + Z the last Doodad will be removed.
#
# - Finally if you press Cancel (X) you will back to the main setup menu.
#
# 2. Edit a Doodad
#
#  To edit a Doodad go to the Edit Doodads option in the setup main menu.
#  The number of doodads and priority categories will be displayed.
#
#  After selecting your category a list of all doodads on that category will
#  be displayed. On the map, the current selected Doodad will blink.
#  If the selected one is under the window, place the mouse over the window
#  and its opacity will decrease.
#
#  Once you select your Doodad the edit options list will appear.
#
# - Edit Position allows you to define X, Y and priority of the Doodad again.
#
# - Hue will change the hue of the Doodad bitmap. This proccess is the most
#   time consuming and will decrease the color quality of the Doodad after some
#   changes, but no need to worry about that, once you exit the editor its
#   colors will look fine.
#
# - You can also change the Opacity and Zoom of your Doodad.
#
# - Anchor X and Y are used to define the doodad center points.
#   That's used to calculate when the Doodad is in front or back of the player
#   and events in priority 0, or of other doodads and tiles in any priority.
#
# - Blend, Bush and Mirror work exactly the same way as always.
#
# - Angle is used to rotate the Doodad. If you press CTRL its value will
#   increase or decrease faster.
#
# - Animation allows to asign a loop animation ID on the sprite of the Doodad.
#   Its position depends on Anchor X and Y.
#
# - Set Tone opens a window where you can control the tone RGB of the Doodad.
#   The values are between -255 and 255. You can save the current tone to select
#   it directly on any other Doodad, that info will be stored in TONE.txt inside
#   the Doodads folder of your project. You can change there the name of the
#   tones and define as may as you want, but do not alter the tabulation format
#   of the file, or the tone won't be read properly.
#
# - Condition is the last opcion, only for scripters, and it's disabled if you
#   access the edit window from the Place Doodads mode (E).
#   Condition allows to write an eval to restrict the appearing condition of
#   the Doodad. If the eval is well-written, Condition will be displayed green,
#   but red if not.
#
# 3. Delete a Doodad
#
#  To delete a doodad go to the Clear Doodads option, the same list of doodads
#  as in Edit Doodads will appear.
#
# 4. Impassable Doodads
#
#  The only way to make a no passable Doodad is using Areas to define the
#  passability of a tile on the map. You can configure it on the script Area
#  Support, but by default 10 is no passable, 11 is always passable, 12 has
#  bush effect and 13 disabled the bush effect.
#
# 5. Animated Doodads
#
#  Yes, you can also make animated Doodads. To define the frames of a Doodad
#  its graphic name must end with [X,Y] where X are the horizontal frames and
#  Y the vertical frames. You can later define its speed on the game.
#
#==============================================================================



Compatibility

If you are using other Mouse and Key support scripts in your game you can use them instead of the ones found in the demo, but you will have to edit the last script (Doodad Setup) to adapt it to your scripts.

You will probably get an error if you try to load a save file of your game, if you saved it before inserting Grid-Free Doodads.

No other compatibility issues were found.



Credits and Thanks


  • Wecoc - Grid-Free Doodads

  • Glitchfinder - Key Input & Mouse




Author's Notes

This is for rebels who still use RPG maker XP but want Doodads because f*ck, they are great.
Enjoy~
4
Entertainment / Re: Good Jokes
September 23, 2016, 02:34:51 am
Hahahaha those last ones were pretty good.

Ok I'll try with some of my own bullshit jokes collection.

Spoiler: ShowHide
- Look mom, I'm the fastest guy ever! Speed 6 and Freq 6!
- But son, you have a disabled move type...


Spoiler: ShowHide
- Mommy mommy, in class they call me 'Second fiddle'.
- Don't worry little Basil, someday this will change...


Spoiler: ShowHide
- We will fight together until the end!
- Yeah!...
- Hey! What? Where the fuck are you?
- In your group.
- What?
- There's no caterpillar.

And he never saw him again.


Spoiler: ShowHide
Arshes walks into a shop and asks to the merchant:
- How many HP potions do you have, sir?
- 99 minus the amount you already have.


Spoiler: ShowHide
- I'm so evil I will kill the current villain just to demonstrate to the party how strong and badass I am!
*Later*
- He killed the villain! He's a hero! - Yes, he's the best!
- Fucking shit.


Spoiler: ShowHide
- Can I interact with this? Hey citizen, do you have more than one page or you always say the same? Oh wow, here's a dog, let's see what it says!
- Honey, I told you our son was smoking weed.
5
Resource Database / Re: [XP] Edits of the chara template
September 02, 2016, 12:46:57 pm
Quote from: koktengri on August 30, 2016, 01:47:19 am
Can you also add some emotions to them?


There's not so much you can do on XP characters for emotions (specially those which don't have eyebrows), and they usually are made without template, case by case on main characters.
Anyway I made a little template that may help you.



Spoiler: ShowHide
- Default
- Happy/Eyes closed
- Getting real tired of your shit (+drop)
- Ouch!/D'OH!
- Angry
- Crying sad
- Did I shit myself?
- (Extra) OH. MY. F*CKING. GOD.
- (Extra) You serious?
6
Thx! The caveman is made entirely from the template, and the fat guy is made using the Clown as a main reference. Somehow now looks like a Pokemon NPC, haha.

I don't trust imageshack, I host my pictures on postimage or tinypic and I always save the original on my computer and make regular backups.
7
Resource Database / [XP] Edits of the chara template
April 21, 2016, 09:18:59 pm
I made some edits on the chara template so you have more variety. You can use to create your characters for your projects. Credits are not necessary.



- Male (default)
- Hunk
- Tall
- Big dude
- Female (default)
- Chubby
- Alternative ("girly") legs
- Alternative ("manly") arms

And here you can see a collection of some of the RTP faces, and some new ones.



New! An obese guy



I will maybe make more, soon.
8
Resource Database / [XP] Wecoc's RTP character edits
April 21, 2016, 09:04:32 pm
Some characters I made using the RTP characters or the RTP chara template. Credits are not required.

Human: ShowHide


Others: ShowHide






9
The RMXP RTP has a lot of floor tiles. Some have a shadow and a bright version, but there's never an autotile with their combination... So I made them all. Also, some tile combinations are interesting to put on an autotile. I made some templates, which I used to make my autotiles and you can use to make your own ones. No credits needed!

Shadows and lights: ShowHide



Others: ShowHide


Templates: ShowHide
10
Entertainment / Re: RPG Maker Memes
October 13, 2015, 04:31:48 pm
Spoiler: ShowHide


Spoiler: ShowHide


Spoiler: ShowHide


Spoiler: ShowHide


Spoiler: ShowHide


Spoiler: ShowHide


Spoiler: ShowHide


-------------

I made this some time ago, after someone said me "The VX map editor is way better than the XP's"

Spoiler: ShowHide
11
RPG Maker Scripts / Re: About RPG maker's internal bugs
October 04, 2015, 02:26:59 pm
Hi guys, long time no see.
I solved another bug with event interaction. By default the event interaction only depends on the coordinates, and this has some problems.

Spoiler: ShowHide


With the script if the player can't go to the event position (without considering the event itself on the passability) there is not interaction.
Also using $game_map.events[ID].passable_touch = true/false you can enable or disable the fix on the event manually.

class Game_Character
  attr_accessor :passable_touch
  alias passable_touch_ini initialize unless $@
  def initialize
    passable_touch_ini
    @passable_touch = false
  end
 
  def no_event_passable?(x, y, d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return true  if @passable_touch == true
    return false unless $game_map.valid?(new_x, new_y)
    return true  if @through
    return false unless $game_map.passable?(x, y, d, self)
    return false unless $game_map.passable?(new_x, new_y, 10 - d)
    return true
  end
end

class Game_Event < Game_Character
  alias collision_passable_fix check_event_trigger_touch unless $@
  def check_event_trigger_touch(new_x, new_y)
    if @x != new_x
      d = (@x < new_x ? 6 : 4)
    elsif @y != new_y
      d = (@y < new_y ? 2 : 8)
    end
    if (@x == new_x) and (@y == new_y) or no_event_passable?(@x, @y, d)
      collision_passable_fix(new_x, new_y)
    end
  end
end

class Game_Player < Game_Character
  def check_event_trigger_there(triggers)
    result = false
    if $game_system.map_interpreter.running?
      return result
    end
    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    for event in $game_map.events.values
      if event.x == new_x and event.y == new_y and
        triggers.include?(event.trigger)
        if not event.jumping? and not event.over_trigger?
          passable = no_event_passable?(@x, @y, @direction)
          if event.passable_touch == true or passable
            event.start
            result = true
          end
        end
      end
    end
    if result == false
      if $game_map.counter?(new_x, new_y)
        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
        for event in $game_map.events.values
          if event.x == new_x and event.y == new_y and
            triggers.include?(event.trigger)
            if not event.jumping? and not event.over_trigger?
              passable = no_event_passable?(@x, @y, @direction)
              if event.passable_touch == true or passable
                event.start
                result = true
              end
            end
          end
        end
      end
    end
    return result
  end
 
  def check_event_trigger_touch(x, y)
    result = false
    if $game_system.map_interpreter.running?
      return result
    end
    for event in $game_map.events.values
      if event.x == x and event.y == y and [1,2].include?(event.trigger)
        if not event.jumping? and not event.over_trigger?
          passable = no_event_passable?(@x, @y, @direction)
          if event.passable_touch == true or passable
            event.start
            result = true
          end
        end
      end
    end
    return result
  end
end


-----------------

I found a bug on the LittleDrago's fix called [XP] Parallel process in the first map.
The battle call from event restarts over and over...

KK20: No idea how to do that exactly.
12
RPG Maker Scripts / Re: Item Upgrade Systems and Item IDs
September 19, 2015, 02:08:40 pm
My friend Eron and I made a spanish system (base) one year ago, called IGOS (Independent Game Objects System), for RPG maker XP.
It's not easy to use and maybe it will not be what you are looking for exactly, but... well, perhaps it could help other scripters...

Download link: IGOS v1.0.zip

Tutorial from a spanish forum: Tutorial - Como usar el sistema IGOS
13
Resources / RMXP Wallpaper characters
August 24, 2015, 07:42:08 am
Enterbrain never includes the characters of the program cover on the RTP. Also, I looked for them and looks like anyone made them before.
That's why I've made these four sprites so you can have them on your projects, if you want.



Spoiler: ShowHide


Credits not required.
14
RPG Maker Scripts / Re: Writing SDK Style Scripts?
November 01, 2014, 07:45:25 pm
Here are some:

Free Movement (Ace)
I have no idea how this works, and it's for Ace so maybe useless in that case.
http://forums.rpgmakerweb.com/index.php?/topic/7833-free-movement-off-the-grid-movement-script/

Semi-Though or 'Cockroach Event' (XP)
Special events (for example cockroaches) which are passable with events and player, but not the map.
http://www.mundo-maker.com/t6759-rmxp-semithrough-o-eventos-cucaracha

MOMOTARO - Passability Edits (XP) (The first script, not the second one!)
You can use passability by tile, events or terrain tag separately, and define on each actor which passability features has. Inspired on a Ace script by Yanfly.
http://www.mundo-maker.com/t10253-xp-sistema-momotaro

Half-step Movement (XP, incomplete!)
The tiles are 32x32 but the steps are 16px long. Inspired on the Wolf RPG Editor system.
http://www.mundo-maker.com/t9555-incompleto-movimiento-a-medio-paso

And maybe Mode7 & Neo-Mode7 will have changes too.

I also found this inside a game with a curious map system. It's a Game_Map passable? method edit:

  def passable?(x, y, d, self_event=nil, layers=[2, 1, 0], not_events=false)
    unless valid?(x, y)
      return false
    end
    bit = (1 << (d / 2 - 1)) & 0x0f
    unless not_events
      for event in events.values
        if event.tile_id >= 0 and event != self_event and
           event.x == x and event.y == y and not event.through
          if @passages[event.tile_id] & bit != 0
            return false
          elsif @passages[event.tile_id] & 0x0f == 0x0f
            return false
          elsif @priorities[event.tile_id] == 0
            return true
          end
        end
      end
    end
    for i in layers
      tile_id = data[x, y, i]
      if tile_id == nil
        return false
      elsif @passages[tile_id] & bit != 0
        return false
      elsif @passages[tile_id] & 0x0f == 0x0f
        return false
      elsif @priorities[tile_id] == 0
        return true
      end
    end
    return true
  end
15
Script Requests / Re: Changing Message Box Messages
October 29, 2014, 07:43:40 pm
Save a copy of your game before using this.
This kind of codes can be highly destructive.


#===============================================================================
count = 0
Dir.entries('Data').each {|filename|
 if filename =~ /Map[\d]+\.rxdata/
   changed = false
   map = load_data("Data/#{filename}")
   map.events.each_key {|key|
     event = map.events[key]
     event.pages.each_index {|i|
       page = event.pages[i]
       page.list.each_index {|j|
         cmd = page.list[j]
         next unless cmd.code == 101
         count += 1
         event.pages[i].list[j].parameters[0].insert(0, "\\b")
         if event.pages[i].list[j].parameters[0].include?(":")
           event.pages[i].list[j].parameters[0].gsub!(":") { ":\\b" }
           map.events[key] = event
           changed = true
         end
       }
     }
     if changed
       File.open("Data/#{filename}", 'wb') {|file| Marshal.dump(map, file) }
     end
   }
 end
}
if count == 0
 print "No event script calls found with matching string."
else
 print "Found and replaced #{count} occurences of input string.\n" +
   "Make sure to close and reload your project in order for the effects " +
   "take place. DO NOT SAVE THE GAME when closing or nothing will change."
end
exit
16
RPG Maker Scripts / Re: About RPG maker's internal bugs
October 27, 2014, 06:53:57 pm
This was basically my try on this, but rounding the value has an obvious collateral problem; you lose "movement resolution"; 3.1 = 3.2, 3.4 = 3.5 ...

Here an example; these charas are walking (Move up) in frequence 6, and their speed is 3.0, 3.2, 3.4, 3.5, 3.6, 3.8 and 4.0
You can see the difference between rounding the value or not.

Spoiler: ShowHide


One possible fix for that would be to round only the player's distance, but the player would still have that lack of "movement resolution".

Someone said me rounding the distance also has some problems on camera if you are using a "smooth-movement" script, but sincerely I didn't check that.

The other possible way to fix this would be to work always with distances directly controlling it's integer instead of the speed as a float. Anyway, I don't like so much this idea...

The character I used on the first image: http://s9.postimg.org/7i2mp9hzv/character.png

==============================

Anyway, I think I already fixed this on my game some months ago, I didn't post it here because I'm not 100% sure but I'll tell what I found ;D
All this fixes try to fit the charas movement with the current screen movement, but the one which is delayed is the screen.

Once, on my game, I tried to display a bitmap layer or a picture over the map and scroll it via script call on parallel process to fit with the map (changing display_x and display_y). The result was laggy, and because of the 3.6 speed of the player, I had the same problem. It had nothing to do with character speed, so I decided to modificate the Game_Map converting to some sort of a smooth-movement script, but "not so smooth". The result is a map scroll practically identical as the default but the picture is displayed well and lag decreases. The annoying bug also disappears. The only problem is the new script is not perfect. For example, on diagonal movement the map is too slow now...

This is the script. I'm pretty sure correcting its bugs, we would fix the problem definitelly:

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :tileset_name             # tileset file name
 attr_accessor :autotile_names           # autotile file name
 attr_accessor :panorama_name            # panorama file name
 attr_accessor :panorama_hue             # panorama hue
 attr_accessor :fog_name                 # fog file name
 attr_accessor :fog_hue                  # fog hue
 attr_accessor :fog_opacity              # fog opacity level
 attr_accessor :fog_blend_type           # fog blending method
 attr_accessor :fog_zoom                 # fog zoom rate
 attr_accessor :fog_sx                   # fog sx
 attr_accessor :fog_sy                   # fog sy
 attr_accessor :battleback_name          # battleback file name
 attr_accessor :display_x                # display x-coordinate * 128
 attr_accessor :display_y                # display y-coordinate * 128
 attr_accessor :need_refresh             # refresh request flag
 attr_reader   :passages                 # passage table
 attr_reader   :priorities               # prioroty table
 attr_reader   :terrain_tags             # terrain tag table
 attr_reader   :events                   # events
 attr_reader   :fog_ox                   # fog x-coordinate starting point
 attr_reader   :fog_oy                   # fog y-coordinate starting point
 attr_reader   :fog_tone                 # fog color tone
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   @map_id = 0
   @display_x = 0
   @display_y = 0
 end
 #--------------------------------------------------------------------------
 # * Setup
 #     map_id : map ID
 #--------------------------------------------------------------------------
 def setup(map_id)
   # Put map ID in @map_id memory
   @map_id = map_id
   # Load map from file and set @map
   @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
   # set tile set information in opening instance variables
   tileset = $data_tilesets[@map.tileset_id]
   @tileset_name = tileset.tileset_name
   @autotile_names = tileset.autotile_names
   @panorama_name = tileset.panorama_name
   @panorama_hue = tileset.panorama_hue
   @fog_name = tileset.fog_name
   @fog_hue = tileset.fog_hue
   @fog_opacity = tileset.fog_opacity
   @fog_blend_type = tileset.fog_blend_type
   @fog_zoom = tileset.fog_zoom
   @fog_sx = tileset.fog_sx
   @fog_sy = tileset.fog_sy
   @battleback_name = tileset.battleback_name
   @passages = tileset.passages
   @priorities = tileset.priorities
   @terrain_tags = tileset.terrain_tags
   # Initialize displayed coordinates
   @display_x = 0
   @display_y = 0
   @scroll_remain_x = 0
   @scroll_remain_y = 0
   @scroll_take_x = 0
   @scroll_take_y = 0
   # Clear refresh request flag
   @need_refresh = false
   # Set map event data
   @events = {}
   for i in @map.events.keys
     @events[i] = Game_Event.new(@map_id, @map.events[i])
   end
   # Set common event data
   @common_events = {}
   for i in 1...$data_common_events.size
     @common_events[i] = Game_CommonEvent.new(i)
   end
   # Initialize all fog information
   @fog_ox = 0
   @fog_oy = 0
   @fog_tone = Tone.new(0, 0, 0, 0)
   @fog_tone_target = Tone.new(0, 0, 0, 0)
   @fog_tone_duration = 0
   @fog_opacity_duration = 0
   @fog_opacity_target = 0
   # Initialize scroll information
   @scroll_direction = 2
   @scroll_rest = 0
   @scroll_speed = 4
 end
 #--------------------------------------------------------------------------
 # * Get Map ID
 #--------------------------------------------------------------------------
 def map_id
   return @map_id
 end
 #--------------------------------------------------------------------------
 # * Get Width
 #--------------------------------------------------------------------------
 def width
   return @map.width
 end
 #--------------------------------------------------------------------------
 # * Get Height
 #--------------------------------------------------------------------------
 def height
   return @map.height
 end
 #--------------------------------------------------------------------------
 # * Get Encounter List
 #--------------------------------------------------------------------------
 def encounter_list
   return @map.encounter_list
 end
 #--------------------------------------------------------------------------
 # * Get Encounter Steps
 #--------------------------------------------------------------------------
 def encounter_step
   return @map.encounter_step
 end
 #--------------------------------------------------------------------------
 # * Get Map Data
 #--------------------------------------------------------------------------
 def data
   return @map.data
 end
 #--------------------------------------------------------------------------
 # * Automatically Change Background Music and Backround Sound
 #--------------------------------------------------------------------------
 def autoplay
   if @map.autoplay_bgm
     $game_system.bgm_play(@map.bgm)
   end
   if @map.autoplay_bgs
     $game_system.bgs_play(@map.bgs)
   end
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   # If map ID is effective
   if @map_id > 0
     # Refresh all map events
     for event in @events.values
       event.refresh
     end
     # Refresh all common events
     for common_event in @common_events.values
       common_event.refresh
     end
   end
   # Clear refresh request flag
   @need_refresh = false
 end
 #--------------------------------------------------------------------------
 # * Scroll Down
 #     distance : scroll distance
 #--------------------------------------------------------------------------
 def scroll_down(distance)
   if distance > (self.height - 15) * 128 - @display_y - @scroll_remain_y
     distance = (self.height - 15) * 128 - @display_y - @scroll_remain_y
   end
   if scrolling?
     @scroll_take_y = 2 ** @scroll_speed
   else
     if distance.ceil % 4 == 0
       @scroll_take_y = distance.ceil
     elsif distance.ceil % 4 <= 2
       @scroll_take_y = distance.ceil - distance.ceil % 4
     else
       @scroll_take_y = distance.ceil + (4 - (distance.ceil % 4))
     end
   end
   @scroll_remain_y += distance
 end
 #--------------------------------------------------------------------------
 # * Scroll Left
 #     distance : scroll distance
 #--------------------------------------------------------------------------
 def scroll_left(distance)
   if distance > @display_x - @scroll_remain_x
     distance = @display_x - @scroll_remain_x
   end
   if scrolling?
     @scroll_take_x = 2 ** @scroll_speed
   else
     if distance.ceil % 4 == 0
       @scroll_take_x = distance.ceil
     elsif distance.ceil % 4 <= 2
       @scroll_take_x = distance.ceil - distance.ceil % 4
     else
       @scroll_take_x = distance.ceil + (4 - (distance.ceil % 4))
     end
   end
   @scroll_remain_x -= distance
 end
 #--------------------------------------------------------------------------
 # * Scroll Right
 #     distance : scroll distance
 #--------------------------------------------------------------------------
 def scroll_right(distance)
   if distance > (self.width - 15) * 128 - @display_x - @scroll_remain_x
     distance = (self.width - 15) * 128 - @display_x - @scroll_remain_x
   end
   if scrolling?
     @scroll_take_x = 2 ** @scroll_speed
   else
     if distance.ceil % 4 == 0
       @scroll_take_x = distance.ceil
     elsif distance.ceil % 4 <= 2
       @scroll_take_x = distance.ceil - distance.ceil % 4
     else
       @scroll_take_x = distance.ceil + (4 - (distance.ceil % 4))
     end
   end
   @scroll_remain_x += distance
 end
 #--------------------------------------------------------------------------
 # * Scroll Up
 #     distance : scroll distance
 #--------------------------------------------------------------------------
 def scroll_up(distance)
   if distance > @display_y - @scroll_remain_y
     distance = @display_y - @scroll_remain_y
   end
   if scrolling?
     @scroll_take_y = 2 ** @scroll_speed
   else
     if distance.ceil % 4 == 0
       @scroll_take_y = distance.ceil
     elsif distance.ceil % 4 <= 2
       @scroll_take_y = distance.ceil - distance.ceil % 4
     else
       @scroll_take_y = distance.ceil + (4 - (distance.ceil % 4))
     end
   end
   @scroll_remain_y -= distance
 end
 #--------------------------------------------------------------------------
 # * Determine Valid Coordinates
 #     x          : x-coordinate
 #     y          : y-coordinate
 #--------------------------------------------------------------------------
 def valid?(x, y)
   return (x >= 0 and x < width and y >= 0 and y < height)
 end
 #--------------------------------------------------------------------------
 # * Determine if Passable
 #     x          : x-coordinate
 #     y          : y-coordinate
 #     d          : direction (0,2,4,6,8,10)
 #                  *  0,10 = determine if all directions are impassable
 #     self_event : Self (If event is determined passable)
 #--------------------------------------------------------------------------
 def passable?(x, y, d, self_event = nil)
   # If coordinates given are outside of the map
   unless valid?(x, y)
     # impassable
     return false
   end
   # Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0)
   bit = (1 << (d / 2 - 1)) & 0x0f
   # Loop in all events
   for event in events.values
     # If tiles other than self are consistent with coordinates
     if event.tile_id >= 0 and event != self_event and
        event.x == x and event.y == y and not event.through
       # If obstacle bit is set
       if @passages[event.tile_id] & bit != 0
         # impassable
         return false
       # If obstacle bit is set in all directions
       elsif @passages[event.tile_id] & 0x0f == 0x0f
         # impassable
         return false
       # If priorities other than that are 0
       elsif @priorities[event.tile_id] == 0
         # passable
         return true
       end
     end
   end
   # Loop searches in order from top of layer
   for i in [2, 1, 0]
     # Get tile ID
     tile_id = data[x, y, i]
     # Tile ID acquistion failure
     if tile_id == nil
       # impassable
       return false
     # If obstacle bit is set
     elsif @passages[tile_id] & bit != 0
       # impassable
       return false
     # If obstacle bit is set in all directions
     elsif @passages[tile_id] & 0x0f == 0x0f
       # impassable
       return false
     # If priorities other than that are 0
     elsif @priorities[tile_id] == 0
       # passable
       return true
     end
   end
   # passable
   return true
 end
 #--------------------------------------------------------------------------
 # * Determine Thicket
 #     x          : x-coordinate
 #     y          : y-coordinate
 #--------------------------------------------------------------------------
 def bush?(x, y)
   if @map_id != 0
     for i in [2, 1, 0]
       tile_id = data[x, y, i]
       if tile_id == nil
         return false
       elsif @passages[tile_id] & 0x40 == 0x40
         return true
       end
     end
   end
   return false
 end
 #--------------------------------------------------------------------------
 # * Determine Counter
 #     x          : x-coordinate
 #     y          : y-coordinate
 #--------------------------------------------------------------------------
 def counter?(x, y)
   if @map_id != 0
     for i in [2, 1, 0]
       tile_id = data[x, y, i]
       if tile_id == nil
         return false
       elsif @passages[tile_id] & 0x80 == 0x80
         return true
       end
     end
   end
   return false
 end
 #--------------------------------------------------------------------------
 # * Get Terrain Tag
 #     x          : x-coordinate
 #     y          : y-coordinate
 #--------------------------------------------------------------------------
 def terrain_tag(x, y)
   if @map_id != 0
     for i in [2, 1, 0]
       tile_id = data[x, y, i]
       if tile_id == nil
         return 0
       elsif @terrain_tags[tile_id] > 0
         return @terrain_tags[tile_id]
       end
     end
   end
   return 0
 end
 #--------------------------------------------------------------------------
 # * Get Designated Position Event ID
 #     x          : x-coordinate
 #     y          : y-coordinate
 #--------------------------------------------------------------------------
 def check_event(x, y)
   for event in $game_map.events.values
     if event.x == x and event.y == y
       return event.id
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Start Scroll
 #     direction : scroll direction
 #     distance  : scroll distance
 #     speed     : scroll speed
 #--------------------------------------------------------------------------
 def start_scroll(direction, distance, speed)
   @scroll_direction = direction
   @scroll_speed     = speed
   @scroll_rest      = distance.ceil * 128
   case @scroll_direction
   when 2  # Down
     scroll_down(@scroll_rest)
   when 4  # Left
     scroll_left(@scroll_rest)
   when 6  # Right
     scroll_right(@scroll_rest)
   when 8  # Up
     scroll_up(@scroll_rest)
   end
 end
 #--------------------------------------------------------------------------
 # * Determine if Scrolling
 #--------------------------------------------------------------------------
 def scrolling?
   return @scroll_rest > 0
 end
 #--------------------------------------------------------------------------
 # * Start Changing Fog Color Tone
 #     tone     : color tone
 #     duration : time
 #--------------------------------------------------------------------------
 def start_fog_tone_change(tone, duration)
   @fog_tone_target = tone.clone
   @fog_tone_duration = duration
   if @fog_tone_duration == 0
     @fog_tone = @fog_tone_target.clone
   end
 end
 #--------------------------------------------------------------------------
 # * Start Changing Fog Opacity Level
 #     opacity  : opacity level
 #     duration : time
 #--------------------------------------------------------------------------
 def start_fog_opacity_change(opacity, duration)
   @fog_opacity_target = opacity * 1.0
   @fog_opacity_duration = duration
   if @fog_opacity_duration == 0
     @fog_opacity = @fog_opacity_target
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Refresh map if necessary
   if $game_map.need_refresh
     refresh
   end
   # If scrolling
   if @scroll_rest > 0
     @scroll_rest -= 2 ** @scroll_speed
   end
   if @scroll_remain_x > 0
     old_display_x = @display_x
     distance = [@scroll_take_x, 4].max
     unless @display_x + distance > (self.width - 15) * 128
       @display_x += distance
     end
     @scroll_remain_x += old_display_x - @display_x
     if @scroll_remain_x < 0
       @scroll_remain_x = 0
     end
   elsif @scroll_remain_x < 0
     old_display_x = @display_x
     distance = [@scroll_take_x, 4].max
     unless @display_x - distance < 0
       @display_x -= distance
     end
     @scroll_remain_x += old_display_x - @display_x
     if @scroll_remain_x > 0
       @scroll_remain_x = 0
     end
   end
   if @scroll_remain_y > 0
     old_display_y = @display_y
     distance = [@scroll_take_y, 4].max
     unless @display_y + distance > (self.height - 15) * 128
       @display_y += distance
     end
     @scroll_remain_y += old_display_y - @display_y
     if @scroll_remain_y < 0
       @scroll_remain_y = 0
     end
   elsif @scroll_remain_y < 0
     old_display_y = @display_y
     distance = [@scroll_take_y, 4].max
     unless @display_y - distance < 0
       @display_y -= distance
     end
     @scroll_remain_y += old_display_y - @display_y
     if @scroll_remain_y > 0
       @scroll_remain_y = 0
     end
   end
   # Update map event
   for event in @events.values
     event.update
   end
   # Update common event
   for common_event in @common_events.values
     common_event.update
   end
   # Manage fog scrolling
   @fog_ox -= @fog_sx / 8.0
   @fog_oy -= @fog_sy / 8.0
   # Manage change in fog color tone
   if @fog_tone_duration >= 1
     d = @fog_tone_duration
     target = @fog_tone_target
     @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
     @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
     @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
     @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
     @fog_tone_duration -= 1
   end
   # Manage change in fog opacity level
   if @fog_opacity_duration >= 1
     d = @fog_opacity_duration
     @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
     @fog_opacity_duration -= 1
   end
 end
end
17
RMXP Script Database / Re: [XP] Custom Resolution
October 27, 2014, 09:22:40 am
Quote from: KK20For my game, I need to be able to change the tile graphics on the fly by using $game_map.data[x,y,z] = tile_id. Poccil's Tilemap rewrite does not allow for such changes.


Are you sure about that? I copied the Poccil's Tilemap directly from upokecenter on an empty project, and $game_map.data[x, y, z] = tile_id works well on map.
I also tried the Dll-less Resolution Script without anything more and the call doesn't work any more; as I can see the table @map_data is not used internally as much as in Poccil's.

But it has the new method $game_map.change_tile(x, y, z, tile_id) which does exactly the same, so it's not a big problem.

By the way, I would also add a get_tile:

  def get_tile(x, y, z)
    return spriteset.tilemap.map_data[x, y, z] if spriteset.is_a?(Spriteset_Map)
  end


Quote from: KK20I will actually add in an option that allows you to remove priority level 5 tiles from your game (effectively turning them into priority 4) which will help improve FPS.


That sounds great!
18
Script Requests / Re: BGM without interruption
October 05, 2014, 06:04:15 pm
RPG maker has a trouble on reading the mp3 files (specially the longest ones) when looping. And probably wav too. Use an absolutely custom audio system to fix only this is a doom. Also, I don't know about any costum audio system which could fix this bug completly and efficiently. The good thing is, usually ogg is well readed. So you can convert your mp3/wav files to ogg and try it back.

Edit: Oh sorry, maybe I misunderstood the initial problem, if it's a blank space on the start/end of the song try what Blizzard said. Also, Audacity could fix the problem. And if it's a loop "jump" problem in all the songs, in my particular case what works better is to change the mp3 format. I'm not saying it's the only way.
19
Ok it's because when you talk with him he sets the current screen tone (dark because the animation) as the last target tone, so calculates the tones wrong... It's a bug on the demo, but it will not cause problems on default battle animations nor default events with a wait counter after the animation. If I could, I would fix that definitely but I don't know how it's supposed to be corrected.

Thank you for your reply.
20
Quote from: PrinceEndymion88 on September 22, 2014, 01:48:50 pm
I've tried it but this time I've the error: Script 'MOG - Scene File' line 69: NoMethodError occured.

undefined method '[]' for nil:NilClass

even when I try to save.



Oohhhh yes, I know why, don't worry! That bug says @game_variables doesn't exist. But @game_variables always exist exept if the file (@file_exist) doesn't exist. So basically that bug is because you have an empty slot (or more).

Here I added a condition, if the file doesn't exist, the file data will obviously not be drawn.

#==============================================================================
# MOG Scene File Ayumi V1.0           
#==============================================================================
# By Moghunter
#==============================================================================

module MOG
  #Transition Time
  MSVT = 30
  #Transition Type
  MSVTT = "006-Stripe02"
end

$mogscript = {} if $mogscript == nil
$mogscript["menu_ayumi"] = true

###############
# Window_Base #
###############

class Window_Base < Window
  def drw_win_file(x,y)
    dwf = RPG::Cache.picture("Win_File")
    cw = dwf.width
    ch = dwf.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, dwf, src_rect) 
  end   
end

###################
# Window_SaveFile #
###################

class Window_SaveFile < Window_Base
 
  attr_reader   :filename               
  attr_reader   :selected       
 
  def initialize(file_index, filename)
    super(0, 64 + file_index * 138, 640, 240)   
    self.contents = Bitmap.new(width - 32, height - 32) 
    self.opacity = 0
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @game_self_switches = Marshal.load(file)
      @game_screen = Marshal.load(file)
      @game_actors = Marshal.load(file)
      @game_party = Marshal.load(file)
      @game_troop = Marshal.load(file)
      @game_map = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    @wiref = 0
    refresh
    @selected = false
  end 
 
  def refresh
    self.contents.clear
    drw_win_file(0,190)
    name = "Pagina" + "#{@file_index + 1}"#nome pagina
    self.contents.draw_text(338, 23, 600, 32, name) #posizione pagina
    self.contents.draw_text(337, 22, 600, 32, name) #posizione pagina
    unless @file_exist
      # Draw "- Empty Slot -" or something similar if you want
      return
    end
    chapter = case @game_variables[19] # Chapter
      when 0 then "Capitolo 1: Destino Infernale"
      when 1 then "Capitolo 2: Le ''Amazon Stones''"
      when 2 then "Capitolo 3: Sogni In Pericolo"
      when 3 then "Capitolo 4: Lotta Per La Galassia"
      when 4 then "Capitolo 5: L'Ultima Battaglia"
      when 5 then "Capitolo 6: Il Primo Amore Di Ami"
    end
    self.contents.draw_text(338, 23, 600, 32, chapter) #posizione pagina
    self.contents.draw_text(337, 22, 600, 32, chapter) #posizione pagina
    for i in 0...@characters.size
      bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
      cw = bitmap.rect.width / 4
      ch = bitmap.rect.height / 4
      src_rect = Rect.new(cw * @wiref + 1 , 0, cw, ch)
      x = 360 - @characters.size + i * 32 - cw / 4 #posizione sailor
      self.contents.blt(x - 10, 135 - ch, bitmap, src_rect) #135altezza sailor
      x = 116
      actors = @game_party.actors
      for i in 0...[actors.size, 5].min
        x     = i * 60
        actor = actors[i]       
      end   
    end
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.draw_text(5, 41, 397, 32, time_string, 2)
    self.contents.draw_text(4, 40, 397, 32, time_string, 2)   
  end
   
  def selected=(selected)
    @selected = selected
  end
end

##############
# Scene_File #
##############

class Scene_File
  def initialize(help_text)
    @help_text = help_text
  end
 
  def main
    @mnback = Plane.new
    @mnback.bitmap = RPG::Cache.picture("MN_BK")
    @mnback.z = 1
    @mnlay = Sprite.new
    @mnlay.bitmap = RPG::Cache.picture("Lay_File")
    @mnlay.z = 2
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    @help_window.opacity = 0
    @savefile_windows = []
    for i in 0..2
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @savefile_windows[0]
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    @savefile_windows[0].y = 40   
    @savefile_windows[1].y= 140
    @savefile_windows[2].y= 240   
    @win_move_time = 0
    @win_move = 0
    @win_dire = 0
    @win_opac = 255
    @win1_y = 0
    @win2_y = 0
    @win3_y = 0
    Graphics.transition(MOG::MSVT, "Graphics/Transitions/" + MOG::MSVTT)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    for i in 0..50
      @mnback.ox += 1
      Graphics.update 
    end     
    Graphics.freeze
    @help_window.dispose
    @mnback.dispose
    @mnlay.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
 
  def update
    for i in 0..2
      @savefile_windows[i].x = 0
      @savefile_windows[i].z = 1
      @savefile_windows[i].contents_opacity = 130
    end
    @savefile_windows[@file_index].x = @win_move
    @savefile_windows[@file_index].z = 2
    @savefile_windows[@file_index].contents_opacity = @win_opac
    @help_window.update   
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 3
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 3
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index - 1) % 3
        @savefile_windows[@file_index].selected = true
        return
      end
    end
  end
 
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
end


You can draw "- Empty Slot -" or something similar if you want, in line 77.
Example:
self.contents.draw_text(338, 23, 600, 32, "Empty")

I really hope now all will work. I can't test it by myself because I don't have the necessary pictures, that's why it's being more complicated to fix than it should be xD