SphereCommunity
floating text - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: floating text (/Thread-floating-text)



floating text - Soulless - 07-09-2012 06:19 PM

Does anyone know how to make messages float overhead for a second and dissapear, much like the damage numbers from the AOS features. any thoughts on this? it would help my level system look less irritating when your gaining xp from multiple things.


RE: floating text - Shaklaban - 07-09-2012 07:14 PM

you can do it with sendpacket

http://docs.polserver.com/packets/index.php?Packet=0x0B


RE: floating text - Soulless - 07-10-2012 06:02 AM

It seems that i just freeze myself up. i dont often work with packets so clearly ive done something wrong.

[FUNCTION float_text]
SENDPACKET 00B D<UID> 10

this freezes up the client. im using 5.0.9.1 and the latest sphere version


RE: floating text - Extreme - 07-10-2012 07:12 AM

(07-10-2012 06:02 AM)Soulless Wrote:  It seems that i just freeze myself up. i dont often work with packets so clearly ive done something wrong.

[FUNCTION float_text]
SENDPACKET 00B D<UID> 10

this freezes up the client. im using 5.0.9.1 and the latest sphere version
I tested it, I can't send text in this packet...
To work with numbers
sendpacket 00B D<UID> 00 01
It will send the number 1 above the head.
Try change the last '01' to another number.
Prepare for lost of crash =D


RE: floating text - Soulless - 07-10-2012 07:36 AM

SO ive got it so it displays the numbers correctly. (But...)

sendpacket 00B D<UID> w<ARGV[0]>

however, i need it to say "gained" "xp" also, and is there a way to make this a different color somehow??
im not very good with send packets but i assume this is the only way to do what i want.



Thanks,


RE: floating text - Skul - 07-10-2012 08:05 AM

That's not possible (unfortunately), the client does not allow manipulations of the packet. If the <UID> matches the recipient of the packet, the number will display yellow, if not it will display red. there is no way to add in a string or change the color, it's all built-in to the client. Just the way it is.
Message display is an option setting the client stores, it's all client-side. You can send a MESSAGE or SYSMESSAGE, other than that it won't make much sense... I can suggest a timer to store the experience you are gaining, maybe based on every 5 seconds to display the most recent experience gained? That'll help 'unjumble' your level system. An example:
Code:
[function exp] //used to give experience
if !(<tag0.exp_recent>)
timerf 5, f_display_exp
endif
tag0.exp_recent += <argn1> //considering <argn1> is the experience gained -- .exp <amount>
tag0.exp += <argn1> //add actual experience

[function f_display_exp]
sysmessage @99 You recently gained <dtag0.exp_recent> experience.
tag.exp_recent= //reset

Just a little make-shift idea of how you can do it.
Maybe make the message of gaining experience from monsters instant and other type of gained experience delayed (@hit, @skillmakeitem, etc etc).


RE: floating text - Soulless - 07-10-2012 09:22 AM

Thats a pretty good idea, that should unjumble it. it will keep it from spamming over the chars head
that will work just fine.

Thanks Skul Smile