Trees and Cliffs collision issue :)

Nightshade

Veteran
Veteran
Joined
Oct 26, 2015
Messages
591
Reaction score
120
First Language
English
Primarily Uses
RMMV
why is it that something that a character normally can walk under let him walk over something that you can not.

i know about bridges but how do i keep my character from walking up clif side with a tree over it .

if i set the top of the tree to X how do i walk pass under the branches Oo? do i use events on places where trees are against something o.o
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Yeah, that's a problem.

I wrote a script that fixed this in Ace. I can give you an MV port, but I'd really like to expand it and make it more useful. But this is the version as-is:

//=============================================================================// Terrain Tags// by Shaz// Last Updated: 2015.10.03//=============================================================================/*: * @plugindesc Uses terrain tags to change map behaviour * @author Shaz * * @param Passability Number * @desc Terrain tag to indicate "use passability from tile below" * @default -1 * * @param Counter Number * @desc Terrain tag to indicate "behave like counter (allow interaction)" * @default -1 * * @help This plugin does not provide plugin commands. * * * * */(function() { var parameters = PluginManager.parameters('TerrainTags'); var passageTerrain = Number(parameters['Passability Number'] || -1); var passageCounter = Number(parameters['Counter Number'] || -1); var _Game_Map_checkPassage = Game_Map.prototype.checkPassage; Game_Map.prototype.checkPassage = function(x, y, bit) { if (passageTerrain === -1) { return _Game_Map_checkPassage.call(this, x, y, bit); } else { var flags = this.tilesetFlags(); var tiles = this.allTiles(x, y); for (var i = 0; i < tiles.length; i++) { var flag = flags[tiles]; if ((flag & 0x10) !== 0) // [*]No effect on passage continue; if (this.terrainTag(x, y) === passageTerrain) // Take terrain from tile below continue; if ((flag & bit) === 0) // [o] Passable return true; if ((flag & bit) === bit) // [x] Impassable return false; } return false; } }; var _Game_Map_isCounter = Game_Map.prototype.isCounter; Game_Map.prototype.isCounter = function(x, y) { if (passageCounter === -1) { return _Game_Map_isCounter.call(this, x, y); } else { return _Game_Map_isCounter.call(this, x, y) || this.terrainTag(x, y) === passageCounter; } };})();
Save this as TerrainTags.js in your plugins folder. Then specify the terrain tag to use for any tile where you want its passage setting to be ignored and to look at what's underneath it instead. Then go through your tileset and mark all of those tiles with that terrain tag. Most of them will be the star tiles, but there will also be some that you can walk over, but don't want to use THAT tile's passage settings (like if you were doing a cliff and put a little flower or tuft of grass right on the edge - normally it'd let you walk on/off the cliff at that point).
 

Nightshade

Veteran
Veteran
Joined
Oct 26, 2015
Messages
591
Reaction score
120
First Language
English
Primarily Uses
RMMV
Yeah, that's a problem.

I wrote a script that fixed this in Ace. I can give you an MV port, but I'd really like to expand it and make it more useful. But this is the version as-is:

//=============================================================================// Terrain Tags// by Shaz// Last Updated: 2015.10.03//=============================================================================/*: * @plugindesc Uses terrain tags to change map behaviour * @author Shaz * * @param Passability Number * @desc Terrain tag to indicate "use passability from tile below" * @default -1 * * @param Counter Number * @desc Terrain tag to indicate "behave like counter (allow interaction)" * @default -1 * * @help This plugin does not provide plugin commands. * * * * */(function() { var parameters = PluginManager.parameters('TerrainTags'); var passageTerrain = Number(parameters['Passability Number'] || -1); var passageCounter = Number(parameters['Counter Number'] || -1); var _Game_Map_checkPassage = Game_Map.prototype.checkPassage; Game_Map.prototype.checkPassage = function(x, y, bit) { if (passageTerrain === -1) { return _Game_Map_checkPassage.call(this, x, y, bit); } else { var flags = this.tilesetFlags(); var tiles = this.allTiles(x, y); for (var i = 0; i < tiles.length; i++) { var flag = flags[tiles]; if ((flag & 0x10) !== 0) // [*]No effect on passage continue; if (this.terrainTag(x, y) === passageTerrain) // Take terrain from tile below continue; if ((flag & bit) === 0) // [o] Passable return true; if ((flag & bit) === bit) // [x] Impassable return false; } return false; } }; var _Game_Map_isCounter = Game_Map.prototype.isCounter; Game_Map.prototype.isCounter = function(x, y) { if (passageCounter === -1) { return _Game_Map_isCounter.call(this, x, y); } else { return _Game_Map_isCounter.call(this, x, y) || this.terrainTag(x, y) === passageCounter; } };})();


Save this as TerrainTags.js in your plugins folder. Then specify the terrain tag to use for any tile where you want its passage setting to be ignored and to look at what's underneath it instead. Then go through your tileset and mark all of those tiles with that terrain tag. Most of them will be the star tiles, but there will also be some that you can walk over, but don't want to use THAT tile's passage settings (like if you were doing a cliff and put a little flower or tuft of grass right on the edge - normally it'd let you walk on/off the cliff at that point).


this is severely nice Shaz i'll use this tell you improve on this one : O
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top