PDA

View Full Version : ONScripter port to MotoLinux


Pantamorph
2009-10-17, 08:06
Hello everyone, I'm new to this forum
I found this nice game called Narcissu and decided to port it to my ROKR Z6 phone. Thanks to lubomyr, we managed to make the port of it's engine (ONScripter), but we encountered some bugs:
1) the text is small, it's unreadable, text is shown without spacebar (example: itwasanothersunny day) and sometimes unknown symbols appear
2) There is a problem when you play the game a bit it gets suspended and at the telnet log it says:
command [mp3fadeout] is not supported yet!!
command [mp3fadeout] is not supported yet!!
suspend
QT Show: 470 requestFocus: Lost, winId:1382
Lubomyr said he tried to switch -DMP3_MAD to DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS but then it needs smpeg so further work is needed in that direction
Anyways I'd really appreciate it if you guys could help me with the text problem
Thanks in advance
Eugene

P.S.
Screenshots from my Z6:
http://img193.imageshack.us/img193/6973/nar1.png
http://img86.imageshack.us/img86/5128/nar2d.png

Message
2009-10-17, 10:19
The font size is controller from the game script, not from the engine. Look up setwindow in the command reference: http://onscripter.denpa.mobi/api/NScrAPI-framed.xml
The spaces disappearing might be related to the use of textgosub (see command reference). Not sure if that's the case here, but I seem to remember a similar problem from when I was working on Tsukihime Fool's Errand... Had to do with differences between NS, ONS and ONS-en.


