RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
RMVXA Pixel Movement Script -please help-

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 69
Small time spriter
Thanks for taking the time to visit, i'd really appreciate help with this problem, if it's something that is actually possible to fix.
Okay, the main problem i have is a passability one, i intend to use smaller than usual character sprites, and although this script (which is great) allows the sprites to get closer to each other by changing certain numbers for the collision detection, i can't seem to totally get rid of the invisible wall around the character, or i think the NPC character actually.

When i approach the NPC directly i can pretty much get as close as any normal sized character set, but when i try to pass around it, like moving around it from the top left corner for example, i hit that invisible wall.

Hopefully that makes sense, i can't seem to ever find the right words to explain myself, to see what i mean please download the VX spritesheet for the template, here's the link.
http://rmrk.net/index.php/topic,49404.msg566303.html#new

And the script i use is the Free Movement script.
Here's the original site with i believe the latest version, script is below.
http://area91.multiverseworks.com/blog/rmvxa_script/gameplay/free_movement

This is important to me, because if i can't find a solution to this i will have to re size everything i've worked on so far..

This is what i've been playing around with, i'm probably missing something of coarse, but i'm no scripter.

Line 409: COLLISION["DEFAULT"] = [8, 12, 16, 10]
This also cause the characters legs to stick through priority tiles though..
« Last Edit: August 26, 2014, 03:32:10 AM by yuyu! »

***
Rep:
Level 72
The cloaked schemer
Most Promising Project 2014
The problem is with the collision boxes. I can't seem to get the collisions to work from the comments block, or map note tags, which is my main problem, but the script call works.
Firstly turn on debugging on line 491: SHOW_COLLISION_BOXES = true
Then you need to do your script call on each event set_collision_rect(x, y, width, height)
The reason this is impractical is because it doesn't take effect until the event page is run at least once. Which is why the author included other options. However, I keep erroring using the other ones, so I'm either doing it wrong, or the script is broken ._.
Spoiler for Directions:
Quote
Finally, since events don't use notetags, you can set the collisions using either a script, notetags placed on the map itself or comment tags on the event itself. For the script method I've added a method to the interpreter, so you can just run it directly from the event without having to find the event itself. There are two ways you can use the method.

set_collision_rect(string)
set_collision_rect(x, y, width, height)

The first way calls the collision box from the collision list. The second directly sets the collision. Do note that collision boxes set this way aren't persistent, so when the map is reloaded, the script must be run again.

You can also use notetags on the map to define the collision box of the event. You'll also need to supply the event name so that it can identify which event should get the new collision box.

<collisionbox eventname: string>
<collisionbox eventname: x, y, width, height>

To make it even more easy to implement collision boxes, you can use the following comment tags on the comment blocks in the event itself:

<collisionbox: string>
<collisionbox: x, y, width, height>

You can use this in two ways. When placed on the first page, it acts as the default collision box. This can still be overridden by the map notetag or a script, but it's used as the default. However, when placed on a different page, it will use that comment page whenever that page is available. That means that you can actually use switches or variables to dynamically set the collision box without having to use scripts.
I'm leaving this incase anyone else can get it to work. These are the official directions, so they should set collision but instead return an error for me. Once you get one of these working, just mess around with the collision sizes and you'll be fine :P

**
Rep:
Level 69
Small time spriter
Yep it wont work until i activate the event  :'(, but you have given me hope, Chaos.
Though it's useless to use it in this way i was very happy to have the characters move so close to each other (VERY happy).

And if you can't get these other methods to work i don't have a chance with my mucking around lol.
I would really like to keep this style and size, so hopefully somebody can tell what those problems are.

Thanks a lot for taking the time.

***
Rep:
Level 39
RMRK Junior
So the problem is that there is no default settings to change for the average event's collision box?
If so let me know asap, I've already fixed it. If not let me know what the problem really is, and I'll try to fix that.
My Website:

:tinysmile:

***
Rep:
Level 72
The cloaked schemer
Most Promising Project 2014
Actually, I think I might have just found a quick fix for you.
Add this
Code: [Select]
<collisionbox: DEFAULT>
in a comment on the event and it will work. Basically, this section of the code:
Code: [Select]
    COLLISION["DEFAULT"] = [8, 12, 16, 10]
    COLLISION["BOAT"] = [4, 4, 24, 24]
    COLLISION["SHIP"] = [2, 2, 28, 28]
    COLLISION["AIRSHIP"] = [4, 4, 24, 24]
are presets. You could add another if you want custom collisions by simply adding another following the same format right under the last one.
This:
Code: [Select]
<collisionbox: x, y, width, height>
should also work, but it doesn't and that was my problem with this script earlier. It always give this error:

But for now, the above fix should be good :D

**
Rep:
Level 69
Small time spriter
This works out great, thank you very much, Chaos :tpg:
You saved me a lot of work, i was halfheartedly working on a bigger template before :V

I will add the script and fix to the thread, along with credit to you, thank ya pal.

@Euphoria
Thank you for taking a look at this as well, if it's a different one then please add your solution as well.

This is actually great news for anyone looking to use smaller character sets, i will make sure to spread it around.

e

If anybody wants to know, I've set the collision to this: 
COLLISION["DEFAULT"] = [8, 12, 17, 16]
« Last Edit: August 24, 2014, 11:02:51 PM by SwampBeast »

***
Rep:
Level 39
RMRK Junior
Or use this http://pastebin.com/SxUz1sMe you can set up the default collision box size for events in the new module I made at the top of the editable part. This will set them to that size before the game even starts.

Edit: well... when the game starts I guess... :p
My Website:

:tinysmile:

**
Rep:
Level 69
Small time spriter
Awesome ;D, but i have a problem, when i try to use the comment function to set a different collision box for a bigger body type, i get this error.
 

***
Rep:
Level 39
RMRK Junior
Can you give me the exact code you entered to get that error?

Are you using my fix or the previous one? If you're using mine I'll add the new fix onto that (assuming I can fix it)
My Website:

:tinysmile:

**
Rep:
Level 69
Small time spriter
I add this to an event comment box:

<collisionbox: 8, 12, 19, 16>

Trying to mess with the Width, i normally have it at 17
hopefully (and probably) i'm doing something wrong.

***
Rep:
Level 39
RMRK Junior
From a quick look (and this may have been in the wrong section, so it might now work either) the regex is setup to accept ONLY:

<collisionbox eventname: x, y, w, h>

and you are forgetting to put in the eventname.

But I'm super busy and can't fully check it out til tonight.
My Website:

:tinysmile:

**
Rep:
Level 69
Small time spriter
Aha, maybe that's it, i will test this out and get back, thanks a lot pal.

e
Nope it doesn't seem to work.
I used that in a comment, and just in case a call script, and while i don't get that error message anymore, it makes no difference.

But don't break your head over it, i think a setting somewhere in between is good, plus i don't think i would have used that code often.
I have it set at   COLLISION["DEFAULT"] = [8, 12, 19, 16]
Which i think is a perfect setting to prevent overlapping with anything, such as clothing or hair from other characters.


Appreciate the help, i will upload the script to the thread.
« Last Edit: August 26, 2014, 09:18:28 PM by SwampBeast »