![]() |
An alternative to a drag tool.
I couldn't post the PHP code since incapsula kept blocking me >:(
The other day I was mucking around with Callimuc, Crow and Theo on Atlantis and Crow gave me a wonderful idea from using one of his staff tools. He had a mouse warp that could warp other players to a position in a level rather than having a fancy drag tool that, lets face it, just screams "Abuse me!". I decided to code my own since I thought it was a great alternative to a drag tool that could do the same job twice as quick and didn't need all the fancy tweaking to make a smooth drag effect. It seems like a useful tool so I thought I might post it. Criticism is welcome ^_^ Basically, it allows you to warp other players (and yourself) around the level. It doesn't need anything fancy and simply warps them to where you click your mouse. To turn the selection tool on/off hit the SHIFT key. When it's on click on a player to select one and click on the part of the screen you wish to warp them. I then deselects the player after warping since I don't see any reason why you would want to continuously warp a player around the level. The extra GUI code is a simple little window to show if a player has been selected or not. It's not vital you have this and chat alerts work just as well. |
You should use booleans instead of 0/1. Nicer to read for other ;) else great thing.
|
It's good that you've posted an example for others who might be in need to use, but immediate coordinate click summoning was the norm before this whole dragging thing came about.
|
Quote:
|
Quote:
|
Quote:
|
This is clientside, so how would it move other players?
Edit: tested, and it only moves others on your screen, not theirs. |
Quote:
|
Quote:
Quote:
|
I have seen that if I change another players x and y with the tool and they move quickly after, they snap back to that position. Would changing the position on the serverside fix that?
PHP Code:
|
I think so.
|
Great, did some tweaking and the code does what it's supposed to do now. It's finding the player and changing their x and y on the serverside. Here's the new code.
|
Updated it a little bit. Added a new feature. If a player is already selected by another player, they can't warp then until the other player deselects them. It's to stop a player double warped really.
Also, what's with all the deletions with a reason? |
Quote:
Also, there's no reason to store the account of the player you've selected in a client. var. Store is as an attribute of the weapon (this.). It's also a bit silly to run a loop and then wait for it to get to the selected player before warping them. |
Quote:
You said that it won't work? It's been working OK so far? What do you mean :P |
| All times are GMT +2. The time now is 06:53 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.