Ack! My bad, very sorry... forgot to make before commiting, very bad habit... Fixed now.Soban wrote:For some reason there's a typo in graphics.c line 22 of the latest commit. It's trivial to fix, but annoying.
Lua Player for PSP
Moderators: Shine, Insert_witty_name
anychance of merging your corrections into the original release with Eboot, so that us fans can enjoy a new game :)nevyn wrote:I sorta dislike rigid movement, so I couldn't help but to add acceleration to your game :P Hope you like it :)indianajonesilm wrote:Hello all! I'm attempting to make an air hockey game.
(Lowser-adapted it while at it, too)
http://ncoder.nevyn.nu/psp/pspairhockey.zip
I recommend using Lowser instead of bundling with your very own eboot. If you install the latest LuaPlayer with the latest Lowser (probably to be released in a userfriendly binary format within a day, unless there's some bug), you can just drop that psp air hockey folder directly from the zip into the Applications folder, and it'll work, with no eboot bundling needed.emumaniac wrote:anychance of merging your corrections into the original release with Eboot, so that us fans can enjoy a new game :)nevyn wrote:I sorta dislike rigid movement, so I couldn't help but to add acceleration to your game :P Hope you like it :)indianajonesilm wrote:Hello all! I'm attempting to make an air hockey game.
(Lowser-adapted it while at it, too)
http://ncoder.nevyn.nu/psp/pspairhockey.zip
Secondly, that game needs a puck before being playable...
-
- Posts: 15
- Joined: Tue Feb 08, 2005 6:36 pm
I'm working on it :)Secondly, that game needs a puck before being playable...
Thank you so much for the acceleration! woohoo! I love it.I sorta dislike rigid movement, so I couldn't help but to add acceleration to your game :P Hope you like it :)
(Lowser-adapted it while at it, too)
Hey thats a good idea. Maybe in a future release. I still have to figure out all this collision detection and motion vector stuff first.would there be hard slap shots that would knock the disc/puck off the table? that could be some interesting play lol
-
- Posts: 1
- Joined: Wed Aug 10, 2005 9:59 pm
- Location: Brisvagas, 'Straya
InputManager library
I'm working on an InputManager library for lua, and I'm currently in the last steps of bug fixing for the new version of lua player. What are peoples thoughts on the interface. I'm open to suggestions
I appreciate any feedback, I'd like to get a nice interface that most everyone is happy with. I'm still tossing up if I should allow for multiple handlers registered to a single event, at the moment there can be only one
I'm working on an InputManager library for lua, and I'm currently in the last steps of bug fixing for the new version of lua player. What are peoples thoughts on the interface. I'm open to suggestions
Code: Select all
The Most Excellent PSP Lua Input Mananager 0.1
Author: James Bowling (mr.snuffle@gmail.com)
Date: 5 Aug 05
ABOUT
In an effort to make some more friendly event driven input management, I've put together this
fairly simple wrapper around the Luaplayer input functions. It allows the user to register
callback functions with different events on different buttons, deregister these events, and
check if a button is currently pressed
TODO
* Add analog stick support when I figure out exactly how I can do that
* Have friendly support for diagonal directions
CONSTANTS
Events:
INPUT_EVENT.PRESS
INPUT_EVENT.RELEASE
Keys:
INPUT_KEY.UP
INPUT_KEY.DOWN
INPUT_KEY.LEFT
INPUT_KEY.RIGHT
INPUT_KEY.SQUARE
INPUT_KEY.CIRCLE
INPUT_KEY.CROSS
INPUT_KEY.TRIANGLE
INPUT_KEY.LTRIGGER
INPUT_KEY.RTRIGGER
INPUT_KEY.HOLD
INPUT_KEY.HOME
INPUT_KEY.START
INPUT_KEY.SELECT
INPUT_KEY.NOTE
INSTALL
Place the InputManager.lua file in the same directory as your script.lua file.
Add:
dofile("./InputManager.lua")
somewhere near the top of your script
FUNCTIONS
void InputManager:register( { inputEvents }, { inputKeys }, eventCallback)
Register a callback handler to a group of events and a group of input keys. The first two
parameters (events and keys) do not need to be tables, they can also just be single values.
IMPORTANT - The eventCallback function MUST have the signature of void eventCallback(event, key)
EXAMPLE
function upHandler(key, event)
if (event == INPUT_EVENT.PRESS)
then
eventStr = "Pressed"
else
eventStr = "Released"
end
print("Up " .. eventStr)
end
InputManager:register( { INPUT_EVENT.PRESS, INPUT_EVENT.RELEASE }, INPUT_KEY.UP, upHandler )
This will register the single up handler function with both a press and release event on
the up button. Something like this would also be okay
function symbolHandler(event, key)
if (key == INPUT_KEY.CROSS) then keyStr = "X"
elseif (key == INPUT_KEY.TRIANGLE) then keyStr = "/\\"
elseif (key == INPUT_KEY.SQUARE) then keyStr = "[]"
elseif (key == INPUT_KEY.CIRCLE) then keyStr = "O"
else keyStr = "unknown" end
print(keyStr)
end
InputManager:register( INPUT_EVENT.PRESS, {INPUT_KEY.SQUARE, INPUT_KEY.CIRCLE,
INPUT_KEY.CROSS, INPUT_KEY.TRIANGLE}, symbolHandler)
*********************
void InputManager:deregister( { inputEvents }, { inputKeys } )
This will remove handlers from specified keys and events. Much like register, inputEvents
and inputKeys can be both tables or single values
EXAMPLE
InputManager:deregister( { INPUT_EVENT.PRESS, INPUT_EVENT.RELEASE }, INPUT_KEY.UP)
*********************
bool InputManager:isPressed(inputKey)
This will check if a key is currently pressed on the PSP.
EXAMPLE
if (InputManager:isPressed(INPUT_KEY.LTRIGGER))
then
-- do some stuff
end
*********************
void InputManager:process()
This needs to be added to the main loop. With out it, nothing will be driving the input
manager
EXAMPLE
while (true) do
processObjects() -- do whatever stuff your lua app is doing
InputManager:process() -- process the input
end
See ya on the chronostream, time jockey!
I wrote a script for generating nightly builds. It builds the latest sources from the repository and makes a nice package with readme and install instructions. Download the latest nightly build
Snuffle: Great! I was going to write something similar myself, so thanks :P I'll look at it tomorrow when I'm less tired...
Snuffle: Great! I was going to write something similar myself, so thanks :P I'll look at it tomorrow when I'm less tired...
Now Lua Player has its own domain: http://www.luaplayer.org/. You can download the new version 0.7. Should be nearly the same like Nevyn's nightly build, but with source code included (perhaps we should add a Makefile target for a release-folder, where anything is copied for a release, but without source, which can be obtained by SVN).
Woah! Cool! :)Shine wrote:Now Lua Player has its own domain: http://www.luaplayer.org/. You can download the new version 0.7. Should be nearly the same like Nevyn's nightly build, but with source code included (perhaps we should add a Makefile target for a release-folder, where anything is copied for a release, but without source, which can be obtained by SVN).
I totally agree with the release part. I imagine that those who download LuaPlayer does it either to play LuaPlayer apps, or write Lua apps. Neither of those targets need the C sources for LuaPlayer. If one is proficient enough to code in C, one is probably proficient enough to obtain the sources via svn. This is the rationale behind the packaging of my nightly build. I really suck at makefiles, but you're welcome to check out my nightly build shell script at ncoder.nevyn.nu/luaplayer-nightly.sh .
Lua make error
While trying to "make" Lua I get the following error:
In file included from graphics.c:2:
/usr/local/pspdev/psp/sdk/include/malloc.h:2: error: conflicting types for `malloc`
I appreciate any help/information.
In file included from graphics.c:2:
/usr/local/pspdev/psp/sdk/include/malloc.h:2: error: conflicting types for `malloc`
I appreciate any help/information.
-
- Posts: 64
- Joined: Fri Jul 15, 2005 11:44 pm
Here was my first LUA program(now works with .7), I just now added USB support so you can run it and write script.
PixelFixer
I had dead pixels and people said that one video that flashes the PSP screen with RGBBW will fix dead pixels, well it does work, but it was too big for 32 mb's so I made a LUA script of a faster thing that works about the same(Actually I wanna slow it down just a little bit... any ideas?).
PixelFixer
I had dead pixels and people said that one video that flashes the PSP screen with RGBBW will fix dead pixels, well it does work, but it was too big for 32 mb's so I made a LUA script of a faster thing that works about the same(Actually I wanna slow it down just a little bit... any ideas?).
Nevyn, I've noticed the new looping on sounds doesn't work for extended periods of time.
I've got 2 sounds in my game, 1 looping and 1 not. After a while I hear the looping one stop.
The looping one always stops after I play the non looping one for the 32nd time if that helps.
A nice idea for the official release would be to enable the usb port by default on the screen that shows when you get an error and that you need to press start to restart.
I've got 2 sounds in my game, 1 looping and 1 not. After a while I hear the looping one stop.
The looping one always stops after I play the non looping one for the 32nd time if that helps.
A nice idea for the official release would be to enable the usb port by default on the screen that shows when you get an error and that you need to press start to restart.
It is a dedicated server with very fast internet connection, much included traffice per month and with all domains it costs about 75 Euro per month, but I'll use it for my company, too, and I'll move my personal webpage to it, so this is no problem. Lua Player will remain for free for ever (it is BSD license, so even when I decide to take it off from the net, what I'll never want to do, it can be copied without problems to Sourceforge etc.).VgSlag wrote:Nice one guys!
Shine, how much did the domain cost; do you want some money towards it?
But I'm not against if someone insists to send me money :-) You can use fb@frank-buss.de at http://www.paypal.com/.
You can always enable it in your script, it should remain enabled after restarting, and calling the enable function when it is still enabled doesn't hurt.VgSlag wrote:A nice idea for the official release would be to enable the usb port by default on the screen that shows when you get an error and that you need to press start to restart.
Enabling it by default is a bad idea, because when you write from USB and later from within the script without disabling USB first (perhaps for a screenshot), the memory stick file system gets corrupted and you have to reformat it. I'll add a warning to the documentation. Reading can be done from both ends and writing from one end, only, is no problem. I didn't tried it, but it should be possible to write to a log file from PSP and displaying it on PC online with "tail -f /yourusbdrive/PSP/GAME/luaplayer/log.txt".
Yes, Mikmod has a limit of how many samples it can play simultaneously. If you play more, it'll start cutting old samples. I marked looping sounds as "Critical" to give it priority, but it doesn't seem to work... I'll have to do some testing. (This problem also implies that old voices aren't stopping correctly...)VgSlag wrote:Nevyn, I've noticed the new looping on sounds doesn't work for extended periods of time.
I've got 2 sounds in my game, 1 looping and 1 not. After a while I hear the looping one stop.
The looping one always stops after I play the non looping one for the 32nd time if that helps.
A nice idea for the official release would be to enable the usb port by default on the screen that shows when you get an error and that you need to press start to restart.
As Shine said, enabling the USB port continuously is a very bad idea, as writing to the stick from two ways WILL corrupt it. (I'm not sure Shine's idea about tailing a log file while the PSP writes to the stick is a good idea, since the computer can write things to the stick without being explicitly told so. Perhaps I'm overly paranoid, but just using another less important memory stick is a simple precaution)
Remember, Lowser has USB disk mode on the L button, so if you have Lowser as the default app running after a crash (as is the standard configuration), you can just click L and fix the script without having to integrate disk mode into your own app. (btw, before I fixed Lowser, I accidently sent USB activation and deactivation once per frame when holding L, which /crashed/ the USB on my computer. Just a warning...)
-
- Posts: 13
- Joined: Wed Aug 03, 2005 9:48 pm
Wedgewars
LuaPlayer is brilliant, it really is. Here's another game I've done (which isn't brilliant, by a mile): Wedgewars - http://www.dcemu.co.uk/vbulletin/showthread.php?t=9124 - sorry, didn't think you could add attachments here.
Thanks for your donation VgSlag! I never thought to make some money with it, the main reason for developing it was the fun for me and for developing my own ideas more easy than with C, but I've added a donation link at the bottom of www.luaplayer.org
Re: Wedgewars
Nice! Too bad you can't win... That, and some terrain, and it'd be absolutely great :) (if you packaged it for Lowser, you wouldn't have to have different installs for 1.0 and 1.5 :P)alex_dsnews wrote:LuaPlayer is brilliant, it really is. Here's another game I've done (which isn't brilliant, by a mile): Wedgewars - http://www.dcemu.co.uk/vbulletin/showthread.php?t=9124 - sorry, didn't think you could add attachments here.
-
- Posts: 13
- Joined: Wed Aug 03, 2005 9:48 pm
Yep, index.lua, and making it quittable. Having an icon.png in the folder will give you a nice icon in the browser, too :)alex_dsnews wrote:Lowser's great too. I tried to get ButtonMatch working with it a few days back but for some reason I couldn't get it to work. I'm too thick, I think.
I'll do a Lowser version for the next release - index.lua, right?
What problems did you have? It /is/ entirely possible that I've done something wrong... ('Cause you're not stupid.)
-
- Posts: 13
- Joined: Wed Aug 03, 2005 9:48 pm
Nev, I thought this might be my fault as I wasn't assigning the sound to a voice, I was just doing:nevyn wrote:Yes, Mikmod has a limit of how many samples it can play simultaneously. If you play more, it'll start cutting old samples. I marked looping sounds as "Critical" to give it priority, but it doesn't seem to work... I'll have to do some testing. (This problem also implies that old voices aren't stopping correctly...)VgSlag wrote:Nevyn, I've noticed the new looping on sounds doesn't work for extended periods of time.
I've got 2 sounds in my game, 1 looping and 1 not. After a while I hear the looping one stop.
The looping one always stops after I play the non looping one for the 32nd time if that helps.
A nice idea for the official release would be to enable the usb port by default on the screen that shows when you get an error and that you need to press start to restart.
As Shine said, enabling the USB port continuously is a very bad idea, as writing to the stick from two ways WILL corrupt it. (I'm not sure Shine's idea about tailing a log file while the PSP writes to the stick is a good idea, since the computer can write things to the stick without being explicitly told so. Perhaps I'm overly paranoid, but just using another less important memory stick is a simple precaution)
Remember, Lowser has USB disk mode on the L button, so if you have Lowser as the default app running after a crash (as is the standard configuration), you can just click L and fix the script without having to integrate disk mode into your own app. (btw, before I fixed Lowser, I accidently sent USB activation and deactivation once per frame when holding L, which /crashed/ the USB on my computer. Just a warning...)
Code: Select all
sound_jump:play()
Code: Select all
sound_jump_playing = sound_jump:play()
Shine, no prob, glad to help.
With Unix you can mount the filesystem read-only, but for Windows I don't know when it wants to write to disk, so using a second memory stick for developing may be a good idea (I do this, too, to avoid losing my Ridge Racer and Mercury savegames :-)nevyn wrote:I'm not sure Shine's idea about tailing a log file while the PSP writes to the stick is a good idea, since the computer can write things to the stick without being explicitly told so.
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
http://haggar.pocketheaven.com/ <- Dr. Mario PSP 0.2
Ye, now with both normal horizontal and vertical mode.
(The vertical screen print was too slow for this one, so I had to use something else that's not so pretty)
Ye, now with both normal horizontal and vertical mode.
(The vertical screen print was too slow for this one, so I had to use something else that's not so pretty)
I made a list of known luaplayer apps and games over at http://ncoder.nevyn.nu/luaplayer/01%20Known%20Apps%20and%20Games.html
If something is missing from the list, mail me at joachimb@gmail.com
If something is missing from the list, mail me at joachimb@gmail.com
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
http://haggar.pocketheaven.com/PixelFixer.zip <- I updated your pixelfixer. No need for backgroundX.png files any more. And to slow it down, just increase the delay value I added. Oh... and I hope you don't mind that I updated the code.DiabloTerrorGF wrote:Here was my first LUA program(now works with .7), I just now added USB support so you can run it and write script.
PixelFixer
I had dead pixels and people said that one video that flashes the PSP screen with RGBBW will fix dead pixels, well it does work, but it was too big for 32 mb's so I made a LUA script of a faster thing that works about the same(Actually I wanna slow it down just a little bit... any ideas?).
Last edited by MikeHaggar on Fri Aug 12, 2005 2:50 am, edited 1 time in total.
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
You forgot ButtonMatch by Alex_dsnews/Alex Carrollnevyn wrote:I made a list of known luaplayer apps and games over at http://ncoder.nevyn.nu/luaplayer/01%20Known%20Apps%20and%20Games.html
If something is missing from the list, mail me at joachimb@gmail.com
Last edited by MikeHaggar on Fri Aug 12, 2005 2:38 am, edited 1 time in total.
I haven't seen that one, what's the URL?MikeHaggar wrote:You forgot ButtonMatch by Alex_ds/Alex Carrollnevyn wrote:I made a list of known luaplayer apps and games over at http://ncoder.nevyn.nu/luaplayer/01%20Known%20Apps%20and%20Games.html
If something is missing from the list, mail me at joachimb@gmail.com