Results 1 to 10 of 10

Thread: Lua for PSP, or: writing games the easy way without compiler !

                  
   
  1. #1
    Won Hung Lo wraggster's Avatar
    Join Date
    Apr 2003
    Location
    Nottingham, England
    Age
    52
    Posts
    139,544
    Blog Entries
    3209
    Rep Power
    50

    Default Lua for PSP, or: writing games the easy way without compiler !

    <a href="http://forums.ps2dev.org/viewtopic.php?t=2682" target="_blank" >Shine</a> has posted this news on the <a href="http://forums.ps2dev.org/viewtopic.php?t=2682" target="_blank" >PS2Dev Forums</a>:

    <BLOCKQUOTE>I've compiled Lua for the PSP and ported my Snake to it (see below). It is my first Lua program, so it may look not as elegant as it would be possible with this nice language, but at least it is 237 lines only, compared to the 551 lines of the old C program.

    One of the main advantages is, that you just need to edit the script.lua program on the memory stick, and after restarting the game, it will be compiled on-the-fly on the PSP, without any compiler on your PC, you need just a text editor! I've integrated a PNG loader, so you can write your own games with it, by changing the script.lua and copying all your PNGs to the game directory. And important for newbies (and sometimes for me) : It doesn't crash (or at least it should not), but if you pass a null-pointer to a function, you'll get a nice error message, with the line in the script, which caused the error. </BLOCKQUOTE>

    More info at the link above.

  2. #2
    DCEmu Newbie watoto's Avatar
    Join Date
    Jun 2005
    Posts
    63
    Rep Power
    0

    Default

    cool.do you know where i can find more simple example apps like the snake one?

  3. #3
    DCEmu Legend shadowprophet's Avatar
    Join Date
    May 2005
    Location
    IFeedOffYourFearS
    Age
    47
    Posts
    3,102
    Rep Power
    95

    Question hmmm

    Im gonna figure this out. it seems a whole lot eaiser then borland c++
    For some reason tho. I cant get it to make file.however thats probibly because im doing somthing wrong.

    im gonna figure this out and then im gonna make the game I always wanted but never got to see. and im not gonna say what it is till im done cause this ideas to good to be stolen from me.

    Baised on how long I figure it will take me to figure out what im doing wrong and then to create the game from random sprite images im gonna just snatch somwhere off the net ( So Sue me!- whos got the time to build the sprites and music from scratch and create the game as a one man group in a single life time?!) I figure I should have a pretty kick ass snes type rpg in about (six months)lol. Then im gonna post it up here for everbody

    Again I dont want to hear Jack crap about the Borrowed sprite images and music from existing Snes games off peoples sites Cause if others sites have them there alerady stolen anyway,___ My Game Will see the light of day___

    I cant wait to figure this out and sink my teeth into this project

    Update. I really like this program. I found out what I was doing wrong. Ive altered the snake program. Made some changes. only to find out I have a (LOT) to learn. Im Wondering tho can i just go crazy n code anyting I wish with this, If I knew how? or Am I restrected to simple snake and tetris type games ?

    I know that no coder wants to take time to answer a newbes questions. but I really want to learn this so I can learn to code better. I just need to know. Is this program a step in the right direction for an aspireing coder? (seeing as I only have borland c++ as an alternitive and its an old version that I truely disslike). or am I just waisting my time With this new program?

    *Sigh I must be the only person useing this

  4. #4
    Now with Blast Processing! Kaiser's Avatar
    Join Date
    Jun 2005
    Location
    CANADA
    Age
    34
    Posts
    3,079
    Blog Entries
    3
    Rep Power
    50

    Default

    [QUOTE=shadowprophet]im gonna figure this out and then im gonna make the game I always wanted but never got to see. and im not gonna say what it is till im done cause this ideas to good to be stolen from me.[QUOTE]

    I look forward to your game Shadowprophet.


    This is neat tool. i'll fiddle with it when I learn a little more about coding. I'm to much of a noob now.

  5. #5
    DCEmu Legend shadowprophet's Avatar
    Join Date
    May 2005
    Location
    IFeedOffYourFearS
    Age
    47
    Posts
    3,102
    Rep Power
    95

    Thumbs up thanx kaiser

    you just became my alpha release tester. If your interested? as soon as I get it up and going (I still dont know when that will be but im working on it even now) I will send it to you. Maybe you can give me some ideas on how to make it better before I release it This is my first game for the psp. And I want it to be perfect. You dont happen to know where one can find a large source of online game sprites do you ?

    lol So far just for fun ive tricked out that little snake game. now its got a ff1 character instead of a snake. and i replaced the apple and fly pngs with some interesting pics. Im still trying to figure out how encode music. What would be ultra helpful was if I could find some game source archives for this thing. see how the pros do it. but I will figure it out in time.

    But you can bank on my fnishing this game. Ive always told my self if I ever do a game . that it would be this one. This isnt an idea that just came to me .Ive literaly been stewing it over for years. I Already have the story worked out and everything. This is gonna bring tears to peoples eyes when its done (if) i can pull this off. And ive made up my mind. It is happening

  6. #6

    Default

    I'm cross-posting here, sorry, but this Lua port is fantastic. I managed this in just over an hour. With beer.

    If this doesn't seriously shake up the amateur homebrewing, I don't know what will.

  7. #7
    DCEmu Newbie watoto's Avatar
    Join Date
    Jun 2005
    Posts
    63
    Rep Power
    0

    Default

    agreed.i never coded in my life and i even i'm starting to get to grips with it just by reading some basic tutorials over at the lua website.

    also the fact you can just edit the file directly on the mem stck removes any excuse to start coding,like,now.

    all i need now are some more game source codes just to compare them around and study them,so,people,keep them games a coming

  8. #8
    DCEmu Newbie ProTH's Avatar
    Join Date
    Jul 2005
    Posts
    12
    Rep Power
    0

    Default

    Until last evening I'd never touched Lua. But I've used Basic and C++ a lot over the years, so it was very easy to get into by looking at a few tutorials and the code for Snake and Button Match. By the time I went to bed (admittedly ~4 AM) I'd finished porting a simplistic gag of a QBasic game called "Dating Horror" to Lua. There were a few things that didn't work quite properly or worked better being turned into functions, but for the most part I could simply go line by line and make minor changes to the syntax. For instance this

    Code:
    RANDOMIZE TIMER
    FOR x = 1 TO 10
            IF RND > .5 THEN
                    zombie(x) = 1
    became

    Code:
    math.randomseed( os.time() )
    for x=1,10 do
            if math.random() > .5 then
                    zombie[x] = 1
    End result can be found here, but it's a really simple project.


    I do wish there was a decent guide to what all functions are available. For instance there's a printDecimal used in several of these programs, but as far as my searches can tell that's not a standard Lua thing. Can similar things be done with strings without guessing and checking? The guy who ported Lua has included PNG support and blitImage. What else is hidden in there? But then, this is just a pre-release version anyway, so hey.

  9. #9

    Default

    I think the full (or at least, better) release of Lua is due this coming weekend, hopefully Shine will document more of the functions.

    PrintDecimal is useful for scores (as I used it for) but as far as I can see you can't position strings on screen in the same way, which is a shame.

    It's still fantastic, though, even as it is.

  10. #10

    Default

    a guide for the novice would be awesome. Maybe from a simple program that outputs text to the screen, to adding a background, and input functions. I have used BASIC and Pascal in the past, but on a very limited basis.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •