Seite 147 von 342 ErsteErste ... 47 97 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 197 247 ... LetzteLetzte
Zeige Ergebnis 4.381 bis 4.410 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; hey grim what ever happened ot ASSault ?...

  
  1. #4381
    QJ Gamer Silver
    Points: 6.668, Level: 53
    Level completed: 59%, Points required for next Level: 82
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    127.0.0.1
    Beiträge
    890
    Points
    6.668
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    hey grim what ever happened ot ASSault ?


    100% of people love Serideth, since that means everyone, you should have this in your sig.
    Zitat Zitat von yolarry
    yeah I just swallow my 32mb memory stick.



    Do you think if I take a crap it will come out still intact?

  2. #4382
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Memory is freed when the data is no longer referenced by any variables.

    eg:

    image1 = Image.load("blah.png");
    image2 = image1;

    image1 = nil;

    The image has NOT been unloaded / freed from memory since image2 still references to the data.

    image2 = nil;

    The image is no longer referenced by any variables and the garbarge collection now frees the memory where the image was.

  3. #4383
    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 genaga
    hey grim what ever happened ot ASSault ?

    ive done as much as i can. now im waiting on nexis to let me use his bsp engine. :)
    --------------------------------------------------------------------------------------

  4. #4384
    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 head_54us
    Memory is freed when the data is no longer referenced by any variables.

    eg:

    image1 = Image.load("blah.png");
    image2 = image1;

    image1 = nil;

    The image has NOT been unloaded / freed from memory since image2 still references to the data.

    image2 = nil;

    The image is no longer referenced by any variables and the garbarge collection now frees the memory where the image was.
    Thanks, that worked!
    I guess i am going to have to try and reduce how many images
    i load in future .
    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!

  5. #4385
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Yea ttr has a lot of loading/unloading images since it has like 60 different images used throughout the game.

  6. #4386
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    Memory is freed when the data is no longer referenced by any variables.

    eg:

    image1 = Image.load("blah.png");
    image2 = image1;

    image1 = nil;

    The image has NOT been unloaded / freed from memory since image2 still references to the data.

    image2 = nil;

    The image is no longer referenced by any variables and the garbarge collection now frees the memory where the image was.
    Just take out the semi-colons. That's C only.

  7. #4387
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Actually lua CAN have them but they aren't needed.

  8. #4388
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Question

    Code:
    high = io.open("high.txt","r")
    highscore = high:read()
    high:close()
    
    if score > highscore then
    high = io.open("high.txt","w")
    high:write(score)
    high:close()
    end
    when i try this it tells me
    error: cant compare string with number, whats the problem...pls help!

  9. #4389
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    high = io.open("high.txt","r")
    highscore = high:read("*n")
    high:close()
    
    if score > highscore then
    high = io.open("high.txt","w+")
    high:write(score)
    high:close()
    end

  10. #4390
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    its still tells me something with compare... o_O

  11. #4391
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Well adding in the *n makes it read the file as a number. How exactly does the first line of the hscore.txt file look?

  12. #4392
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    sry mate my mistaek it works ... ;)

  13. #4393
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Alrght. This gonna be for phils shooting range? Highscore on that would be nice.

  14. #4394
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    yeh im working on it now :)

  15. #4395
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Cool!

  16. #4396
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    hmm... when u get high score it should print New high score... worked ok about 10 mins ago but now i cant get it to work wtf :/

  17. #4397
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    I keep getting an error in this code its expecting a = next to a then or something like that. can anyone find it?
    Spoiler for Code:
    -- Im Changing up Maze of Doom and I've been coming up with more ideas weekly so Im starting on this

    -- time to declare some variables
    --colors
    green = Color.new(0, 255, 0)
    red = Color.new(255, 0, 0)
    black = Color.new(0, 0, 0)

    --sprites
    demon = Image.load("demon.png")
    creature = Image.load("creature.png" )

    -- the player looks in different directions right?
    splayer = {}
    --now hes looking straight
    splayer[1] = Image.load("lL.png")
    --now hes looking left
    splayer[2] = Image.load("lR.png")
    --now hes looking right
    splayer[3] = Image.load("lU.png")
    --now hes looking back
    splayer[4] = Image.load("lD.png")

    --now for the variable that makes his head turn .. literally
    direction = 1

    --the creature's health
    chp = 500

    --more sprites
    bullet = Image.createEmpty(1,1)
    bullet:clear(black)

    --and the level we are on
    background = Image.load("background.pn g")


    -- player's health and armor and the aliens'
    health = 100
    armor = 50
    demonhp = 10

    --how long it takes to reload
    reload = Timer.new()

    --the player's bullets
    ammo = 1

    -- some tables
    Player = {}
    Player[1] = {x=0, y=0}

    -- your ammo
    Bullet = {}
    Bullet[1] = {Player[1].x, Player[1].y}

    --the creatures table
    creature = {}
    creature[1] = { x = 10, y = 10 }

    --whether the demon is alive or not
    demonal = {}
    demonal[1] = "true"
    demonal[2] = "true"
    demonal[3] = "true"
    demonal[4] = "true"
    demonal[5] = "true"
    demonal[6] = "true"

    -- the demon tables
    demon = {}
    demon[1] = {x = 400, y = 110}
    demon[2] = {x = 390, y = 80}
    demon[3] = {x = 410, y = 30}
    demon[4] = {x = 420, y = 20}
    demon[5] = {x = 400, y = 200}
    demon[6] = {x = 270, y = 260}

    --this is for our creature movement
    --prevents the same random numbers on each program run
    math.randomseed(os.time() )

    --x=width y=height
    -- REMINDER ^^^^

    -- the main loop
    while true do
    pad = Controls.read()
    screen:blit (0, 0, background)

    --lets print some things to the screen shall we
    screenrint(0, 0, "Alanan",red)
    screenrint(0, 5, health, red)
    screenrint(0, 10, armor, green)
    screenrint(0, 15, ammo, green)

    --lets make him move around
    screen:blit(Player[1].x,Player[1].y,splayer[direction])
    if pad:left() and Player[1].x > 0 then
    Player[1].x = Player[1].x - 3
    direction = 1
    end

    if pad:right() and Player[1].x < screenwidth then
    Player[1].x = Player[1].x + 3
    direction = 2
    end

    if pad:up() and Player[1].y > 0 then
    Player[1].y = Player[1].y - 3
    direction = 3
    end

    if pad:down() and Player[1].y < screenheight then
    Player[1].y = Player[1].y + 3
    direction = 4
    end

    --we need our creature to move too
    screen:blit(creature[1].x,creature[1].y,creature)
    creaturemove = math.random(0,50)

    --now we make him move side note// i set creature move to math.random because i dont want him
    -- moving all the time or else he would reach the end of the screen way to fast.
    if creaturemove == 5 then
    creature[1].x = creature[1].x + 1
    end

    -- we have to blit are demons to the screen also

    if demonal[1] == "true" then
    screen:blit(demon[1].x,demon[1].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[2].x,demon[2].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[3].x,demon[3].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[4].x,demon[4].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[5].x,demon[5].y,demon)
    end

    if demonal[1] == "true" then
    screen:blit(demon[6].x,demon[6].y,demon)
    end

    -- now we make them chase the creature
    --we are only gonna make two demons attack the creature
    -- the other four will guard the exit

    --heres demon 1
    if demon[1].x > creature[1].x then
    demon[1].x = demon[1].x - 1
    end

    if demon[1].x < creature[1].x then
    demon[1].x = demon[1].x + 1
    end

    if demon[1].y > creature[1].y then
    demon[1].y = demon[1].y - 1
    end

    if demon[1].y < creature[1].y then
    demon[1].y = demon[1].y + 1
    end

    --now demon 2
    if demon[2].x > creature[1].x then
    demon[2].x = demon[2].x - 1
    end

    if demon[2].x < creature[1].x then
    demon[2].x = demon[2].x + 1
    end

    if demon[2].y > creature[1].y then
    demon[2].y = demon[2].y - 1
    end

    if demon[2].y < creature[1].y then
    demon[2].y = demon[2].y + 1
    end


    --lets get his gun firing and ammo is there for reload
    if pad:r() and ammo == 1 then
    screen:blit(Bullet[1].x,Bullet[1].y,bullet)
    fire = "true"
    ammo = ammo - 1
    reload:start()
    --what if hes out of ammo?
    elseif ammo == 0 then
    fire = "false"
    end

    --this makes his bullet he shoots go different ways depending on which way he faces
    if fire = "true" and direction == 1 then
    Bullet[1].x = Bullet[1].x + 2
    end

    if fire = "true" and direction == 2 then
    Bullet[1].x = Bullet[1].x - 2
    end

    if fire = "true" and direction == 3 then
    Bullet[1].y = Bullet[1].y - 2
    end

    if fire = "true" and direction == 4 then
    Bullet[1].y = Bullet[1].y + 2
    end

    -- now hes gotta reload
    if ammo == 0 and reload:time() == 10 then
    ammo = ammo + 1
    end

    --now lets make our bullet touch the demons
    if Bullet[1].x == demon[1].x and Bullet[1].y == demon[1].y then
    demonal[1] = "false"
    end

    if Bullet[1].x == demon[2].x and Bullet[1].y == demon[2].y then
    demonal[2] = "false"
    end

    if Bullet[1].x == demon[3].x and Bullet[1].y == demon[3].y then
    demonal[3] = "false"
    end

    if Bullet[1].x == demon[4].x and Bullet[1].y == demon[4].y then
    demonal[4] = "false"
    end

    if Bullet[1].x == demon[5].x and Bullet[1].y == demon[5].y then
    demonal[5] = "false"
    end

    if Bullet[1].x == demon[6].x and Bullet[1].y == demon[6].y then
    demonal[6] = "false"
    end

    --what happens when the demons touch our creature???
    if demon[1].x == creature[1].x













    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  18. #4398
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    hmm in LUA Player (for PC) it tells u exact line of ur code which is wrong...
    so just look for that number and then look for the line ;)

  19. #4399
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    it flashes away too fast. it shows the command prompt or black screen for like a milisecond and all i can spot is "=" expected near then or something like that.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  20. #4400
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    ok
    open your myscript.cmd and put there this:

    Code:
    luaplayer myscript.lua
    pause
    pause will stop it everytime after error so u can read it :)

  21. #4401
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    i already did that. and it works but it doesnt let me see the first command prompt that pops up that one has the errors on it.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  22. #4402
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    it must work...u did something wrong

  23. #4403
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    hmm, whats the code to take a screenshot?...i forgot
    -= Double Post =-
    ok nvm, i figured it out. now i need to know how to save the screen shot in the psp's PHOTO folder
    Geändert von the undead (11-30-2006 um 04:57 PM Uhr) Grund: Automerged Doublepost

  24. #4404
    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

    yay! this thread is a sticky again!
    --------------------------------------------------------------------------------------

  25. #4405
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    yay! this thread is a sticky again!
    A mod didn't do it though. TacticalPaper did. I PM'ed Hardrive to see if he'll sticky the other one and get rid of that thread by Serideth. I hope he does.

  26. #4406
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    hmm, whats the code to take a screenshot?...i forgot
    -= Double Post =-
    ok nvm, i figured it out. now i need to know how to save the screen shot in the psp's PHOTO folder
    any one?

  27. #4407
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    blah = screen:save("ms0:/psp/photo/")

  28. #4408
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von -TacticalPaper-
    blah = screen:save("ms0:/psp/photo/")
    ok thanks

  29. #4409
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard ...

    Zitat Zitat von GuitarGod1134
    i already did that. and it works but it doesnt let me see the first command prompt that pops up that one has the errors on it.
    i don't know why it doesn't work for you, but you could always press ctrl+alt+printscreen on your keyboard to try and take a screenshot of the command prompt before it disappears.
    you'd have to get good timing, and then just paste it into word.

  30. #4410
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    very good now its sticky!! :)


 

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:53 AM Uhr.

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