Talk:How do I comment my code?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

TMC (talk):

A comment in arabic in chinese (any language which do not use the roman alphabet) even if the # is placed before will prevent you hss file from beeing imported

That's not true, unless you've found a bug. HSpeak fully supports unicode (but has to convert it down to Latin-1 for the the engine), and comments can be written in Chinese.

Anyway, I think I will merge some of this into Plotscripting Tutorial#Making your Script Easier to Read.

Although this shouldn't be listed in the FAQ, it isn't commonly asked.

User: Bis Senchi (talk):

Hello TMC. Thanks for your feedback. Indeed this is not a question frequently asked. You were right deleting FAQ among the categories under which articles is associated. I'm glad to leran you may use it as part of a future tutorial. To go further about what you were saying, I've just made a another test by adding the following

 comment # 貴方

These kanji are the japanese for "you". After I typed it transformed into question marks. (I'm using notepad++ for coding). I confirm that Hspeak detects this as an error and the import do go up o the end. It does not really look a bug. I'm using the following at the top of my .hsi file

 include, plotscr.hsd   #language definition and adds
 include, test_game.hsi  #game-specific include
 include, scancode.hsi  #keyboard datas 

It may come from that there's a missing add-on to the HSS.

TMC (talk): I don't understand what you mean by "it transformed into question marks", as it's a comment, so hspeak will not use it anywhere. You mean Notepad++ transformed it into question marks?

Here is a script which compiles and works perfectly well!

define constant( south, 南 )
define constant( 5, 五 )

plotscript, 南へ歩く test, begin
  variable (自分)
  自分 := me
  walk hero (自分, 南, 五)
end

Try it out! The name of the script will be "????test" in Custom, for now. (I plan to add support for unicode including Japanese in Custom/Game). At least on Linux, if you make a mistake hspeak will also repeat back the kanji correctly in its error messages, but it might not work on Windows.

Also, you can remove all of those `include` lines, they are obsolete and ignored if you import the .hss file directly from Custom.

I could tell you many more problems in your scripts on the wiki. E.g. you don't need `define script` either, get rid of that, it's also obsolete. (But in any game you're working on you might have to keep it for your Each Step and Death scripts to keep old save files working.)

I meant that I don't think this should actually be a separate article, we should merge it into the Plotscripting Tutorial.


User: Bis Senchi (talk):

Hello again :D

You said : "Notepad++ transformed it into question marks?" That's exactly it! Here is a link toward a screenshot I made. (Sorry I'm not very wiki savy and I don't know how to include an image from a external source directly inside a article.


External Link

So this may be a bug afterall...

TMC (talk) 05:49, 17 August 2025 (PDT): It looks like that file is using an encoding that doesn't support Japanese characters. Probably you have it set to something like "Windows-1252". Notepad++ will probably keep using the same encoding when it opens the file, but you can change it to UTF-8 or Unicode. Look for an Encoding option in the Notepad++ menus, or maybe on some toolbar or corner of the screen.