![]() |
Event Handlers for player entering/leaving an NPCs shape
I suggested this in my Tech Support thread on playertouchsme, but it certainly hasn't received any attention, and the Future Improvements forum is certainly a more appropriate place for it.
Every NPC has an x,y,width, and height. However, there is no event handler for entering the shape of the NPC. The event handler "playertouchsme" doesn't cut it because it detects the area in front of the player rather than the base of the player. I'm not saying there's no way of detecting if a player is within the shape of an NPC. I'm saying there's no efficient serverside way of detecting it. onPlayerEntersMyShape onPlayerLeavesMyShape It may be difficult to write code for detecting if a player leaves the shape of an NPC if the NPC's x/y/width/height remain dynamic. Such is the reason we can't have an event called when an NPC touches a player. Because of this, it would make sense to declare the NPC's coordinates and shape as static using a command, that would, in turn, enable the event handlers. This would be useful in 1. Damage Systems 2. Sparring/PK/Event Areas 3. Any quest activity that might require a player standing on something. This can be extended into multiplayer quests where different players must be in different areas. I guarantee that other ideas can be expanded from this. PLEASE!!! WE SERIOUSLY NEED THIS!!! |
You could check to see if the players x/y is inside the npcs width/height without a special new command.
|
Quote:
|
I have recently realized that gscript could also be expanded for increased functionality of this suggestion.
setshape could be expanded to have a mode for ellipses with x-radius and y-radius, or to have a mode for {x1,x2},{y1,y2} Ellipses would be good for round arenas, or round damage fields. Array-based coords would be good for a damaging object that moves at angles and lays damage fields around its path. Perhaps instead of {x1,x2},{y1,y2}... maybe something more like what showpoly uses. In that case I could very easily make a donut-shaped damage field. Another good reason to have this would be for modifying the movement system to turn off players blocking on certain areas (though this is the only one that would be implemented clientside, and in which case it's doable without the event handlers, but simplified through the use of the event handlers). |
| All times are GMT +2. The time now is 08:04 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.