All Functions Modules Pages
ONElua Vita Documentation

Version 3R1

Actually ONElua Vita has the following main features:

  • ONElua Vita 3R1
  • Ported to be 100% compatible with taiHEN and use the maximum of functions.
  • Handling peripherals:
    • Physical buttons or controls.
    • Camera (Front and back).
    • Motion (Accelerometer, gyroscope).
    • Touch (Front and back).
  • Added the module 'thread' & 'channel', which allow ONElua to run multiple processes.
  • Improved audio player, now plays MP3, OGG, WAV formats, and plays from sources on the network.
  • In full access mode, the "app0:" partition is removed, and added support writing on the route of the app ("ux0:/app/<ID>").
  • It allows to enable unsafe or total mode on the console os.master().
  • It allows to know access mode in the console (Safe or Unsafe) os.access().
  • Added the ability to go to 'LiveArea' without closing the application or press the 'PS' os.golivearea().
  • Added the ability to update or rebuild the 'LiveArea' database os.updatedb() & os.rebuilddb().
  • Added the possibility of reload the config.txt from taiHEN os.taicfgreload().
  • Added the possibility of Install/Update/Uninstall CustomThemes of 'LiveArea'.
  • Added ONEdebugger - Real-time debugger errors in your scripts.
  • Optimization of our Callbacks and the possibility to stop or abort processes in the callback, check the Callbacks section for more information..
  • Optimization of the files module (Please check our Documentation).
  • Added possibility to Install/Update/Uninstall Homebrew's from folder and in vpk format.
  • Updated function game.info(), now get data of .sfo, eboot.pbp or VPKs/ZIPs.
  • Added the possibility to load maps (tiles) and draw.
  • Added the possibility to load ttf or pgf fonts.
  • Added the possibility to load a default font: onefont.pgf if there alongside our EBOOT.BIN, otherwise load the default font. Simply place the source properly renamed onefont.pgf and thus the eboot of ONElua can start our Homebrew with this default Font.
  • Added the Lua Bit library that allows level operations bit by bit.
  • Added several 'PATCH' to extend the syntax of lua, examples:
    • C Type operations: "sum: +=, subtraction:-=, multiplication: *=, division: /=, power: ^=, mod: %=, different: !=, division does not float: \"
    • C bit operations: "and: &, or: |, not: ~, shift left: <<, right shift: >>"
    • Operations continue, "skips a cycle", in any loop.

Introduction

ONELua is a multiplatform project designed to facilitate programming for both programmers and those who are not, with the arrival of Henkaku by Team Molecule, finally vita was accessible and any user could use Homebrew's, at that time we decided that it was time to port ONElua and create a full version for PlayStation Vita.

Because it is still in the early vitasdk, lack of samples, time required to perform all the coding and testing personally, so the first version comes with such a delay from the onset of henkaku.

Here are the main functions of ONElua for PSP but of course, with new and special functions for PSVita.

Installation

  1. Download the executable ONElua for Vita. Both the executable These documents are updated as soon as functionalities are added, so it is Advisable to use only our links.
  2. Inside the package you will download contains the executable application packaging and ONEmaker That is responsible for creating the vpk for developed application.
  3. Inside the ONEmaker folder is a folder called homebrew within this folder should place the most recent Eboot.bin of ONElua Vita, as well as any files you want to include in the project. In this same folder to place a file called script.lua, which will be the basis of any project.
  4. Once you have all your files ready project, you must run the packer.bat is in ONEmaker, this will prompt a title for your project (This is the area visible in the live legend), then it will prompt an ID this must be exactly nine alphanumeric digits in mayus, once inserted both fields, a new vpk with the title you entered is created, that is the homebrew completed.
  5. For more detailed installation instructions VPK homebrew's in Henkaku visit page official .
Warning
Whenever you work with scripts is advisable to ensure that they are encoded in UTF-8, otherwise special characters (accents and ñ for example) are not displayed.

Considerations of ONElua

As an information note, this documentation will not find information on using Lua own functions (such as string module functions, math, io, etc), only the functions of the interpreter. For more information about Lua functions, visit the page official .

Constants

Many features of ONElua have constant for ease of use. These constants have an associated numerical value (indicated in the documentation for each function) so it is irrelevant use the constant or its numeric value directly.

By convention, ONElua constants are defined as __ NAME (two underscores at the beginning and in upper letters).

Callbacks

ONElua has several callbacks, which are nothing but functions which themselves are defined, they are automatically executed in certain tasks that block script execution. To use a callback is only necessary to define a function with the appropriate name (see list below) and in writing the code to be executed. Callbacks are not designed to run very complex code, only the console does not seem dead while performing these tasks.

Some callbacks as onExtractFiles, onInstallApps and onNetGetFile, have the option of aborting the process being done, by returning a numeric value 0.

These are the available callbacks:

  • onDebug(msg) Executed when an error occurs in your script, to display a custom error.
    • msg: The error message generated for lua.
  • onCopyFiles(size, written, name) Executed when files are copied using files.copy().
    • size: File size (bytes).
    • written: written bytes.
    • name: Filename.
  • onDeleteFiles(name) Executed when files are delete using files.delete().
    • name: Filename.
  • onAppInstall(step, size_argv, written, file, totalsize, totalwrittent) Its executed whenever a .VPK is installed with the function game.install().
    • step: Estado en el que se encuentra el callback:
      • 1: Initial state getting ready to search dangerous files in the vpk.
      • 2: In this state there was dangerous files found in the vpk and is waiting for user response.
      • 3: In this state gets ready to extract the vpk.
      • 4: In this state gets ready to install the vpk on the system.
    • size_argv: Is the value returned when dangerous files are present in the vpk: 1 for unsafe 2 for dangerous.
    • written: written bytes.
    • file: Filename.
    • totalsize: Total size in bytes to unpack.
    • totalwritten: Total bytes written so far.
  • onScanningFiles(name, uncomp_size, offset) Se ejecuta cuando se escanea archivos .ZIP/.VPK con la función files.scan().
    • name: Filename.
    • uncomp_size: Uncompressed Size in bytes.
    • offset: Position of the file inside the .ZIP/.VPK
    • unsafe: Determines if a vpk is flagged as: error or can not be checked (-1), safe (0), unsafe (1) or dangerous (2).
  • onExtractFiles(size, written, name, totalsize, totalwritten) Executed when files are uncompresed using files.extract() or install a vpk with the function game.install().
    • size: File size (bytes).
    • written: written bytes.
    • name: Filename.
    • totalsize: Total size in bytes to unpack.
    • totalwritten: Total bytes written so far.
  • onCompressZip(name) Se ejecuta al Comprimir archivos con la función files.makezip().
    • name: Nombre del archivo a comprimir.
  • onNetGetFile(size, written) It runs when a network file is downloaded with the function http.getfile().
    • size: File size in bytes (if size can't be detected, it will return 0).
    • written: written bytes.
Note
  • The args of onExtractFiles are not referred to the whole compressed file, but each file inside it.
  • The number and/or name of the callback arguments don't need to be the same as listed, however, the callback name must be exactly the same.
Warning
The callbacks don't update the screen, so you need to call manually screen.flip() to avoid crashes when using text or images in your callbacks.

Legal

Copyright © 1994–2014 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.