And just so you know, outputs such as "[commandname] is not supported yet" can most often be ignored. It just means that the command exists in NScripter, but not ONScripter. (Although Mion's more recent versions support the mp3fadeout command.)

Pantamorph
2009-10-18, 07:54
The font size is controller from the game script, not from the engine. Look up setwindow in the command reference: http://onscripter.denpa.mobi/api/NScrAPI-framed.xml

The website doesn't load :(
Can you try to explain simpler, cuz I don't understand what you said :)

zalas
2009-10-18, 08:32
Try http://onscripter.denpa.mobi/api/NScrAPI.xml and see if it loads for you. The framed version doesn't load for me, either. What Message basically said was that you should try setting the font size in the game script itself (this is in either nscript.dat or 0.txt, nscript.dat being a xor-ciphered version of 0.txt). The NScrAPI site will have information on the setwindow command that you might want to use.

Pantamorph
2009-10-18, 09:24
Try http://onscripter.denpa.mobi/api/NScrAPI.xml and see if it loads for you. The framed version doesn't load for me, either. What Message basically said was that you should try setting the font size in the game script itself (this is in either nscript.dat or 0.txt, nscript.dat being a xor-ciphered version of 0.txt). The NScrAPI site will have information on the setwindow command that you might want to use.

You mean this?
setwindow NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,COLOR,NUM,NUM,NUM,NUM
NUM
X-coordinate of top left for text
NUM
Y-coordinate of top left for text
NUM
Number of (full-width) text columns
NUM
Number of text lines
NUM
(Full-width) text font size X
NUM
Text font size Y
NUM
Text spacing X
NUM
Text spacing Y
NUM
Default text speed
NUM
Boldface toggle (0=off/1=on)
NUM
Drop shadow toggle (0=off/1=on)
COLOR
Window color
NUM
Window top left X-coordinate
NUM
Window top left Y-coordinate
NUM
Window bottom right X-coordinate
NUM
Window bottom right Y-coordinate

Pantamorph
2009-10-18, 10:04
How do I open nscript.dat?

Roto
2009-10-18, 10:25
svn export svn://svn.denpa.mobi/onscripter/trunk/nscriptdecode.cpp
g++ nscriptdecode.cpp -o nscriptdecode
./nscriptdecode < nscript.dat > 0.txt

ONScripter can use the resulting 0.txt file just like it can use nscript.dat, so there's not really a reason to convert it back. But if you want to, the same tool works:

./nscriptdecode < 0.txt > nscript.dat

Pantamorph
2009-10-19, 04:28
Sorry for being dumb, I didn't know such an app as OnScripter existed (until now)
But if I compile a newer version of onscripter, will it run Narcissu (Do onscripter sources laid in insani have any game data files in them?)

Roto
2009-10-19, 09:04
ONScripter is just an interpreter. The game script is contained in 0.txt (or nscript.dat) and the images, music, etc. are in the arc.nsa file (or sometimes just present as regular files in the game directory.)

Most games using this system are developed for NScripter, which is the original, but is Windows only and closed-source. ONScripter is an open-source GPL clone of NScripter that has been ported to Linux and Mac OS X in addition to Windows. Furthermore, ONScripter-EN is a fork of ONScripter that adds extensive support for English.

You'll want to get the latest ONScripter-en sources from http://onscripter.denpa.mobi/. Neither Insani nor Haeleth are maintaining ONScripter-en anymore, so the information on their pages are out of date. And yes, current versions of ONScripter-en should run Narcissu just fine.

Pantamorph
2009-10-26, 05:26
Sorry for the late reply, do I have to change setwindow lines
19,149,310,895,1173,1453,2733,4534,5964,7072,8525,9646,10899,11640,11675,11984,12294,13777,15883,17649,19012,20795,23840:
These are the text controling lines, am I right?
Here's Line 19:
menusetwindow 15,18,2,2,0,1,#808080
Others only have setwindow commands

Pantamorph
2009-10-27, 08:26
It may seem weird, but we can't compile uncle mion's onscripter
We managed to compile Ogapee's version, but we can't configure mion's builds
Here's the log for the compilation of mion's onscripter, using Ogapee's Makefile (We didn't change his Zaurus Linux makefile much):
lubomyr@andLinux:/home/z6/onscripter-en-20091010$ make
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS onscripter.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS DirectReader.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS SarReader.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS NsaReader.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ScriptHandler.cpp
ScriptHandler.cpp: In member function `int ScriptHandler::readScript(DirPaths*)':
ScriptHandler.cpp:1217: warning: comparison is always true due to limited rangeof data type
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ScriptParser.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ScriptParser_command.cpp
ScriptParser_command.cpp:1458:2: warning: no newline at end of file
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ONScripterLabel.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ONScripterLabel_command.cpp
arm-linux-gnueabi-g++ -c `sdl-config --cflags` -DLINUX -DPDA -DQWS -DMP3_MAD -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS ONScripterLabel_text.cpp
ONScripterLabel_text.cpp: In member function `int ONScripterLabel::processText()':
ONScripterLabel_text.cpp:962: error: label `notacommand' used but not defined
make: *** [ONScripterLabel_text.o] Error 1
The notacommand label didn't appear in the Japanese builds!

Sonozaki Futago-tachi
2009-10-27, 09:42
Hi Pantamorph,

You'll need to add -DINSANI and -DHAELETH to the DEFS in the Makefile. I imagine that won't be the last error you find...

By the way, are you unable to use the configure script to generate a Makefile? onscripter-en doesn't officially support portable OSes at the moment, but we might be able to work something out, especially if there's someone willing to test builds.

Uncle Mion

Pantamorph
2009-10-28, 05:31
Yeah, I am the MotoMAGX version tester, so I can test these builds (We successfully compiled Insani's build, but Narci crashes cause mp3fadeout isn't supported in the old ONScripter, I'm also working on the fontsize of the game, cuz the text is unreadable. We also ported SMPEG and Tremor libs to try and add OGG support to ONScripter but it seems that here we need to use a newer version of ONScripter to get rid of the mp3fadeout bug) the MotoMAGX and MotoEZX platform compilers sadly aren't supported oficially, what's weird is that Sharp Zaurus and Motorola A1200 have an idenical Processor so porting ONScripter to A1200 went smooth (I'm talking about Insani's version for Narci and Ogapee's sources), while the MAGX platform (Z6, V8, EM30, E8, U9 e.t.c.) needs to be worked on. Anyway, you can contact me via ICQ at 492521434

Pantamorph
2009-10-28, 07:01
By the way, are you unable to use the configure script to generate a Makefile?
Lubomyr's Reply: No, I used the makefile from the Japanese version (P.S. Ogapee's versions had no configure)

Pantamorph
2009-10-30, 09:57
Well What do you know, we compiled it with the 2 parameters you gave us!
Narcissu works better (No hyeroglyphs, text is being shown smoothly, the game runs faster, options menu works better)
Sources sent to you in a PM
Don't share them though cuz I haven't finished working on Narcissu

Pantamorph
2009-10-31, 09:21
Setwindow problem fixed
Screens of Mion's build ported to Z6:
http://img692.imageshack.us/img692/4081/45514630.png
http://img263.imageshack.us/img263/5696/27019773.png
What's left is the nospace problem, I checked textgosub command, not sure it's causing this bug, since this command defines a label to jump to at a mouseclick
Other than that most bugs are fixed and when I manage to fix this one I'll upload a release!

Message
2009-10-31, 09:36
What's left is the nospace problem, I checked textgosub command, not sure it's causing this bug, since this command defines a label to jump to at a mouseclick
If the game uses that command, there is a strange thingie that causes problems... Alright, let me dig into the logs and see if I can figure out what that was.

Pantamorph
2009-10-31, 09:42
what logs do you need?
telnet? Compilation?
Generated log:
../../textinput/framework/engine/common/KbInputFieldAdapter.cpp:ZInputFieldAdapter:260: ZInputFieldAdapter: ok, me=0x9feb0
../../textinput/framework/engine/common/KbEditContext.cpp:KbEditContext:390: register application exit function
setkinsoku: "ЃvЃxЃjЃnЃpЃAЃBЃCЃDЃEЃHЃIЃRЃSЃTЃUЃXЃ[","ЃuЃwЃiЃmЃo"
hide splash: -1
map framebuffer at 0x4358d000 (size 262144)
landscape mode
Quitting...
~SDL_QWin(): chau
../../textinput/framework/engine/common/KbEditContext.cpp:appExit:358: client application is exit
../../textinput/framework/engine/common/KbEditContext.cpp:saveData:465: data is not dirty

Message
2009-10-31, 10:50
Heh, no, I meant my own IRC logs. I discussed the issue in some channel somewhere.

I've found it now. As it turns out, the issue I was thinking of wasn't your problem at all, it was something entirely different. My apologies. I guess I'll post the stuff here anyway, for whoever's interested:


The problem was that using the textgosub function breaks out of halfwidth (one-byte) text mode:
[14:48] <Message> The command doesn't reinitialize the halfwidth interpretation if it's called from the middle of a text line (say, during a @ waitstate instead of a \ waitstate).


As an example, let's take this script:
`"Uhuhu.@ Yes, this is Charon's ferry terminal.@ I have been waiting for you!"\
`"Hm. I am wrapped in ominous thoughts."\
You would expect the game to render this as follows:
"Uhuhu. Yes, this is Charon's ferry terminal. I have been waiting for you!"
And the next page:
"Hm. I am wrapped in ominous thoughts."

In reality, when using textgosub to define a custom mouseclick function, it was rendered as follows:
"Uhuhu."Hm. I am wrapped in ominous thoughts."
What happened is that because the textgosub breaks out from halfwidth mode, all the text after 'uhuhu' was read as commands, not game text. Unable to make sense of the commands, ONS-en just skipped it and continued with the next line of game text. I had to reopen halfwidth mode with `:
[14:49] <Message> So I just started a new line after the @ waitstate, starting with a new ` char. Normally this would make the the newline also show ingame, but apparently texec makes ONS ignore the newline.



So the script ended up looking like this:
`"Uhuhu.@
` Yes, this is Charon's ferry terminal.@
` I have been waiting for you!"\
`"Hm. I am wrapped in ominous thoughts."\

