DenizenScript / Denizen

NPC and general Spigot scripting, using the Denizen Scripting Language!
https://denizenscript.com/
MIT License
207 stars 104 forks source link

Colors = config trouble #34

Closed Adeo-xx closed 12 years ago

Adeo-xx commented 12 years ago

Hi, i read here that denizen uses "§" for colors, but if i typed that to config like that:

player_chat_to_npc: "§7[§e§7]: " player_chat_to_npc_bystander: "§7[§e§7]: " npc_chat_to_bystanders: "§7[§e§7]: " npc_chat_to_player: "§7[§e§7]: " npc_chat_to_player_bystander: " says to , ''"

That reset config to default and doesnt work... Can you make denizen with Chatter or somethink like that support? I must make colors for my npc's... Or you can help me fix it up? :) Thanks, Adeo

aufdemrand commented 12 years ago

That should work... what build are you using? Debuzeb 98+ doesn't ever write to a config file, only reads. When you made the changes, did you try /denizen reload?

Adeo-xx commented 12 years ago

http://scr.hu/150/9egkw Yes i tried /denizen reload and /reload.

aufdemrand commented 12 years ago

I am unable to reproduce this.. colors work for me. Make sure you are using build 124, the latest recommended build on ci.citizensnpcs.net.

Adeo-xx commented 12 years ago

http://scr.hu/150/uc341 It doesnt work. I have that errors in console...

aufdemrand commented 12 years ago

What character encoding are you using when saving your YML files?

Adeo-xx commented 12 years ago

ANSI

aufdemrand commented 12 years ago

Try UTF-8 or Unix-UTF8

Adeo-xx commented 12 years ago

The same thing with UTF-8

aufdemrand commented 12 years ago

Seems to be a SnakeYML (implemented in Bukkit) problem.. :(

https://bukkit.atlassian.net/browse/BUKKIT-1466

I see there's a 'hackfix' to strip the YML file of that character before reading in the YML, which I will look in to.

Adeo-xx commented 12 years ago

So, how can i fix it?

aufdemrand commented 12 years ago

I'm not completely sure, as I am unable to reproduce this on my own. You're the second person in which this has seemed to affect...

I'm being told you may need to encode to ANSI, back to UTF-8, back to ANSI, back to UTF-8. Sorry I don't have a more scientific answer as of now. I promise I will look into it.. stripping the character on start of Denizen is definitely possible, I just need to finish up the changes I'm doing right now to Denizen before I can get to that, unfortunately. You could, for now, not use color codes.

Also, what program are you using to edit your YML files?

aufdemrand commented 12 years ago

Also, put up a pastebin/pastie of your entire config file.

Adeo-xx commented 12 years ago

http://pastebin.com/qFQzQnHR Here is my config. Now without paragraphs. But with paragraphs this looks like "§7[NPC]§e< NPC >§7: < TEXT >"

aufdemrand commented 12 years ago

I would be interested to know if this worked:

player_chat_to_npc: "\u00a77[\u00a7e\u00a77]: "

I know it's ugly... but... :)

Adeo-xx commented 12 years ago

Damn! It Works... :D Thanks very much... You can close, but if you can, add suport to "&" character :)

aufdemrand commented 12 years ago

I'll probably just add "%%[#]" support, it's easier on parsing. That is supported in scripts now, by the way, just not in config yet.

Thanks for testing!