![]() |
Thank you very much! Now I think I understand the DB NPC :)
Although, I still have problems with the PlayerTouchsMe. It seems as if the player touches the NPC when the player is located to the top left of the NPC. This is the NPC script: PHP Code:
PHP Code:
|
You're setting the shape to a 32px by 32px block, which doesn't perfectly fit the character. Try something like 38x48 (change the setShape). I can't remember exactly what it should be, so just change the values until it's working as you want it to, being sure to update the level in-between changes.
|
Ah okay, I thought 32x32 pixels was the default character size :O
Isn't the "hit box" drawn from the upper left corner of the NPC to the lower right corner as a rectangle with the size specified in setShape? |
For normal NPCs 48 by 48 will do fine on server-side, and you're right on about the hit box.
The point of your shop class is to make it accept any shop id, so in your NPC you should be setting the shop id not in the class itself. I.e: PHP Code:
PHP Code:
|
Yepp :) I did that just to check if it worked. I'm going to setup different shop IDs and add them to the different NPCs before joining the class.
But if I set the setshape to 48, 48 wouldn't I touch the NPC even when I'm far away from it? EDIT: NOticed that it worked just fine :) But what about the 32, 32 hit box? Feels like I need an explanation why the hit box is 32,32 while the NPC should be set to 48,48? Is it because the NPCs image blocks the player? |
Quote:
|
| All times are GMT +2. The time now is 03:34 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.