Seite 44 von 342 ErsteErste ... 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 94 144 ... LetzteLetzte
Zeige Ergebnis 1.291 bis 1.320 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Zitat von Grimfate126 if the name is somethin like blah.txt then just simply rename it to blah.lua windows may ask ...

  
  1. #1291
    QJ Gamer Blue
    Points: 4.506, Level: 42
    Level completed: 78%, Points required for next Level: 44
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    75
    Points
    4.506
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    if the name is somethin like blah.txt

    then just simply rename it to blah.lua

    windows may ask you that is may not work if u chage the file extension, but ignore that.

    Thats what I did but its still a text document.



  2. #1292
    Points: 11.498, Level: 70
    Level completed: 62%, Points required for next Level: 152
    Overall activity: 50,0%

    Registriert seit
    Dec 2005
    Ort
    LBC
    Beiträge
    516
    Points
    11.498
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    same thing. it still doesnt work, heres my current code:

    thanks for all ur help!

    ooo sorry change

    screenrint(130, 100, money_value[1], b)
    screenrint(130, 150, money_value[2], b)

    to

    screenrint(130, 100, money_value[a], b)
    screenrint(130, 150, money_value[n], b)

    that should be giving you two different random money values. what is it you're trying to accomplish?

    i think to get rid of scientific notation you would just use

    string.format("%d", moneyvalue[a])

    instead
    Geändert von califrag (04-03-2006 um 07:04 PM Uhr)

  3. #1293
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von califrag
    ooo sorry change

    screenrint(130, 100, money_value[1], b)
    screenrint(130, 150, money_value[2], b)

    to

    screenrint(130, 100, money_value[a], b)
    screenrint(130, 150, money_value[n], b)

    that should be giving you two different random money values. what is it you're trying to accomplish?

    i think to get rid of scientific notation you would just use

    string.format("%d", moneyvalue[a])

    instead
    me along with 2 other pepps are workin on a deal or no deal trye game. so this functions is supposed to assign each case a money value. i put the print thing just to check it. but the math.random thing for variable "a" keeps its value, so every time it starts, each case has the same money. basically, i need it like this:

    1. a is a random number from 1 to 26.

    2. when n is increased by one, "a" now equals ANOTHER number from 1 to 26, and so on, besides the number that has already been chosen.

    sry if i sound confusing
    Geändert von Grimfate126 (04-03-2006 um 07:50 PM Uhr)
    --------------------------------------------------------------------------------------

  4. #1294
    QJ Gamer Blue
    Points: 4.506, Level: 42
    Level completed: 78%, Points required for next Level: 44
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    75
    Points
    4.506
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Never mind I fixed it. My mistake
    Geändert von MrBoots (04-03-2006 um 10:42 PM Uhr)

  5. #1295
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Ok, so my problem IS my source code then, here:

    Code:
    blue = Color.new(0,0,255)
    screen:print(200, 130, "My name is Code-Zero!", blue)
    screen.flip()
    while true do
    screen.waitVblankstart()
    end

  6. #1296
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von code-zero
    Ok, so my problem IS my source code then, here:

    Code:
    blue = Color.new(0,0,255)
    while true do
    screen.waitVblankstart()
    end
    Just a quick guess before i start coding, try this:
    Code:
    blue = Color.new(0,0,255)
    while true do
    screen:print(200, 130, "My name is Code-Zero!", blue)
    screen.waitVblankstart()
    screen.flip()
    end
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  7. #1297
    Points: 11.498, Level: 70
    Level completed: 62%, Points required for next Level: 152
    Overall activity: 50,0%

    Registriert seit
    Dec 2005
    Ort
    LBC
    Beiträge
    516
    Points
    11.498
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    me along with 2 other pepps are workin on a deal or no deal trye game. so this functions is supposed to assign each case a money value. i put the print thing just to check it. but the math.random thing for variable "a" keeps its value, so every time it starts, each case has the same money. basically, i need it like this:

    1. a is a random number from 1 to 26.

    2. when n is increased by one, "a" now equals ANOTHER number from 1 to 26, and so on, besides the number that has already been chosen.

    sry if i sound confusing

    dude.. well.. i couldn't figure out how to do it from your code.. so I just wrote the code myself.. i understood what you meant.. just look at the attached script file... basically it builds a table of case numbers, sets a default case, removes it from the table, then each time "x" is pressed it selects a random case from the ones which are left, and then sets a new value for it... just download the script file and the eboot and test it out... pretty it up with some images and let me know how it works out for you!
    Angehängte Dateien Angehängte Dateien
    Geändert von califrag (04-04-2006 um 12:51 AM Uhr)

  8. #1298
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von califrag
    dude.. well.. i couldn't figure out how to do it from your code.. so I just wrote the code myself.. i understood what you meant.. just look at the attached script file... basically it builds a table of case numbers, sets a default case, removes it from the table, then each time "x" is pressed it selects a random case from the ones which are left, and then sets a new value for it... just download the script file and the eboot and test it out...
    Wow you took the liberty to go
    code a version yourself to help someone out :razz: .
    You good man deserve an award and maybe 1000 Points?
    If you want to claim your Award PM me saying so :icon_wink .
    Dont worry, this aint no scam. c5cha7 is looking for good
    people in the scene to donate my points to .
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  9. #1299
    Points: 11.498, Level: 70
    Level completed: 62%, Points required for next Level: 152
    Overall activity: 50,0%

    Registriert seit
    Dec 2005
    Ort
    LBC
    Beiträge
    516
    Points
    11.498
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von c5cha7
    Wow you took the liberty to go
    code a version yourself to help someone out :razz: .
    You good man deserve an award and maybe 1000 Points?
    If you want to claim your Award PM me saying so :icon_wink .
    Dont worry, this aint no scam. c5cha7 is looking for good
    people in the scene to donate my points to .
    I appreciate the offer but really I did it because I think it's a neat idea and it was a good ten minute exercise for me to learn how to remove and add to a table ;D I honestly would probably not use the points even if you gave them to me, but thanks anyways! Did you test out that script? did it work for you like it needs to?

  10. #1300
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Nope, didn't work, it just says error: no script file found

  11. #1301
    Points: 11.498, Level: 70
    Level completed: 62%, Points required for next Level: 152
    Overall activity: 50,0%

    Registriert seit
    Dec 2005
    Ort
    LBC
    Beiträge
    516
    Points
    11.498
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    well i'm at least able to get it running.. what firmware version are you on?

  12. #1302
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von califrag
    I appreciate the offer but really I did it because I think it's a neat idea and it was a good ten minute exercise for me to learn how to remove and add to a table ;D I honestly would probably not use the points even if you gave them to me, but thanks anyways! Did you test out that script? did it work for you like it needs to?
    lol okay then,
    also code-zero i think you may need to change your lua cmd file.
    Right click on the index.cmd and edit it to this:
    --
    luaplayer index.lua
    PAUSE.
    --
    Note that your file has to be called index.lua if you name it that
    in the cmd :icon_wink .

    Edit: Unless your on PSP lol .
    (I Always try the emulator)
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  13. #1303
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Edit:

  14. #1304
    Points: 11.498, Level: 70
    Level completed: 62%, Points required for next Level: 152
    Overall activity: 50,0%

    Registriert seit
    Dec 2005
    Ort
    LBC
    Beiträge
    516
    Points
    11.498
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    it has a wierd problem when resetting the case numbers and starting a new game but the idea is there.. i'll play with it some more and update the attachment before i go to bed

    EDIT: I fixed it and it now works fine and even tells you which cases are left to choose from. i updated the attachment on the previous post.
    Geändert von califrag (04-04-2006 um 12:52 AM Uhr)

  15. #1305
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    error: something about vblankstart nil value

  16. #1306
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Ok, so I managed to get 1 script working on the psp (wasn't mine) and for some reason this is the only downloaded script that has worked on my psp. It was a pickup line generator,

  17. #1307
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    what version of luaplayer do you have?
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  18. #1308
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    0.14 for fimware 1.00 (I'm using bock eloader)

  19. #1309
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    hmm k, i dont really know how eBock and stuff works. So do you need to have the 1.00 version with eBock? Because maybe thats the problem. Also Can you use higher versions of luaplayer, like 0.16? Thats the one have, and everything works and i know there's a 1.00 version of that aswell.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  20. #1310
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    I'll try version 0.16 and report in then, it's wierd though, that only certain scripts are playing correctly.

  21. #1311
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    yeah thats what got me thinking about the version you have. Maybe the others use commands 0.14 doesnt support.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  22. #1312
    QJ Gamer Blue
    Points: 4.272, Level: 41
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Northampton, England
    Beiträge
    59
    Points
    4.272
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Nope, didn't fixit, I'll try using the tutorial to change it to a stand alone eboot

  23. #1313
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    hmmmm, what i've done which absolutely rocks is i got the eloader on my 32mb and my 1gb card and luaplayer v0.17DK2 on my 32 mb and luaplayer v0.16 on my 1gb - its great!
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  24. #1314
    noob

    Points: 11.654, Level: 71
    Level completed: 1%, Points required for next Level: 396
    Overall activity: 99,0%

    Registriert seit
    Jun 2005
    Beiträge
    220
    Points
    11.654
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    I'm having an odd graphical problem with my Lua script.... this is showing up like this: ingame. Anyone know whats wrong?

  25. #1315
    QJ Gamer Bronze
    Points: 8.803, Level: 63
    Level completed: 18%, Points required for next Level: 247
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Western Australia
    Beiträge
    1.046
    Points
    8.803
    Level
    63
    Downloads
    0
    Uploads
    0

    Standard

    Uhm sometimes it could just be what format the image it is in, but otherwise I have no idea.

  26. #1316
    noob

    Points: 11.654, Level: 71
    Level completed: 1%, Points required for next Level: 396
    Overall activity: 99,0%

    Registriert seit
    Jun 2005
    Beiträge
    220
    Points
    11.654
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von PopcOrn DeVil
    Uhm sometimes it could just be what format the image it is in, but otherwise I have no idea.
    .PNG, which has been working for me for a while.

  27. #1317
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Ok i haven't done anything to it and suddenly LUAplayer doesn't work anymore. First i got an error saying something is nil and press start to restart (the usual), but this happens on startup of LUAplayer itself. Tried to reinstall and still to game. Now it just crashes and tells me its not able to run it? This sucks bigtime since i cannot play my own game to test it.
    Did anybody else have this? If so what did you do, or else any ideas on this?

    Edit:
    Never mind, it works again. I have no clue about what happened, i just kept on reinstalling and rebooting till it worked again, jey!
    Geändert von Altair (04-04-2006 um 07:58 AM Uhr)
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  28. #1318
    QJ Gamer Blue
    Points: 4.510, Level: 42
    Level completed: 80%, Points required for next Level: 40
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    127.0.0.1
    Beiträge
    75
    Points
    4.510
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Ok, I've got some major image problems in LUA. The first problem is when I run the following script on the PSP, it runs fine, but when loading it using windowsluaplayer I get myself the following error:

    Script
    Code:
                                                        System.usbDiskModeActivate()
    green = Color.new(0, 255, 0)
    time = 0
    pi = math.atan(1) * 4
    background = Image.load("images/background.jpg")
    smiley = Image.load("images/smiley.png")
    while true do
    	screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
    
    	x = math.sin(pi * 2 / 250 * time) * 200 + 220.5
    	y = 172 - math.abs(math.sin(pi * 2 / 125 * time) * 150)
    	screen:blit(x, y, smiley)
    	time = time + 1
    	if time >= 500 then
    		time = 0
    	end
     
    	screen.waitVblankStart()
    	screen.flip()
     
    	pad = Controls.read()
    	if pad:start() then
    		break
    	end
    end
    Error:
    error: index.lua:5: Image.load: Error loading image.
    Next, as soon as I replace the background.jpg by the same file in png, it doesn't load at all, no matter on the PSP as on Windows. Though my tutorial used a .png file that loaded just fine.

    Thanks in advance

  29. #1319
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    You sure you havent used any capital letters or anything on the ACTUAL image name?


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  30. #1320
    Think, Do, Gloat.
    Points: 12.687, Level: 73
    Level completed: 60%, Points required for next Level: 163
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    England, Norwich
    Beiträge
    1.422
    Points
    12.687
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Make it a png file. might fix it. I never thought lua could read jpg?


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 07:52 AM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .