SphereCommunity
Equipping, unequipping, and making sure my custom stats do what they should - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Equipping, unequipping, and making sure my custom stats do what they should (/Thread-Equipping-unequipping-and-making-sure-my-custom-stats-do-what-they-should)



Equipping, unequipping, and making sure my custom stats do what they should - bmanny - 05-10-2017 01:45 PM

Let's say I have on armor TAG.Chaos = 3.

I want the player to know how much Chaos they have, but also remove that chaos when they take off equipment, die, ect. Where is the proper place to do this to avoid bugs, not clearing the tag, ect?

I want to be able to then get the total TAG.Chaos they are wearing.

A way to provide a buff to Chaos would also be awesome with an @timer and the proper way to do that, clear it on death, make sure it isn't abused, ect.


RE: Equipping, unequipping, and making sure my custom stats do what they should - Murmur - 05-10-2017 03:11 PM

I had this post bookmarked for when I get to scripting some TAGs on my own server, thought it might point you in the right direction, its pretty similar to what you want, just need to put it on @Equip, @Unequip and @Death etc

https://forum.spherecommunity.net/Thread-Tags?highlight=TAGs

Hope it helps.
-Murmur


RE: Equipping, unequipping, and making sure my custom stats do what they should - darksun84 - 05-10-2017 11:43 PM

You can use a TYPEDEF for handling your custom tags/properties with equipment.
Example:
Code:
[FUNCTION getChaos]
sysmessage You have <dsrc.tag0.chaos> points.

//You should assign your player usable functions inside a PLEVEL1 block. otherwise they can't use them in game
[PLEVEL 1]
getChaos

[TYPEDEF t_chaos_item]
ON=@Equip
src.tag.chaos = <src.tag0.chaos> + <tag0.chaos>

ON=@Unequip
src.tag.chaos = <src.tag0.chaos> - <tag0.chaos>

[ITEMDEF i_test_id]
Name = Test Shield
id = i_shield_buckler
TEVENTS = t_chaos_item
tag.chaos = 3

ON=@Create
hitpoints = 100