Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: RCatossi on October 07, 2011, 05:03:12 am

Title: [XP] Corner detection OR Diagonal passability
Post by: RCatossi on October 07, 2011, 05:03:12 am
INTRO

Hi there!

I don't know how to exactly call this script, but I have looked in many places and found none. Plus, my internet is limited (currenly in Mozambique teaching computers).

The only script that does something similar is Pixelmovement1.6, but i think it can be made more simple.

So i came up with a new idea (as far as I know of): diagonal passability based on terrain ID.

I think it will work fine because it is simple. The way i tried to make it, i used 5 terrain IDs, one for each side of the prism and one to retain facing direction while in transition from tile to tile. (but my script wasn't working well, it was just some lines i added to some pixel movement script)

CONCEPT

I made this pic to better explain the goals of that script, and I think that the picture is pretty much self-explanatory.
(http://raphaelcatossi.files.wordpress.com/2011/10/slide_example.png)

(X = non-passable; 1, 2, 5 and 0 are terrain IDs)

0 0 1 X X X 2 0
0 0 5 1 X 2 5 0
0 0 0 0 0 0 0 0

Another idea is to use only one terrain ID, and if front + side passable = false, then slide to opposite diagonal side.

Example:

0 0 1 X X X 1 0
0 0 1 1 X 1 1 0
0 0 0 0 0 0 0 0


WHAT SHOULD IT DO:


If Terrain Id = 1 and hero walking from left to right


If Terrain Id = 1 and hero walking up


Should work for other directions too.

After leaving the corner or stop moving when facing a non-passable tile:


if there is any script for that out there: let me know.
  else this is my request.
end

Peace
Cato
Title: Re: [XP] Corner detection OR Diagonal passability
Post by: Blizzard on October 07, 2011, 05:26:07 am
Actually diagonal passability is already implemented by default in RMXP. All you have to do is to implement diagonal movement which is the change of 1 line basically.
Title: Re: [XP] Corner detection OR Diagonal passability
Post by: RCatossi on October 07, 2011, 06:00:22 am
Thanks for the quick reply Blizzard, but NO, that's not what i mean.

I know the hero can move diagonally... by pressing two keys.

I want the hero to move diagonally automatically, whenever facing a diagonal wall, while holding only one key, PLUS using a diagonal sprite.

Isn't that clear?

I'm going to make that script anyway, but until I fully learn scripting, i am challenging people to do this.

Peace...