SphereCommunity
How get color - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: How get color (/Thread-How-get-color)



How get color - Monty - 07-19-2013 12:52 AM

Is it possible get color from this?

Code:
[CHARDEF 074]
DEFNAME=c_nightmare
NAME=nightmare
...

ON=@Create
   NPC=brain_dragon
   COLOR=2075 // <- this need

SOLVED:
I use darksun84 boring method Big Grin but I created small utility what can generate defname with colors. If somebody want can download it.

Code:
forum.spherecommunity.net/sshare.php?download=234



RE: How get color - darksun84 - 07-19-2013 01:14 AM

A boring way is to add a static tag to the chardef, so you can do <serv.chardef.c_nightmare.tag.color_pic>
Static tag doesn't count on the tag list of a npc(unless you change the value in game), so they shouldn't decrease performance
//will return 2075 in hex format(081b)
PHP Code:
[CHARDEF 074]
DEFNAME=c_nightmare
NAME
=nightmare
tag
.color_pic 2075 //"static" tag 

Another boring way is to do a defname list with the color of your npcs
<def.<color_<serv.chardef.c_nightmare.baseid>> // will return 2075 in hex too
PHP Code:
[DEFNAME npc_color_pic]
color_c_nightmare 2075
//other npc here 



RE: How get color - Mordaunt - 07-19-2013 01:16 AM

Just convert the number to HEX for tilepichue.... 081b


RE: How get color - admin phoenix - 07-19-2013 03:12 PM

serv.newnpc c_nightmare
local.color=<serv.chardef.<new.baseid>.color>


RE: How get color - xwerswoodx - 07-19-2013 05:41 PM

You cannot use .color in serv.chardef because color is come with @Create trigger and it's not a tag before creating the npc.

But you can do this,

Code:
[Defname npc_colors]
color_nightmare 0455
color_ostard_desert 00
color_ostard_forest 00
color_llama 00

<def.color_<strsub 2 0 <baseid>>>


RE: How get color - Monty - 07-19-2013 05:46 PM

(07-19-2013 03:12 PM)admin phoenix Wrote:  serv.newnpc c_nightmare
local.color=<serv.chardef.<new.baseid>.color>

Is this working? Color is not define under chardef. I think about that:
Code:
serv.newnpc c_nightmare
local.color = <new.color>
new.remove

But create 20 npc(and more) in one second is bad way.


RE: How get color - Monty - 07-19-2013 07:03 PM

I use darksun84 boring method Big Grin but I created small utility what can generate defname with colors. If somebody want can download it.


forum.spherecommunity.net/sshare.php?download=234


RE: How get color - admin phoenix - 07-19-2013 07:27 PM

....
changed