Jump to content
Punio

Common Event Tiles (VXA)

Recommended Posts

**Common Event Tiles (VXA)**
by Resource Dragon

Introduction & Features
This script allows you to set certain tiles to do your bidding through a corresponding Common Event.

 

This can feature endless possibilities;

 

 

Rant of Possiblities

 

You can;

1. Create PSN/LAVA/ Damaging Tiles, Healing Tiles,
2. Tiles that play animations when stepping on them,
3. Do ANYTHING you can do in an event, but it happens when you step on the said tile.
4. IT'S SO DANG CUSTOMIZABLE THAT IT MAKES IT THE MOST CUSTOMIZABLE SCRIPT BY FAR.
5. Think about it. These purple tiles; Now poisoning tiles! sand tiles leave footprints! water tiles you can
actually swim in!
6. Want the tiles to effect you only at certain points in game? turn the common events on and off with switches!
7. Want one tile to do more then one thing? Use variables! Now it does [a] when variable is 1! it does
when variable is 2! 
8. Endless possibilities with this script. IT'S PRACTICALLY A NEW ENGINE ITSELF. (No kidding!)
9. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH


 

 

How to Use
Put above main and below everything else.

Script Download

 

You can download the script from my website here. http://digitalhijinks.com/ruby/rpgmakervxace/common_event_tiles_vxa/

 

FAQ's
 

Q: This is sweet man. Thanks for the neat script!

A: You're welcome, but that's not a question..? /(O_o)\

 

Q: Is this cool? Am I cool for using it?

A: Yes, it is. And yes, you are! Thank you! :3

Q: Who should i credit?
A: Check the section below FTW.

Credit and Thanks
- Me of course, for the script. 

- Special Thanks to Quasi for helping me update it!

- Thanks to Rave for finding the tileset 'bug'!

 

Warning's

- Calling heavy animations with the common event will cause temporary lag. This is an issue with Ace, not the script.

 

Known Bugs

- Script doesn't compensate for different tilesets, causing issues. FIXED!

 

Like the script? --------------------------------------------------------------------------------------------------------------------------------------------------------------- Like the post! -V

Edited by Resource Dragon

Share this post


Link to post
Share on other sites

Can you update it so you also can specify Tileset ID on which checking will occur? So e.g. spikes from dungeon set which are for the purpose of this tutorial of id 222 will hurt player, but a chair (id 222 for the purpose of this script) that is placed on same position as spikes, but in interior set won't hurt player.

 

Or is it not needed?

 

//edit: I can rewrite this to use arrays instead of variables so config will be easier (no adding additional if will be needed) if you want.

Edited by Rave

Share this post


Link to post
Share on other sites

Unfortunately, I didn't take that into account. When I updated the script, I didn't really know how the tilesets work in RMVXA. 

 

If you would like to change it, go ahead. It's been a good 3 years since I was actively using RM, so my Ruby coding knowledge is limited at this point. It should be fairly easy to determine tileset configuration (for the ID issue), but like I said, i'm not much help. 

 

If it's anything like C#, arrays would be a HUGE ease of use factor. I have thrown in comments where I think the changes would need to be, and some example code, but the syntax is likely to throw errors:

 

EDIT: I think this is a very close change (vars to arrays). I'm still unsure about different tilesets though.

 

 

=begin _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
|_|
|_| ** Common Event Tiles (VXA) **
|_| v1.0
|_|
|_| Script by
|_| ~| Resource Dragon |~
|_| | Imaginationd, inc.|
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|
|_|-Description-
|_|
|_| This script allows you to set certain tiles to do your bidding
|_| through it's corresponding Common Event. Both the Tile ID's
|_| and the Common Event ID's are configurable. Want more then three?
|_| It's as simple as;
|_|
|_| 1. Add another Tile ID variable,
|_|
|_| Tile_ID_3 = 9999
|_|
|_| 2. Add another Common Event ID variable,
|_|
|_| Common_Event_ID_3 = 4
|_|
|_| 3. And add another 'if' statement for the two variables.
|_|
|_| if get_maptiles.include? IWS_ComTiles::Tile_ID_3
|_| $game_temp.reserve_common_event(IWS_ComTiles::Common_Event_ID_3)
|_| end
|_|
|_|
|_| Also included is a Tile ID Finder. Use it to find the tile ID numbers
|_| to use for the Tile ID's.
|_|
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|
|_|-Log-
|_|
|_| 1/9/2012 - Scripted, Re-scripted, and completed
|_| 1/9/2012 - Added Tile ID Finder
|_| 1/9/2012 - Finished configuration
|_|
|_| 1/10/2013 - Rewritten for compatibility with VXACE.
|_|
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|
|_|-Usage & Credits-
|_|
|_| If used(commercially or not) please credit with the following code;
|_|
|_| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|
|_| ** Common Event Tiles (VXA) **
|_| ~| Resource Dragon |~
|_| ~| Imaginationd, inc.|~
|_|
|_|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
=end
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

