SphereCommunity
Choosing hue in game - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Choosing hue in game (/Thread-Choosing-hue-in-game)



Choosing hue in game - tleilax - 12-28-2013 10:23 AM

Is there any variable in which is stored Speech color from client Options-Display settings?

If not, is there anything how to popup this same dialog for speech hue choosing and return the hue color?

I need to implement some basic language system (human/elvish), but I want to have different speech colors for each player. The language system is based on this:
http://wiki.sphere.torfo.org/index.php/Languages_Tutorial

Thanks for any ideas.


RE: Choosing hue in game - Soulless - 12-30-2013 08:10 AM

this is pretty interesting, though i dont know the answer of how to detect the players current chosen text color. i would be interested in knowing how
i did find this packet while looking quickly
http://docs.polserver.com/packets/index.php?Packet=0x69


RE: Choosing hue in game - Wap - 12-30-2013 08:16 AM

(12-30-2013 08:10 AM)Soulless Wrote:  this is pretty interesting, though i dont know the answer of how to detect the players current chosen text color. i would be interested in knowing how
i did find this packet while looking quickly
http://docs.polserver.com/packets/index.php?Packet=0x69
General speech packet contains color:
http://docs.polserver.com/packets/index.php?Packet=0xAD

No packets are sent, when color is changed in the game options.


RE: Choosing hue in game - sco - 12-30-2013 11:24 AM

You can get the speechcolor in spk_player with:

local.speechcolor = <argn2>

If your player speaks. Try if you can set argn2, perhaps that works as well.


RE: Choosing hue in game - Avatar - 12-30-2013 07:08 PM

Set
PHP Code:
PACKET149=f_hue_picker 
in sphere.ini,
And the functions below are necessary for this process.
PHP Code:
[FUNCTION f_hue_picker
// You can practically use this function and adjust it in several ways. 
//This is just how we are taking picked hue from hue picker. For instance, i'm using this analogy for the public chat and 
//I'm able to choose my chat color from hue picker.
VAR.HUE_COLOR=<LOCAL.7><STRSUB 1 0 <LOCAL.8>>
//To see if you want, 
serv.log Color Hue Picked is <var.hue_color>
// If you want to tag the character for insance, just use REF1 = <local.char> and assign a tag to ref1 like ref1.tag.color_picked = <LOCAL.7><STRSUB 1 0 <LOCAL.8>>, something like that. Depends on your choice.
REF1= <local.char>
REF1.tag.color_picked <LOCAL.7><STRSUB 1 0 <LOCAL.8>>
// This seems more proper for the purpose. Anyway , i suppose you will get it.
return 



[FUNCTION HuePicker]
SRC.SENDPACKET 095 D<ARGSW0000 W0FAB 

After setting requirements, if you want to learn hue , use this function. Once you used it, hue picker menu appear and you can select color from menu.
PHP Code:
HuePicker <FINDLAYER.LAYER_HAIR

Why I'm referring layer of hair is nothing but you cannot use sendpacket without referring an object. So that is to say, we are just send a fake packet and by filtering we just get the chosen hue as if we are chosing it for layer of hair.

As a matter of fact, you can learn which hue you've chosen from hue picker by looking at the VAR.HUE_COLOR. This is maybe not you are looking for but with hue dialog you chose a hue for your chat like that.

However, "dialog for speech hue choosing and return the hue color" for this statement, the things that i mentioned about is totally answer to it.