![]() |
Damage Blocks
Trigger functions from the player to the player directly to the NPC is easy.
So if the player "swings" it triggers damage on the baddie. But damaging another player is a different story. So why not knock out 2 birds with 1 stone? I want to make "Damage Blocks".... So when player swings it creates a temp npc and it triggers functions for both players and npcs. For the players...I could simply do a onPlayerTouchsMe(), but how do I add collision between 2 NPCS? |
I am very confused about what you're trying to do.
|
You can do it that way using a distance formula I guess, but that's probably a bit inefficient. Why not just trigger from a specific location?
PHP Code:
|
How do you make a player trigger a function in another player?
For example... PHP Code:
|
Generally I prefer to handle that stuff serverside because it's a lot more reliable (i.e. trigger serverside with the attack position, then find out what players have been hit and trigger clientside for them letting them know they've been hit).
Your other main option is to do a trigger like devilsknite1 showed above. It will call onActionWhatever (where "whatever" is the action type) in every clientside weapon that player has. |
Could players manipulate sent information to the server that way? And if many players were doing that at the same time, would that cause any lag? I mean it would be smaller edits so I wouldn't imagine, but if that was how larger servers like Era functioned, it might get pretty laggy.
|
Quote:
|
I suppose, but seems a little unreasonable when you can update all the information clientside, eliminating the need to do anything serverside. Would allow for a better projectile system too, unless the point is to run away from bullets :O
|
| All times are GMT +2. The time now is 02:11 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.