Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

ONScripter for PSP

From GameBrew
Revision as of 06:31, 29 August 2024 by HydeWing (talk | contribs) (Created page with "{{Infobox PSP Homebrews |title=ONScripter for PSP |image=onscripterforpsp.png |description=Port of ONScripter, an open-source implementation of NScripter. |author=tormtorm |lastupdated=2011/01/11 |type=Game Engine |format= |version=20110111_psp |license=GPL-2.0 |downloadraw=[https://dlhb.gamebrew.org/psphomebrew/onscripterforpsp.7z ONSforPSP] - [https://dlhb.gamebrew.org/psphomebrew/onscripter_tools.7z Tools Download] |website=https://web.archive.org/web/20100307140242/...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
ONScripter for PSP
Onscripterforpsp.png
General
Authortormtorm
TypeGame Engine
Version20110111_psp
LicenseGPL-2.0
Last Updated2011/01/11
Links
ONSforPSP - Tools Download
Website

Port of ONScripter for the PSP. ONScripter (O-N-Scripter) is an open-source implementation of NScripter, a game creation engine that significantly contributed to the rise of visual novels in Japan.

NScripter was widely adopted by developers to create many influential titles in the genre. Some notable examples include Tsukihime (月姫) by TYPE-MOON and Mizuiro (みずいろ) by Nekonekosoft.

User guide

Binary and tools:

Some of the tools in _tools.7z (see the author list in authors.txt):

  • For extracting/repacking arc:
    • onscripter-tools_win.zip (sardec.exe, nsadec.exe)
    • nsaed2.zip
    • nscr_sdk.zip (nsaarc.exe)
    • crass-0.4.14.0.zip
    • susie347b.lzh (+ spi_nsa006.zip plugin)
  • Other tools:
    • onscripter-default_icon_psp.zip (default icons set)
    • smjpeg4.zip (for creating mpg)
    • nsdec.zip (to decrypt nscript.dat)
    • ver9.1.lzh (font file)

Folder structure

ms0:/PSP/GAME/ONS/

  • EBOOT.PBP
  • 0.txt or nscript.dat (script file)
  • arc.nsa or arc.sar (archive for image, music, etc. converted for PSP)
  • default.ttf (TrueType Fonts for Windows that support Unicode)
  • ons.ini (configuration file)
  • additional folder with BGM or movies (e.g. cd/Track01.xxx, cd/Track02.xxx, cd/Track03.xxx... cd/Track14.xxx)

Preparing game data

Supported format:

  • Resolutions - 320x240, 360x270, 384x288, 480x360
  • Image - JPG, BMP, PNG
  • Audio - OGG, MP3, WAV
  • Video - MPG

If there is a arc.nsa / arc.sar, extract it with tools such as nsadec.exe / sardec.exe, crass-0.4.14.0 or Susie+NScripter Susie plugins. (See also Resources section for game specific converters.)

The images can be resized and converted to JPG using FastStone Image Viewer. Keep the aspect ratio according to the game’s original resolution and PSP’s display limit (e.g., 4:3 or 16:9). For instance, if the game's resolution is 800x600 (4:3) and you would like to resize to 360x270, you would scale down the original images to 45% of their sizes. (In FastStone Photo Resizer, check Use Advance Options > Resize In Percentage).

Sometimes there may be slight alignment issues with images like character sprites due to decimal points in the scaling percentage (e.g. when converting from a resolution of 640x480 to 360x270). To avoid these issues, try to choose a resolution that result in whole number scaling percentages whenever possible. (see notes below)

Also, the icon files (i.e. cursor1.bmp) can become distorted when resized, instead you can use the default icons set (available in 13x13 and 15x15), just replace the existing icon files with these.

For the audio files, OGG with a sampling rate of 44,100 Hz is recommended. Use a bitrate between 64kbps and 80kbps. Videos can be converted using smjpeg4.zip (require ffmpeg.exe).

Once you've converted all the files, repack them back into arc.nsa with tools such as nsaarc.exe or nsaed.exe, make sure to keep the same folder arrangement as you had before converting.

If the script file is a nscript.dat, decrypt it with Yet Another nsdec into result.txt. Rename it to 0.txt. Open it with a text editor and edit the file extensions in 0.txt to match the new format (e.g., .mid to .ogg, .bmp to .jpg, if you are using the default icons set, keep those in .bmp). If the game doesn't have arc files, you can still pack the assets into arc.nsa, and then write nsa on a single line in the 0.txt. Refer to Section 07 from this tutorial for more details. (If you have video file, you will also need to update the 0.txt file so it can read them.)

Finally, modify ons.ini to configure the settings for ONS. Make sure you use the correct settings (i.e. RESOLUTION= is the same as the image size), otherwise the image may not display properly.

Notes:

  • If you notice vertical lines appearing next to the character sprites, try adding a 2px white right margin to the right side of the sprites.
  • Alternatively you can try using the ONScripter Multi Converter (an Image, audio and scenario converter for ONSforPSP).

ons.ini

If ons.ini is missing or has typos, default settings are applied:

RESOLUTION=320
SCREENSIZE=ORIGINAL
SCREENBPP=16
CPUCLOCK=222
FONTMEMORY=OFF
ANALOGKEY=ON1
CURSORSPEED=5

Settings:

  • RESOLUTION=320/360/384/480/640/XXX
    • Sets the screen resolution width. Higher resolutions may slow down performance.
    • 320: 320x240 (QVGA)
    • 360: 360x270 (PSP)
    • 384: 384x288 (PSP2)
    • 480: 480x360 (PSP2)
    • 640: 640x480 (VGA)
  • SCREENSIZE=ORIGINAL/NORMAL/FULL
    • ORIGINAL: Displays in original size.
    • NORMAL: Displays at maximum size while maintaining aspect ratio.
    • FULL: Displays at maximum size, possibly distorting aspect ratio.
  • SCREENBPP=15/16/24/32
    • Sets the color depth of images. Higher values increase color quality but use more memory.
  • CPUCLOCK=133/166/222/266/333
    • Sets the CPU clock frequency in MHz. Higher values increase processing speed but drain the battery faster.
  • FONTMEMORY=OFF/ON
    • OFF - Accesses default.ttf from the system for each text display.
    • ON - Loads default.ttf into memory (reduce system access but increase memory usage).
  • ANALOGKEY=OFF/ON1/ON2
    • OFF: Disables analog key functionality.
    • ON1: Enables shortcut keys; allows key binding changes.
    • ON2: Displays and allows cursor movement with adjustable speed.
  • CURSORSPEED=1 ~ XXX
    • Sets cursor movement speed when ANALOGKEY=ON2.
    • The value represents pixels moved per analog key response. Higher values increase speed but reduce precision.
  • SAMPLINGRATE=11025/22050/44100
    • Sets the audio sampling rate.
  • CHANNELS=1/2
    • Sets the number of audio channels.
  • Key Bindings:
    • Change key bindings with SETTING=VALUE, where VALUE corresponds to SDL keyboard values. Examples:
    • TRIANGLE=
    • CIRCLE=
    • CROSS=
    • SQUARE=
    • DOWN=
    • LEFT=
    • UP=
    • RIGHT=
  • Key Value:
    • 27: Open menu or cancel
    • 13: Confirm selection or advance text
    • 32: Advance text only
    • 305: Skip text while holding down
    • 111: Toggle page display
    • 115: Switch to skip mode (skip already read text)
    • 274: Move to next choice
    • 273: Move to previous choice
    • 48: Toggle automode mode (only if automode or mode_ext is set)
    • 97: Change text display speed (slow > normal > fast)
    • 276: View backlog (only if the usewheel command is set in the script)
    • 275: Advance in backlog

Note: Key settings for Analog are only active when ANALOGKEY=ON1.

Resources

Controls

Circle - Return (Confirm, Advance text)

Cross - Space (Advance text)

Square - Ctrl (Hold to skip text)

Triangle - ESC (Menu)

L - O (1 Page On/Off)

R - S (Skip On/Off)

Down/Right - Move to next choice

Up/Left - Move to previous choice

Start - Change text display speed

Select - A (Automode On/Off)

Screenshots

onscripterforpsp.png

onscripterforpsp2.png

onscripterforpsp3.png

onscripterforpsp4.png

onscripterforpsp5.png

Credits

Original by し〜くる氏 (shinshin319): ぼくだけのちいさな世界

Updated by すとーむ氏 (tormtorm): 霧雨の降る日に

External links

Advertising: