![]() |
player.attr[]
Player attributes are extremely useful, but they tend to fill up too fast. It would be awesome if they were extended to work based on strings instead of numbers. For example, you could do something like
PHP Code:
PHP Code:
Regardless of how it's implemented, support for string-based (or even just more) player.attr[] values would be awesome. |
You're using 30 attr's wtf?
but I also agree that your extended attributes suggestion would be cool. |
The problem is, as far as I know, is all attr's need to be sent to all players at all times, clientside and serverside. That's apparently a lot of data.
|
Quote:
That ends up looking like this (pardon the max word length of the forums): Quote:
|
Attribute setting is probably one of the least laggy things you can do on a server that makes heavy use of them, really. I've never gone over 15 or so attributes, however, perhaps you need to combine similar-use attribute ganis together.
I understand why the current attribute functionality hasn't been expanded, however. Once you familiarize yourself with gani scripting you understand that all player attributes are sent for each player (or, at the least, each player that is shown on screen), expanding the current restrictions could cause some latency issues. |
Normally attr[] is for things that really need to be shared - so mainly for visual things. I hoped 30 would be enough the last time when it has been increased from 9 to 30 :)
|
Quote:
|
Quote:
|
Quote:
|
On Classic I scripted a system to apply and retrieve values to and from designated attribute values, where basically a temporary array consisting of the name, attribute number and default value is looped through when the weapon is created where the necessary data is applied to a static var,
I actually happen to use a player.getAttr("health"); function, aswell as player.setAttr("health", amount);, player.loadDefaultAttr("health");, and player.isDefaultAttr(#) etc. It can also load designated attributes from other players, and is setup serverside too in order to be synced. Would be excellent if something like this was built-in but it's not necessary. |
Or maybe you guys should learn to use enumerators more often. :P
|
All times are GMT +2. The time now is 10:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.