Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How get color
Author Message
Monty
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jun 2012
Reputation: 1



Post: #1
How get color
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

C# application developer.
C/C++,SQL,PLSQL programming.
Oracle database / information system developer.
Cooperation for development of new shard.
(This post was last modified: 07-19-2013 07:04 PM by Monty.)
07-19-2013 12:52 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: How get color
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 
(This post was last modified: 07-19-2013 01:19 AM by darksun84.)
07-19-2013 01:14 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: How get color
Just convert the number to HEX for tilepichue.... 081b

[Image: 2nis46r.jpg]
07-19-2013 01:16 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #4
RE: How get color
serv.newnpc c_nightmare
local.color=<serv.chardef.<new.baseid>.color>
07-19-2013 03:12 PM
Find all posts by this user Like Post Quote this message in a reply
xwerswoodx
Journeyman
*

Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0

UoMMO

Post: #5
RE: How get color
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>>>
07-19-2013 05:41 PM
Find all posts by this user Like Post Quote this message in a reply
Monty
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jun 2012
Reputation: 1



Post: #6
RE: How get color
(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.

C# application developer.
C/C++,SQL,PLSQL programming.
Oracle database / information system developer.
Cooperation for development of new shard.
07-19-2013 05:46 PM
Find all posts by this user Like Post Quote this message in a reply
Monty
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jun 2012
Reputation: 1



Post: #7
RE: How get color
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

C# application developer.
C/C++,SQL,PLSQL programming.
Oracle database / information system developer.
Cooperation for development of new shard.
(This post was last modified: 07-19-2013 10:13 PM by Mordaunt.)
07-19-2013 07:03 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #8
RE: How get color
....
changed
(This post was last modified: 07-19-2013 07:29 PM by admin phoenix.)
07-19-2013 07:27 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)