Page 1 of 2

[Solved]I badly need help

Posted: Wed Apr 05, 2017 16:58
by Mayor Jeffrey IX
Hello there! I've been playing Theotown for a few months now. I need help with plugins, though. Every time I make a plugin, (I follow the directions closely) I get this Error page:Image
Please help me.

Posted: Wed Apr 05, 2017 17:00
by Sometheotown mayor
Could we see the entire code

Posted: Wed Apr 05, 2017 18:29
by Mayor Jeffrey IX
Ah yes. Here is the code.
Image
The problem is, it seems that if I make or edit an existing plugin, I get this message.

Posted: Wed Apr 05, 2017 19:26
by Lobby
To me the error message looks like a coding problem. Maybe you can upload also the content of the json file instead of an image showing it. About coding, something like UTF-8 should work. You might consider to use another text editor to modify the json file.

Posted: Wed Apr 05, 2017 23:05
by Mayor Jeffrey IX
Okay. Sorry, but I'm new at this stuff.Two questions:
1. What is UTF-8?
2. How do I upload stuff?

Posted: Wed Apr 05, 2017 23:30
by Lobby
1. If you don't know what it is then it's difficult to talk about it. You may find out more about it in the Wikipedia article. Short version: There are different ways on how one can save text files. Usually, not all are supported by all programs.

2. Do you know what Copy and Paste is? Select the content of the json file, copy it, create a new post here, and paste the contents into it.

Posted: Wed Apr 05, 2017 23:33
by CommanderABab
You might have unicode characters not supported by the game in the json file.

For example, a web game I play will break for a player if they use any unicode character that starts with hex F in the three byte unicode. Such as 🆎.

Posted: Thu Apr 06, 2017 2:02
by Mayor Jeffrey IX
I feel like an idiot :oops:
Thanks. Oddly enough, I can't paste it though.........
Also, in that error log file I see the black diamond with the question mark in it, so there it some UTF-8 symbols in it. Thank you.
I will look closely for them.

Posted: Thu Apr 06, 2017 2:59
by Ølsken
Maybe use this as a sample
Image

Posted: Thu Apr 06, 2017 3:24
by Mayor Jeffrey IX
What program is that?

Posted: Thu Apr 06, 2017 3:29
by Ølsken
Mayor Jeffrey IX wrote:What program is that?
json you use it to make plugins
Or if your talking about what it is it's a plugin json for education

Posted: Thu Apr 06, 2017 3:31
by Ølsken
If you want to make it into a management plugin just change the education to management

Posted: Thu Apr 06, 2017 3:34
by Mayor Jeffrey IX
Okay, I've found out I'm using "UTF-8" symbols. Can you show me symbols that I can use?
Apparently JSON cannot read certain symbols.

Posted: Thu Apr 06, 2017 3:42
by Ølsken
Mayor Jeffrey IX wrote:Okay, I've found out I'm using "UTF-8" symbols. Can you show me symbols that I can use?
Apparently JSON cannot read certain symbols.
it should look something​ like this
Sorry if it's wrong
Image

Posted: Thu Apr 06, 2017 3:54
by Ølsken
Sorry I think is

Code: Select all

"type":"public",

Posted: Thu Apr 06, 2017 4:10
by Ølsken
This will work edit as you like :wink:

Code: Select all

[
{
"id":"RadioStation",
"frames":[{"bmp":"radio.png"}],
"width":3,
"height":3,
"type":"public",
"influence management":"55",
"influence park":"25",
"max count":"5",
"Build time":"25",
"title":"test radio",
"text":"test",
"price":"1500",
"monthly price":"250"
}
]


Posted: Thu Apr 06, 2017 8:51
by danekbel
Mayor Jeffrey IX wrote:Ah yes. Here is the code.
Image
The problem is, it seems that if I make or edit an existing plugin, I get this message.
I think that you shouldn't put gaps after colons

Posted: Thu Apr 06, 2017 9:19
by Ølsken
danek_danevich wrote:
Mayor Jeffrey IX wrote:Ah yes. Here is the code.
Image
The problem is, it seems that if I make or edit an existing plugin, I get this message.
I think that you shouldn't put gaps after colons
it's ok he can just copy this

Code: Select all

[ 
{ 
"id":"RadioStation", 
"frames":[{"bmp":"radio.png"}], 
"width":3, 
"height":3, 
"type":"public", 
"influence management":"55", 
"influence park":"25", 
"max count":"5", 
"Build time":"25", 
"title":"test radio", 
"text":"test", 
"price":"1500", 
"monthly price":"250" 
} 
] 

Posted: Thu Apr 06, 2017 9:28
by CommanderABab
Whitespace like blanks are ignored, doesn't matter how many are there.

Posted: Thu Apr 06, 2017 12:42
by Mayor Jeffrey IX
I think I found my problem. What I do is make a .doc file, edit the file with a normal file editor (like MS Word), then change the extension to .json. I can see how that wouldn't work.
Thanks for the help and the code!