#===================================================#
#| | B E G I N C O N F I G | |#
#===================================================#
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

module IWS_ComTiles

# Tile ID Finder On? true = on, false = off

Tile_ID_Finder_ON = true

# Tile ID's

Tile_ID = Array[1000, 2000, 3000, 4000, 5000] #Tile ID array.

#Corresponding Common Event ID's

Common_Event = Array[1, 2, 3, 4, 5] # same thing here, not sure

end


# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

#===================================================#
#| | B E G I N S C R I P T | |#
#===================================================#
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



class Game_Party

alias ComTilesPwalk on_player_walk unless $@

def on_player_walk(*args)
ComTilesPwalk(*args)


Tile_ID.each {

if get_maptiles.include? IWS_ComTiles::Tile_ID[x]
$game_temp.reserve_common_event(IWS_ComTiles::Common_Event[x])
end
}

end

def get_maptiles
output_data = []
map_data = $game_map.data
player_x = $game_player.x
player_y = $game_player.y
for i in 0..2
output_data << map_data[player_x, player_y, i]
end
return output_data
end
end
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

#===================================================#
#| | B E G I N T I L E F I N D E R | |#
#===================================================#
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



class Window_TileID < Window_Base

def initialize(x = 0, y = 0)
super(x, y, 160, 3 * 24 + 32)
self.back_opacity = 200
@counter = 0
refresh
end
def refresh
self.contents.clear
data = $game_map.data
px = $game_player.x
py = $game_player.y
width = self.contents.width
for i in 0..2
text = "Layer %d: %d" % [i, data[px, py, i]]
self.contents.draw_text(0, i * 24, width, 24, text)
end
end
def update
@counter += 1
if @counter > 5
refresh
@counter = 0
end
end
end

class Scene_Map

alias nr_windowTileID_main main unless $@
alias nr_windowTileID_update update unless $@

if IWS_ComTiles::Tile_ID_Finder_ON == true
def main(*args)
@id_window = Window_TileID.new

nr_windowTileID_main(*args)
@id_window.dispose
end

def update(*args)
@id_window.update
return nr_windowTileID_update(*args)
end
else
end
end
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

#===================================================#
#| | E N D S C R I P T | |#
#===================================================#
# _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 

 

Share this post


Link to post
Share on other sites

The idea behind this script is INCREDIBLE!!! I will definitely be looking into this and seeing what all I can do with it! Thanks for the post! :D

Share this post


Link to post
Share on other sites

The idea behind this script is INCREDIBLE!!! I will definitely be looking into this and seeing what all I can do with it! Thanks for the post! :D

 

I just love how this gets a  bunch of responses a year after I post it. XDD

 

How do you find out what the tile ID is?

 

Make sure this line in the config module is set to true:

Tile_ID_Finder_ON = true 

A window should pop up in game to show you what tile you are currently standing on.

 

 

This is pretty cool, but couldn't something similar be achieved with a Parallel Process Common Event and checking the Terrain Tags or even Regions?

 

 

That would be super slow, you would still need to know the terrain ID's, it's much more versatile this way, and this is much more flexible then trying to do it in blocky regions. Other then that, you could probably get something similar, yea.

Share this post


Link to post
Share on other sites

Update, v2.0! Script has been updated to include hashes for ease-of-use, and is now capable of having different common events for different tilesets!

 

Shout out to Quasi for helping me re-write the methods needed to do so!

 

Also, thanks to Rave for the Tileset idea/bug! It never crossed my mind. XD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted