Seite 315 von 342 ErsteErste ... 215 265 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 ... LetzteLetzte
Zeige Ergebnis 9.421 bis 9.450 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; Code: layer = {} layer[1] = ImageCreateEmpty(480,272) layer[2] = ImageCreateEmpty(480,272) while true do layer[1]:blit(maspritez,0,0) layer[2]:blit(mabackgrowndz,0,0) screen.flip() screen.waitVblankStart() end Probably a ...

  
  1. #9421
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    layer = {}
    layer[1] = ImageCreateEmpty(480,272)
    layer[2] = ImageCreateEmpty(480,272)
    
    while true do
    
    layer[1]:blit(maspritez,0,0)
    layer[2]:blit(mabackgrowndz,0,0)
    
    screen.flip()
    screen.waitVblankStart()
    end
    Probably a few small errors, haven't used Lua for a while.

    Is this what you meant ?


    Geändert von eldiablov (09-15-2008 um 08:28 AM Uhr)

  2. #9422
    Seven Year Vet. BOW DOWN.
    Points: 14.794, Level: 78
    Level completed: 86%, Points required for next Level: 56
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Manchester, UK
    Beiträge
    2.240
    Points
    14.794
    Level
    78
    My Mood
    Cheerful
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von Nielkie Beitrag anzeigen
    Next time, read the function documentation
    http://wiki.ps2dev.org/psp:lua_playe...ound_and_music
    I feel so stupid now, considering I did read that before posting here. I guess I should be more observant. Thanks for the fix.

  3. #9423
    Lua guy
    Points: 11.690, Level: 71
    Level completed: 10%, Points required for next Level: 360
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    Wales, cardiff
    Beiträge
    1.442
    Points
    11.690
    Level
    71
    My Mood
    Blah
    Downloads
    0
    Uploads
    0

    Talking

    Zitat Zitat von eldiablov Beitrag anzeigen
    Code:
    layer = {}
    layer[1] = ImageCreateEmpty(480,272)
    layer[2] = ImageCreateEmpty(480,272)
    
    while true do
    
    layer[1]:blit(maspritez,0,0)
    layer[2]:blit(mabackgrowndz,0,0)
    
    screen.flip()
    screen.waitVblankStart()
    end
    Probably a few small errors, haven't used Lua for a while.

    Is this what you meant ?
    yeah, thanks lol. (Why didn't i think of that *sigh* *calls himself stupid*

  4. #9424
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Heres my issue. at the the transition from (Pressing start to play) to (loading "intro) I dont want to use the command

    "screen.waitVblankStart() "

    because i dont want it to wait. I want it to stay there UNTILL I press start!!

    what should I do to display "intro" (its a picture that takes up the whole screen) after I press start also.

    So here is my code:
    pink = Color.new(255, 0 , 153)
    blue = Color.new(0 , 153, 255)
    orange = Color.new(255, 102, 0)
    gray = Color.new(153, 153, 153)
    black = Color.new(0 , 0 , 0)
    green = Color.new(0, 255, 0)
    white = Color.new(225, 225, 225)

    --*****LOADING SCREEN*****

    screenrint(194, 136, "Loading: 0%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    intro = Image.load("abaddonsparra ble/introscreen.png")

    screenrint(194, 136, "Loading: 20%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    lvlone = Image.load("abaddonsparra ble/levelone intro.png")

    screenrint(194, 136, "Loading: 40%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    story = Image.load("abaddonsparra ble/story.png")

    screenrint(194, 136, "Loading: 60%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    choiceone = Image.load("abaddonsparra ble/choice1.png")

    screenrint(194, 136, "Loading: 80%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    screenrint(194, 136, "Loading: 100%", blue)
    screen.flip()
    screen.waitVblankStart(60 )
    screen:clear()

    screenrint(194, 136, "Press START to play", white)
    screen.flip()

    pad = Controls.read()

    if pad:start() then
    screen:clear()
    screen:blit(0, 0, intro)
    screen.flip()
    end

  5. #9425
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    You would need to load the images in a separate thread so that the graphics can be updated each frame. I'm not really sure if Lua (on the PSP?) has any threading support, but I would look it up if I were you.

    Actually, what? Can you elaborate please?

  6. #9426
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    Zitat Zitat von legacyxero Beitrag anzeigen
    Heres my issue. at the the transition from (Pressing start to play) to (loading "intro) I dont want to use the command

    "screen.waitVblankStart() "

    because i dont want it to wait. I want it to stay there UNTILL I press start!!

    what should I do to display "intro" (its a picture that takes up the whole screen) after I press start also.

    So here is my code:
    you can do a while loop if you like for example

    Code:
     inintro = 1
    perc = 0
    while (inintro == 1) do
    
    screen:clear()
    if (perc == 0) then
    intro = Image.load("abaddonsparra ble/introscreen.png")
    perc = 10
    else if (perc == 10) then
    lvlone = Image.load("abaddonsparra ble/levelone intro.png")
    else if (perc == 100) then
    
    screenrint(194, 140, "Press START to play", white)
    
    
    pad = Controls.read()
    
    if pad:start() then
    inintro = 0
    end 
    
    end
    screen:print(194, 136, "Loading: "..perc.."%", blue)
    screen.flip()
    end
    while (1) do
    //start game stuff
    end
    note*: it may have some error because i just did it so you can understand

    just keep on using else if for every perc you want to use and modifier the perc so it blit property
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  7. #9427
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    well this whole game is just going to be like a scenario game.

    for example, here is the first choice you make in the game.



    It is just going to be whether you press ^, O, or X and it will load another picture with some story line, and then another choice.

    I didnt think the code would be that advanced just to load a picture after pressing a button.

  8. #9428
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    Zitat Zitat von legacyxero Beitrag anzeigen
    well this whole game is just going to be like a scenario game.

    for example, here is the first choice you make in the game.



    It is just going to be whether you press ^, O, or X and it will load another picture with some story line, and then another choice.

    I didnt think the code would be that advanced just to load a picture after pressing a button.

    ok let me if i can understand you.

    you want to show first a loading animation/screen first to load the images, then you want to blit a serctaine image to the screen depening on the button user press?

    if so then it as easy as making 2 while loops one to load all the images and the second to ask the user to press a button and then blit that image to screen

    example:
    Code:
    ---Example by Thecobra---
    inloading = 1 --say if we are still loading images
    perc = 0 --how many images we load in percentage
    while(inloading == 1) do ---if we are still laoding then--
    screen.clear()
    screen:print("loading.."..perc,Color(0,0,255))
    screen.flip()
    if (perc == 0) then
    intro = Image.load("abaddonsparra ble/introscreen.png") --load intro image--
    perc = 10
    else if (perc ==10) then
    image1 = Image.load("abaddonsparra ble/image1.png") --load image 1 if perc = 10--
    perc = 20
    else if (perc == 20) then
    image2 = Image.load("abaddonsparra ble/image2.png") --load image 2 if perc = 20--
    perc = 30
     ---so on and so on for else if--
    else if (perc == 100) then
    --ok we loaded everything so let exit our loop of loading--
    inloading = 0
    end
    
    end
    --now let start our real program :) ---
    imgtodisplay = 1
    while true do
    pad = Controls.read()
    screen.clear()
    if imgtodisplay == 1 then
    screen:blit(intro)
    end
    if imgtodisplay == 2 then
    screen:blit(image1)
    end
    if imgtodisplay == 3 then
    screen:blit(image2)
    end
    if imgtodisplay == 4 then
    screen:blit(image3)
    end
    if pad:triangle then
    --set current image to something else--
    imgetodisplay = 2
    end
    if pad:square then
    --set current image to something else--
    imgetodisplay = 3
    end
    if pad:circle then
    --set current image to something else--
    imgetodisplay = 4
    end
    --print out some txt--
    screen:print("press triangle to display image 1")
    screen:print("press square to display image 2")
    screen:print("press circle to display image 3")
    screen.flip()
    end
    like last time note that commands are not propertly use or missing something, it just meant to give you a idea on how to do it, it simple if you understand what it doing and try it you self :) good luck
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  9. #9429
    OMFG
    Points: 19.453, Level: 88
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Toronto
    Beiträge
    2.814
    Points
    19.453
    Level
    88
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von thecobra Beitrag anzeigen
    ok let me if i can understand you.

    you want to show first a loading animation/screen first to load the images, then you want to blit a serctaine image to the screen depening on the button user press?

    if so then it as easy as making 2 while loops one to load all the images and the second to ask the user to press a button and then blit that image to screen

    example:
    Code:
    ---Example by Thecobra---
    inloading = 1 --say if we are still loading images
    perc = 0 --how many images we load in percentage
    while(inloading == 1) do ---if we are still laoding then--
    screen.clear()
    screen:print("loading.."..perc,Color(0,0,255))
    screen.flip()
    if (perc == 0) then
    intro = Image.load("abaddonsparra ble/introscreen.png") --load intro image--
    perc = 10
    else if (perc ==10) then
    image1 = Image.load("abaddonsparra ble/image1.png") --load image 1 if perc = 10--
    perc = 20
    else if (perc == 20) then
    image2 = Image.load("abaddonsparra ble/image2.png") --load image 2 if perc = 20--
    perc = 30
     ---so on and so on for else if--
    else if (perc == 100) then
    --ok we loaded everything so let exit our loop of loading--
    inloading = 0
    end
    
    end
    --now let start our real program :) ---
    imgtodisplay = 1
    while true do
    pad = Controls.read()
    screen.clear()
    if imgtodisplay == 1 then
    screen:blit(intro)
    end
    if imgtodisplay == 2 then
    screen:blit(image1)
    end
    if imgtodisplay == 3 then
    screen:blit(image2)
    end
    if imgtodisplay == 4 then
    screen:blit(image3)
    end
    if pad:triangle then
    --set current image to something else--
    imgetodisplay = 2
    end
    if pad:square then
    --set current image to something else--
    imgetodisplay = 3
    end
    if pad:circle then
    --set current image to something else--
    imgetodisplay = 4
    end
    --print out some txt--
    screen:print("press triangle to display image 1")
    screen:print("press square to display image 2")
    screen:print("press circle to display image 3")
    screen.flip()
    end
    like last time note that commands are not propertly use or missing something, it just meant to give you a idea on how to do it, it simple if you understand what it doing and try it you self :) good luck
    That is horrible code, I wouldn't advise anyone to use it as an outline. Although it works, it's bad.

  10. #9430
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Slasher Beitrag anzeigen
    That is horrible code, I wouldn't advise anyone to use it as an outline. Although it works, it's bad.
    could you help me out then slasher?

  11. #9431
    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

    Got bored so here is a framework in pure Lua that is easily scalable (virtually data driven). You should be able to understand the code and make it work for PSP and your needs.

    Code:
    -- Constants
    DIRECTION_NORTH = 1;
    DIRECTION_EAST = 2;
    DIRECTION_SOUTH = 3;
    DIRECTION_WEST = 4;
    
    roomList = {};
    
    -- Create the rooms
    roomList[0] = { imageFilename = "", debugText = "RoomA, exits: West and South", exitRooms = {} };
    roomList[1] = { imageFilename = "", debugText = "RoomB, exits: East and South", exitRooms = {} };
    roomList[2] = { imageFilename = "", debugText = "RoomC, exits: East and North", exitRooms = {} };
    roomList[3] = { imageFilename = "", debugText = "RoomD, exits: West and North", exitRooms = {} };
    
    -- Map the rooms together
    roomList[0].exitRooms[DIRECTION_WEST] = roomList[1];
    roomList[0].exitRooms[DIRECTION_SOUTH] = roomList[3];
    
    roomList[1].exitRooms[DIRECTION_EAST] = roomList[0];
    roomList[1].exitRooms[DIRECTION_SOUTH] = roomList[2];
    
    roomList[2].exitRooms[DIRECTION_EAST] = roomList[3];
    roomList[2].exitRooms[DIRECTION_NORTH] = roomList[0];
    
    roomList[3].exitRooms[DIRECTION_WEST] = roomList[2];
    roomList[3].exitRooms[DIRECTION_NORTH] = roomList[0];
    
    bGameFinished = false;
    currentRoom = roomList[0];
    
    function ChangeRooms( direction )
    	newRoom = currentRoom.exitRooms[direction];
    	if newRoom ~= nil then
    		currentRoom = newRoom;
    	end
    end
    
    while not bGameFinished do
    	print( currentRoom.debugText );	
    	local sPlayerInput = io.read();
    	sPlayerInput = string.upper( sPlayerInput );
    	
    	if "Q" == sPlayerInput then
    		bGameFinished = true;
    	elseif "N" == sPlayerInput then
    		ChangeRooms( DIRECTION_NORTH );
    	elseif "S" == sPlayerInput then
    		ChangeRooms( DIRECTION_SOUTH );
    	elseif "W" == sPlayerInput then
    		ChangeRooms( DIRECTION_WEST );
    	elseif "E" == sPlayerInput then
    		ChangeRooms( DIRECTION_EAST );
    	end
    end

  12. #9432
    NetGameOrb Maker
    Points: 6.138, Level: 50
    Level completed: 94%, Points required for next Level: 12
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Ort
    New York
    Beiträge
    683
    Points
    6.138
    Level
    50
    My Mood
    Cheerful
    Downloads
    2
    Uploads
    0

    Standard

    Zitat Zitat von Slasher Beitrag anzeigen
    That is horrible code, I wouldn't advise anyone to use it as an outline. Although it works, it's bad.
    lol, yeah it horrible but like i said
    this code is just to give a idea on how he should do it, not to actually use it.

    maybe you can make another code for him,;)
    GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.

    Stats Blog:http://netgameorb.blogspot.com/
    Website:http://www.netgameorb.com/

  13. #9433
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von thecobra Beitrag anzeigen
    lol, yeah it horrible but like i said
    this code is just to give a idea on how he should do it, not to actually use it.

    maybe you can make another code for him,;)
    Yeah, I tried using that code, but i couldnt figure it out.

  14. #9434
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Have you looked at yaustars code ? :/

  15. #9435
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov Beitrag anzeigen
    Have you looked at yaustars code ? :/
    Obviously not because it actually is done properly and makes sense and it is just too difficult to understand the logic and scalability of it.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  16. #9436
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    Obviously not because it actually is done properly and makes sense and it is just too difficult to understand the logic and scalability of it.
    get off my back man...

    I read it and am scaling it right now...

    Keep in mind im a lua n00b still.

  17. #9437
    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

    As said earlier, it is a pure Lua framework. If you want to make it work with LuaPlayer and use button input, you have to do the legwork yourself. If I just give you the exact code, you won't learn or understand anything.

    If the code I have given is too complex, then work in baby steps towards it.

    You first step should be switching between two images using a button press.

    Brief:
    - When the program loads up, it displays image A
    - When the user presses SQUARE, it displays image B
    - When the user presses SQUARE again, it displays image A
    - When the user presses SQUARE again, it displays image B
    - etc

    Post your code here when you have done this.

  18. #9438
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar Beitrag anzeigen
    As said earlier, it is a pure Lua framework. If you want to make it work with LuaPlayer and use button input, you have to do the legwork yourself. If I just give you the exact code, you won't learn or understand anything.

    If the code I have given is too complex, then work in baby steps towards it.

    You first step should be switching between two images using a button press.

    Brief:
    - When the program loads up, it displays image A
    - When the user presses SQUARE, it displays image B
    - When the user presses SQUARE again, it displays image A
    - When the user presses SQUARE again, it displays image B
    - etc

    Post your code here when you have done this.

    its probably going to take me a couple days to get it working, and thank you again for the framework.

    In the meantime, could you tel me whats wrong with this code?
    its for my menu.

    when I run it I get the error for line 111: 'then' expected near '='


    --********MENU*********

    red = Color.new(255,0,0)
    black = Color.new(0,0,0)
    white = Color.new(255,255,255)

    menustatus = 1

    while true do
    screen:clear(black)
    pad = Controls.read()

    if pad:up() then
    menustatus = menustatus - 1
    screen.waitVblankStart(4)
    end

    if pad:down() then
    menustatus = menustatus + 1
    screen.waitVblankStart(4)
    end

    color={white, white, white}

    screenrint(50, 50, "Start Game", color[1])
    screenrint(50,60,"Controls", color[2])
    screenrint(50,70,"Exit", color[3])

    color[menustatus]=red

    if menustatus == 1 then
    if pad:cross() then
    end
    end

    if menustatus == 2 then
    if pad:cross() then


    screenrint(50,50,"Press Triangle to move North", white)
    screenrint(50,60,"Press Circle to move East", white)
    screenrint(50,70,"Press Cross To Move South", white)
    screenrint(50,80,"Press Square to move West", white)
    screen:Print(380,100,"Pre ss Triangle to go back to main menu", blue)

    if pad:triangle() then
    menustatus = 1
    end


    end
    end

    if menustatus == 3 then
    if pad:cross() then
    break
    end
    end

    if menustatus <= 0 then
    menustatus = 3
    end

    if menustatus => 4 then
    menustatus = 1
    end

    screen.flip()
    screen.waitVblankStart()
    end

  19. #9439
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    The point was for you to take baby steps toward a framework, not for us to continue helping you hardcode it.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  20. #9440
    QJ Gamer Gold
    Points: 13.240, Level: 74
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    May 2005
    Ort
    I live in a City that goes by the nickname:The Bubble. 'Nuff said.
    Beiträge
    1.766
    Points
    13.240
    Level
    74
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TurtlesPwn Beitrag anzeigen
    The point was for you to take baby steps toward a framework, not for us to continue helping you hardcode it.
    im sorry, is this not the lua help thread?

    and did I not say im working on it?

  21. #9441
    QJ Gamer Green
    Points: 3.721, Level: 38
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Jan 2008
    Beiträge
    612
    Points
    3.721
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von legacyxero Beitrag anzeigen
    im sorry, is this not the lua help thread?

    and did I not say im working on it?
    Do you teach a baby to walk or just carry it around all day?

    Work on the framework use, ditch your hardcoded crap.
    [size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]

  22. #9442
    Points: 2.679, Level: 31
    Level completed: 53%, Points required for next Level: 71
    Overall activity: 0%

    Registriert seit
    Feb 2008
    Beiträge
    12
    Points
    2.679
    Level
    31
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von legacyxero Beitrag anzeigen
    In the meantime, could you tel me whats wrong with this code?
    its for my menu.

    when I run it I get the error for line 111: 'then' expected near '='
    Are you an idiot? There isn't even 111 lines there, only 70.

    Also, I agree with TP, this is a help thread, not a learn how to walk thread. Take a little pride in your work please, don't hard code everything, otherwise your programs will be a giant mess of crap that no one will want to look at and you will go down in history with the other thousands of PSP lua noobs.

  23. #9443
    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

    legacy check your operators..... more specifically, greater-then-equal-to... (it isn't => if you're stumped)

    ...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


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

    Zitat Zitat von legacyxero Beitrag anzeigen
    its probably going to take me a couple days to get it working, and thank you again for the framework.

    In the meantime, could you tel me whats wrong with this code?
    its for my menu.

    when I run it I get the error for line 111: 'then' expected near '='
    Use [ code ] [ / code ] tags (without spaces), indent the code properly and repost.

  25. #9445
    QJ Gamer Silver
    Points: 6.948, Level: 54
    Level completed: 99%, Points required for next Level: 2
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    657
    Points
    6.948
    Level
    54
    Downloads
    5
    Uploads
    0

    Standard

    I've been looking over Red Squirrels CTF unpacker src. Any way this could be done in lua ?? (attached src)

    Any help I could get achieving this would be greatly appreciated.

    Thanks

    ~shizzy
    Angehängte Dateien Angehängte Dateien
    PSP: PSP SLIM 2001 TA-088v2
    Custom Firmware: 5.00 M33-6

  26. #9446
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    It can be done relatively easily.

    This should get you started:
    Code:
    function string.Mbyte(s)
    	local r = {}
    	for i=1, string.len(s) do
    		table.insert(r, string.byte(string.sub(s, i, i)))
    	end
    	return r
    end
    
    function string.NMbyte(s)
    	local b = string.Mbyte(s)
    	local r = ""
    	for i, n in ipairs(b) do
    		r = r .. tostring(n)
    	end
    	return tonumber(r)
    end
    
    function string.stripNull(string)
    	local r,n = string.gsub(string,"%z.*$","")
    	if n ~= 1 then
    		return r
    	else return "" end
    end
    
    function readBits(stringa, l)
    	stringa = string.reverse(stringa)
    	local value = 0
    	for i=1, l / 8 do
    		value = value + string.byte(string.sub(stringa,i,i)) * (256 ^ (i - 1))
    	end
    	return value
    end
    
    function CPTFHeader(file)
    	return {
    		sig = file:read(4),
    		version = string.NMbyte(file:read(4)), --?
    		name = string.stripNull(file:read(8)),
    		magic = file:read(4),
    		checksum = file:read(4), --?
    		headercount = readBits(file:read(4), 32),
    		size = readBits(file:read(4), 32)
    	}
    end
    
    function CTFPatchHeader(file)
    	return {
    		name = string.stripNull(file:read(64)),
    		start = readBits(file:read(4), 32),
    		size = readBits(file:read(4), 32)
    	}
    end

    Also, the basic structure of a CTF:
    [PTF file with modified header] (CPTFHeader)
    [Patch files]
    [Patch file headers] (CTFPatchHeader)
    Geändert von Nielkie (09-24-2008 um 06:18 AM Uhr)

  27. #9447
    QJ Gamer Silver
    Points: 6.948, Level: 54
    Level completed: 99%, Points required for next Level: 2
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    657
    Points
    6.948
    Level
    54
    Downloads
    5
    Uploads
    0

    Standard

    Zitat Zitat von Nielkie Beitrag anzeigen
    It can be done repetitively easily...{code}
    Thank you VERY much. :Punk:
    PSP: PSP SLIM 2001 TA-088v2
    Custom Firmware: 5.00 M33-6

  28. #9448
    QJ Gamer Bronze
    Points: 5.381, Level: 47
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    550
    Points
    5.381
    Level
    47
    Downloads
    1
    Uploads
    0

    Standard

    Gah, "repetitively". Damn you FF spellcheck!

  29. #9449
    QJ Gamer Green
    Points: 5.981, Level: 50
    Level completed: 16%, Points required for next Level: 169
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Texas
    Beiträge
    146
    Points
    5.981
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I can't for the life of me figure out how to make a texture on a 3d object semi transparent, can someone help me out?
    [IMG]http://img.photobucket.com/albums/v693/fchaos/koolaidsig.jpg[/IMG]

  30. #9450
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    i'm not vary familiar with lua's 3D functions, however understanding openGL, and the pspgu, i'd suggest looking in the documentation for lua(which ever one your using, but i suspect pge?), for method calls which contain the word blend
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been


 

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

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