Pantamorph
2009-11-02, 04:31
Oh well, guess I'll try to fix it myself
Anyway, this bug doesn't remove any letters so pretty much the text is readable and I'm eager to make a beta (For testing the fontsize & stuff)
So all MotoLinux users won't wait long

Sonozaki Futago-tachi
2009-11-02, 05:50
Oh, with textgosub games, you can deal with the issue Message mentions by surrounding the @s with ``s:
`"Uhuhu.`@` Yes, this is Charon's ferry terminal.`@` I have been waiting for you!"\

Pantamorph, can you show one of the script text commands that make the no-space bugs? I'd like to see what's going on.

Thanks,
Uncle Mion

Pantamorph
2009-11-02, 06:13
The whole text is featured without spaces
Here's some example sentences:
`"My health was never particularly good, sure..."\
`But I was able to attend primary school like anyone else.
`In the summer holidays I was able to play till the sun burnt me black.\
`It was June, just after I entered middle school.@
`
`It was just before the midterm tests.\
`It was the day after I ordered a swimming costume for the summer.
`That was the first day I was admitted to hospital.\
`It was a cold, unpleasant, drizzly day.\
`Shrouded by the rainy sky, murky, white, and damp.\

Pantamorph
2009-11-03, 02:47
Beta's out
You can find it here (http://motoezx.at.ua/load/2-1-0-43)
Support topics:
Motofan (http://forum.motofan.ru/index.php?showtopic=168799) (Russian)
ModMyMoto (http://www.modmymoto.com/forums/showthread.php?p=3865186) (Spanish)
Sorry I didn't post this yesterday :(

Sonozaki Futago-tachi
2009-11-03, 04:30
Aha! I finally figured it out. You need to add -DENABLE_1BYTE_CHAR to your DEFS in the Makefile.

Sorry I didn't notice that earlier ^^;

Uncle Mion

Pantamorph
2009-11-03, 06:02
OK, I'll try it
Thanks!

Pantamorph
2009-11-04, 04:53
It worked, what still needs to be done is autohide, though I don't know if we'll succeed with that!