SphereCommunity
Flying text - sendpacket - Printable Version

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



Flying text - sendpacket - ThatSide - 08-03-2015 07:37 PM

Ive got a working custom combat system on the server I am working at the moment. Only thing that I don't like about it is that damage dealt by anyone is displayed as a message.
So I've been wondering- is it possible to make a flying text (similar like in AOS combat sys) with a sendpacket. I know with a command ID 0C0 I can make cool effects with a flying objects. But what about text?
If it is possible I could use it for my hp, mana, stam potions etc...


RE: Flying text - sendpacket - Coruja - 08-09-2015 09:35 PM

the combat engine uses a exclusive packet 0b to show this damage, something like

Code:
[FUNCTION DisplayDamage]
SENDPACKET 0b D<value>

it only works on clients > 4.0.7a so if your server allow clients older than this, you must add something to check the client version and send a simple "MESSAGE <value>" instead this packet to these old clients


RE: Flying text - sendpacket - Shamino - 08-09-2015 10:40 PM

Dat text can be colored?


RE: Flying text - sendpacket - ThatSide - 08-09-2015 11:49 PM

(08-09-2015 09:35 PM)Coruja Wrote:  the combat engine uses a exclusive packet 0b to show this damage, something like

Code:
[FUNCTION DisplayDamage]
SENDPACKET 0b D<value>

it only works on clients > 4.0.7a so if your server allow clients older than this, you must add something to check the client version and send a simple "MESSAGE <value>" instead this packet to these old clients

Does not work for me... I tried to enable aos damage (thought this might be a problem) but same thing - client freezes and doesn't display anything. After .fix it's normal again.
Also I can't find this packet in JUOPackets.doc (thought maybe there's some additional information)

Update:
After enabling AOS damage, i realized that it displays the damage that my combat system is calculating...
Don't know why I didn't check it earlier - thought if I am going to enable it it will use the AoS sys...
Only thing - I wanted to use this sendpacket for my potions, bandages and other stuff that gives you hits, stam, mana (only in different colors)


RE: Flying text - sendpacket - Coruja - 08-17-2015 07:09 PM

my bad, the correct packet usage is
Code:
[FUNCTION DisplayDamage]
SENDPACKET 0b D<UID> W<ARGS>

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

(08-09-2015 10:40 PM)Shamino Wrote:  Dat text can be colored?
this packet was created only to show damages, so there's no way to change the color like other texts


RE: Flying text - sendpacket - ThatSide - 08-18-2015 06:52 PM

(08-17-2015 07:09 PM)Coruja Wrote:  my bad, the correct packet usage is
Code:
[FUNCTION DisplayDamage]
SENDPACKET 0b D<UID> W<ARGS>

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

nice one. TYVM


RE: Flying text - sendpacket - bororeh - 07-01-2020 01:33 PM

According to this post, this should work:
Code:
[EVENTS E_DAMAGE_DISPLAY]
ON=@Hit
    IF (<I.ISPLAYER>)
        SENDPACKET 0b D<SRC.UID> W<ARGN1>
    ENDIF

ON=@GetHit
    IF (<SRC.ISPLAYER>)
         SENDPACKET 0b D<SRC.UID> W<ARGN1>//***********
    ENDIF

But here is what happens: the player doing the hitting sees the damage as a red number flying over the targets head. However, the player taking the damage doesn't see anything and this error comes up on sphere:
Code:
"ERROR:(nws_pvp_stone.scp,195)Undefined keyword 'SENDPACKET'"

BTW, line #195 is the one marked by //*************. What did I miss?