Change auto tile Animation speed per map

Started by Taiine, July 13, 2011, 06:30:01 pm

Previous topic - Next topic

Taiine

I know you can go into Spriteset_Map and change line 119 @tilemap.update to X.times {@tilemap.update} where X is the new speed to change how fast auto tiles play. But this is a global effect changing every map.

I'd like a script that you can set a speed for the auto tiles per map, and if no setting is made have it go to a default set speed.

I tried doing this before but couldn't figure out away to define the map id's and the auto tile speed. It either errored or had no effect at all on the maps.

So can someone else who knows more about scrips then I do take up this (hopefully) simple request?

ForeverZer0

Its in Tons.
The defining it for each map feature isn't there, but you can easily do that with a script call in an event.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Taiine

Could you by chance give me what the call is? Looking though TONS trying to find that one script xD Such fun. :3

ForeverZer0

July 13, 2011, 11:07:48 pm #3 Last Edit: July 13, 2011, 11:28:36 pm by ForeverZer0
I'll make you an edit real quick, give me a few minutes.

EDIT:
This should work. Sorry if its a bit sloppy. Just ask if you need any instructions, its pretty self-explanatory,

Spoiler: ShowHide
class Game_Map
 
  def self.map_speeds(map_id)
    case map_id
    # when MAP_ID then SPEED
    when 1, 2, 3
      return 2
    when 4
      return 8
    when 5
      return 16
    end
    return 1
  end
 
  attr_accessor :autotile_speed
 
  alias zer0_autotile_speed setup
  def setup(map_id)
    @autotile_speed = Game_Map.map_speeds(map_id)
    zer0_autotile_speed(map_id)
  end
end

class Tilemap
 
  alias zer0_tilemap_upd update
  def update
    zer0_tilemap_upd if Graphics.frame_count % $game_map.autotile_speed == 0
    zer0_tilemap_upd
  end
end
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Taiine

Thanks for the sniplet. Though the rate of the speed change is very little. There's hardly a noticeable difference and at first I thought it wasn't doing anything trying speed 1, 3, 6, etc until I went to like 100, 200, 500, then noticed a slight slowing down but not much.

Where as the way I mentioned before how I was doing it, speed 1 and speed 5 would be vastly different in speed.

Is there away to increase the rate of the speed between the values?

nathmatt

try this then
class Game_Map
 
  def self.map_speeds(map_id)
    case map_id
    # when MAP_ID then SPEED
    when 1, 2, 3
      return 2
    when 4
      return 8
    when 5
      return 16
    end
    return 1
  end
 
  attr_accessor :autotile_speed
 
  alias zer0_autotile_speed setup
  def setup(map_id)
    @autotile_speed = Game_Map.map_speeds(map_id)
    zer0_autotile_speed(map_id)
  end
end

class Tilemap
 
  alias zer0_tilemap_upd update
  def update
    @autotile_speed.times{zer0_tilemap_upd}
  end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Taiine


ForeverZer0

It should be $game_map.autotile_speed in the update method for Tilemap, not just @autotile_speed. :P
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Taiine

rofl yes that works perfectly. Now I can alter the speed rather I use my 12 frame river auto tile (nice smoooth motion) or the normal 4 frame tiles.

Thanks muchly both of you <3