Seite 103 von 342 ErsteErste ... 3 53 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 153 203 ... LetzteLetzte
Zeige Ergebnis 3.061 bis 3.090 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; you can only send a string with IR so no it wouldn't work. Just check the example in LUA player ...

  
  1. #3061
    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

    you can only send a string with IR so no it wouldn't work. Just check the example in LUA player itself.


    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  2. #3062
    QJ Gamer Green
    Points: 7.057, Level: 55
    Level completed: 54%, Points required for next Level: 93
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Scotland, UK
    Beiträge
    571
    Points
    7.057
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    hey, i was wondering is there a way to exit out of a script without going back to the script which initiated that . Here is a diagram.

    intro
    ¦
    ¦
    V
    what i want to know is how to do i exit
    start menu <--------------
    out of this script without going to the intro?
    ¦
    ¦
    V
    rest of game

  3. #3063
    Developer
    Points: 5.650, Level: 48
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    USA, Virginia
    Beiträge
    580
    Points
    5.650
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    I'm still in need of some information on the Danzeff Keyboard, any help on that would be great..

  4. #3064
    QJ Gamer Green
    Points: 7.057, Level: 55
    Level completed: 54%, Points required for next Level: 93
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Scotland, UK
    Beiträge
    571
    Points
    7.057
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    hey is there a solution to my problem?

    edit: i just relaised that seem a bit rude, sorry
    Geändert von mark.sparky (08-02-2006 um 01:21 PM Uhr)

  5. #3065
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von mark.sparky
    hey, i was wondering is there a way to exit out of a script without going back to the script which initiated that . Here is a diagram.

    intro
    ¦
    ¦
    V
    what i want to know is how to do i exit
    start menu <--------------
    out of this script without going to the intro?
    ¦
    ¦
    V
    rest of game
    Easy... make your intro a function, your menu a function and your main game a function... just call your menu function to exit or w/e u want.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  6. #3066
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    I need to make a random number between 52-84 (I need a damage number when my carecter strikes) Also what is the lvl you start on FF7...... not.... that.....im.....hinting to what im making. ;)
    Taking things too far one step at a time

  7. #3067
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Ralan
    I need to make a random number between 52-84 (I need a damage number when my carecter strikes) Also what is the lvl you start on FF7...... not.... that.....im.....hinting to what im making. ;)

    at the beggining of your script throw in a
    Code:
    math.randomseed(os.time())
    That makes it so your randomly generated number are even more random.

    The where you want to pick the random number put

    Code:
    math.random(52,84)
    Which gives a random integer between the low, 52, and the high, 84.

  8. #3068
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Jeremy1026
    at the beggining of your script throw in a
    Code:
    math.randomseed(os.time())
    That makes it so your randomly generated number are even more random.

    The where you want to pick the random number put

    Code:
    math.random(52,84)
    Which gives a random integer between the low, 52, and the high, 84.
    If i get the first boss done tonight Ill release a tech demo :) Ty for the help.
    Taking things too far one step at a time

  9. #3069
    6201ymereJ
    Points: 7.062, Level: 55
    Level completed: 56%, Points required for next Level: 88
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Baltimore
    Beiträge
    588
    Points
    7.062
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Ralan
    If i get the first boss done tonight Ill release a tech demo :) Ty for the help.
    np, i use math.random about 100 times in yahtzee :)

  10. #3070
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    cool. how would you go about printing that to screen i wanna play aroud with it

  11. #3071
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    and then to add to that for damage say:
    Code:
     Randnum=math.random(52, 84)
    
    enemy = {}
    enemy.health = 100
    
    if Randnum >=52 and <=70  and player.attack = true then  --assuming you have a player.attack
    enemy.health = enemy.health - 5
    end
    I don't understand why you want the attacking to be random....?

  12. #3072
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von N0obKi|l3r.exe
    cool. how would you go about printing that to screen i wanna play aroud with it
    Store it in a variable and print that lol
    Taking things too far one step at a time

  13. #3073
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    wait im confused which one the os one or the actual setty up of the numbers one >.< uuuuugggggg

  14. #3074
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    like so:
    Code:
     math.randomseed(os.time())
    
    Randnum = math.random(1, 100)
    
    screen:print("The random number is" .. Randnum)
    and that would display this: The random number is 7
    Asuuming the random number actually is 7
    Geändert von Bronx (08-02-2006 um 05:37 PM Uhr) Grund: Automerged Doublepost

  15. #3075
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    ah okay. lmme make a demo for my game for pushing x lets say

  16. #3076
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Bronx
    and then to add to that for damage say:
    Code:
     Randnum=math.random(52, 84)
    
    enemy = {}
    enemy.health = 100
    
    if Randnum >=52 and <=70  and player.attack = true then  --assuming you have a player.attack
    enemy.health = enemy.health - 5
    end
    I don't understand why you want the attacking to be random....?
    Its alot easier and more efficent
    Taking things too far one step at a time

  17. #3077
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    exept it would take 20 shots to kill him T_T

  18. #3078
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    @ralan, ahhhh

    @noobkiller, I edited my post several times since my comp is lagging, so make sure u have the right code

  19. #3079
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von N0obKi|l3r.exe
    exept it would take 20 shots to kill him T_T
    Depending on your enimes healt, You think too small
    Taking things too far one step at a time

  20. #3080
    Asleep...
    Points: 11.516, Level: 70
    Level completed: 67%, Points required for next Level: 134
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    1.383
    Points
    11.516
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Depending on your enimes healt, You think too small
    with that code then it would ;) unless yo change it O,O
    ARRRRRGH i suck at puttong snippets of code together. all i get is wrong numbber of arguments

  21. #3081
    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

    can someone PLS help me??

    :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry:

    I CANT ******* FIGURE IT OUT!!!!!!! ARGH!!!!!!!!!!!! IM GOING TO BURST!!!!!!!!!!!!!!!!!!!! !

    :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh:
    --------------------------------------------------------------------------------------

  22. #3082
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    can someone PLS help me??

    :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry:

    I CANT ******* FIGURE IT OUT!!!!!!! ARGH!!!!!!!!!!!! IM GOING TO BURST!!!!!!!!!!!!!!!!!!!! !

    :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh:
    Whats your problem? (Final question, HOW DO I FIGURE OUT WHERE MY IMAGES SHOULD GO THEN THAT THE COOREDTNETS and use them in my script (srry about cap locks))
    Taking things too far one step at a time

  23. #3083
    I think I ripped my pants
    Points: 33.140, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    6.484
    Points
    33.140
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    can someone PLS help me??

    :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry: :Cry:

    I CANT ******* FIGURE IT OUT!!!!!!! ARGH!!!!!!!!!!!! IM GOING TO BURST!!!!!!!!!!!!!!!!!!!! !

    :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh: :Argh:
    lol, if you tell us what your problem is maybe ;)
    [CENTER][IMG]http://i33.tinypic.com/wmeb8x.jpg[/IMG][/CENTER]
    [FIELDSET="Useful Links"][CENTER][SIZE="1"][B][URL="http://forums.qj.net/showthread.php?p=13162#post13162"][COLOR="Red"][Posting Guidelines][/COLOR][/URL] - [URL="http://forums.qj.net/f-qjnet-news-and-help-25/t-qj-quick-justice-policy-must-read-69509.html"][COLOR="Red"][Quick Justice Policy][/COLOR][/URL] - [URL="http://forums.qj.net/showthread.php?t=9708"][COLOR="Red"][PSPositive Posting][/COLOR][/URL] - [URL="http://forums.qj.net/showthread.php?t=4394"][COLOR="Red"][Piracy Policy][/COLOR][/URL]
    [URL="http://forums.qj.net/showthread.php?t=65979"][COLOR="SeaGreen"][Ultimate QJ Guide][/COLOR][/URL] - [URL="http://forums.qj.net/f-qjnet-news-and-help-25/t-faq-useful-info-and-links-for-new-members-53693.html"][COLOR="SeaGreen"][Newbie FAQ/Guide][/COLOR][/URL] - [URL="http://forums.qj.net/showthread.php?t=19128"][COLOR="SeaGreen"][Become Premium][/COLOR][/URL] - [URL="http://forums.qj.net/f-wii-general-108/t-wii-faq-20295.html"][COLOR="SeaGreen"][Wii FAQ][/COLOR][/URL][/B][/SIZE][/CENTER][/FIELDSET]

  24. #3084
    QJ Gamer Green
    Points: 15.884, Level: 81
    Level completed: 7%, Points required for next Level: 466
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    This Forum
    Beiträge
    1.825
    Points
    15.884
    Level
    81
    Downloads
    0
    Uploads
    0

    Standard

    Is there a program that will allow me to place a image and see the coordiates so i can use them in m image placing?
    Taking things too far one step at a time

  25. #3085
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    yes, but i dont remember the name of it. I think it may of been by kozine, but thats kinda a guess.

  26. #3086
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Ralan
    Is there a program that will allow me to place a image and see the coordiates so i can use them in m image placing?
    I actually could use something for that myself. I may code up a program that will do that, which will run on the pc rather than psp.
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  27. #3087
    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 Grimfate126
    ???

    OK, try TWO- ACTION!


    i am making an app. for it i need to load these images:


    Code:
    test1.png
    test2.png
    test3.png
    test4.png
    test5.png
    test6.png
    i want all those images in an array called:

    Code:
    test_array

    then i have ANOTHER set of images:
    Code:
    char1.png
    char2.png
    char3.png
    char4.png
    char5.png
    char6.png
    char7.png
    char8.png
    char9.png

    i want these images in an array called:

    Code:
    char_array

    i have a THIRD set of images (the last set):

    Code:
    misc1.png
    misc2.png
    misc3.png
    misc4.png
    misc5.png
    i want these images in an array called:

    Code:
    misc_array
    NOW.. i can make all the arrays and load the images by hand but its MUCH faster with a function, SO i made a function to make the array, and load the images into it:

    Code:
    function make(header, frames, name)
    
      name = {}
     
        for a = 1, frames do
            name[a] = Image.load(header..a..".png")
        end
    
    end
    NOW, i called the function like this
    Code:
    make(test, 9, test_array)
    make(char, 6, char_array)
    make(misc, 5, misc_array)
    BUT, the function does not work properly. the problem is that everytime i call it the function makes an array by the name of:

    Code:
    name
    and not the name i give it. (such as test_array, or char_array, or misc_array)


    NOW do u get it?


    BTW, i wont tell what app im making yet. ;)


    THATS my problem. im SOOOO CLOSE to finishing my app, WHEN THIS ******* PROBLEM COMES UP.

    ANY help is appreciated lik a LOT!!
    --------------------------------------------------------------------------------------

  28. #3088
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Just don't try to tell him to take the "name" input out of the function, 'cause we already tried that and he didn't like it. :)

    Code:
    function make(header, frames)
        local name={}
        for a = 1, frames do
            name[a] = Image.load(header..a..".png")
        end
        return name 
    end
    
    -- then call it like this
    
    test_array={}
    char_array={}
    misc_array={}
    make(test, 9)
    make(char, 6)
    make(misc, 5)

  29. #3089
    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

    Zitat Zitat von Ralan
    Is there a program that will allow me to place a image and see the coordiates so i can use them in m image placing?
    Thats like the easiest thing to code. Only thing you need is an example image/real one or a cursor, code for movement and you print the coordinates of it. Yes there was one, I think it was Gutya's.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  30. #3090
    QJ Gamer Green
    Points: 7.057, Level: 55
    Level completed: 54%, Points required for next Level: 93
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Scotland, UK
    Beiträge
    571
    Points
    7.057
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Final question before i realese my first game: Is there a way make a function only run once?


 

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 08:59 PM Uhr.

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