Seite 340 von 342 ErsteErste ... 240 290 330 331 332 333 334 335 336 337 338 339 340 341 342 LetzteLetzte
Zeige Ergebnis 10.171 bis 10.200 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; sigh, my code was perfect for what you wanted, if you set the directionFlag to 0 in my code then ...

  
  1. #10171
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    sigh, my code was perfect for what you wanted, if you set the directionFlag to 0 in my code then it stops moving, to fade in and out pictures you would have to use transparency and set the alpha value, i suggest you use pge luaplayer


    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  2. #10172
    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 hupengwei Beitrag anzeigen
    this is mine.i firmly know how to Move,But i want to {STOP},how to stop is the question.
    Past any number for MType expect for 1-4.

    Ps this code moves two fast,and how to slow it down??
    Change the speed.

  3. #10173
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    Past any number for MType expect for 1-4.
    en,,,i dont konw what you mean,could speak some easy English???

    Change the speed.
    even change the speed to 1 i think it is still too fast^_^
    could we slow it a little more?

  4. #10174
    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

    Standard

    Zitat Zitat von hupengwei Beitrag anzeigen
    en,,,i dont konw what you mean,could speak some easy English???


    even change the speed to 1 i think it is still too fast^_^
    could we slow it a little more?
    Your code is hardcoded but...
    Anyway, Mtype has a range from 1-4, you check if Mtype == 1-4. If Mtype isn't in the range of 1-4 then you've 'stopped' whatever you were moving. It doesn't get easier than that.
    You can have it as fast/slow as you want it, use a float i.e 0.2345.

  5. #10175
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    get clear of it...
    another problem appears
    the lua skipped the command " Message("嘿~跑得了和尚跑不了庙,你们能往 哪里逃?","LiXiaoYao","001"," 李逍遥",false)"
    Code:
    --┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
    --│Windows XP For PSP                                      │ 
    --│制作人:胡鹏伟                                           │
    --│联系我:QQ:315362463   E—mail:[email protected]     │
    --┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
    --###########################################################
    --■ 0000002.lua
    -------------------------------------------------------------
    --     本部分主要用于储存地图0000002的内容。(罗刹洞口)
    --###########################################################
    --背景图片
    MapBack = Image.load("Pictures/Maps/0000002/Stage0000002.png")
    --背景音乐
    --可行动区域
    --事件位置与内容
     event={}
     event[1]={x=1,y=1,runtype=true,move=false}
     event[2]={x=1,y=1,runtype=false,move=false}
     event[3]={x=1,y=1,runtype=false,move=false}
     event[4]={x=1,y=1,runtype=false,move=false}
    function Event(num)
     if num == 1 then
      img1 = Image.load("Pictures/Maps/0000002/Event1.png")
      x=480
      y = 270
      while y>130 do
       screen:blit(0,0,MapBack)
       screen:blit(x,y,img1)
       x=x-2
       y=y-1
       screen.flip()
       screen.waitVblankStart()
      end 
      Message("嘿~跑得了和尚跑不了庙,你们能往哪里逃?","LiXiaoYao","001","李逍遥",false)
      screen:clear()
      screen:blit(0,0,MapBack)
      screen:blit(x,y,img1)
      while y>100 do
       screen:blit(0,0,MapBack)
       screen:blit(x,y,img1)
       x=x-2
       y=y-1
       screen.flip()
       screen.waitVblankStart()
      end 
     end
    end
    the following is the code of "message":
    Code:
     --┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
    --│Windows XP For PSP                                      │ 
    --│制作人:胡鹏伟                                           │
    --│联系我:QQ:315362463   E—mail:[email protected]     │
    --┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
    --###########################################################
    --■ Function_Message
    -------------------------------------------------------------
    --     本部分主要用于显示对话框。
    --###########################################################
    function Message(text,person,number,name,l_side)
     SaveScreen(0,0,480,272,scr)
     Mback=Image.load("Pictures/System/Message.png")
     Mperson=Image.load("Pictures/Heads/"..person.."/"..number..".png")
     Mname=Image.load("Pictures/System/ShowName.png")
     --定位图片,定位
     local mx =1
     local my =1
     local sx =1
     local sy =1
     if l_side==1 then
      mx=0
      my=152
      sx=97
      sy=210
      nx=97
     else 
      mx=480-Mperson:width()
      my=152
      sx=10
      sy=210
      nx=264
     end
     --处理文字信息
     local lines={}
     lines[1]=string.sub(text,1,46)
     lines[2]=string.sub(text,47,92)
     lines[3]=string.sub(text,93,138)
     while true do
      if pad:circle() then
       break
      end
      screen:clear()
      screen:blit(0,0,scr)
      screen:blit(0,192,Mback)
      screen:blit(mx,my,Mperson)
      screen:blit(nx,160,Mname)
      GbkPrint(nx+30,168,name,yellow)
      GbkPrint(sx,sy,lines[1],white)
      GbkPrint(sx,sy+16,lines[2],white)
      GbkPrint(sx,sy+32,lines[3],white)
      screen.flip()
      screen.waitVblankStart()
     end  
    end
    function SaveScreen(left,top,width,height,scr)
        scr = scr or screen
        if scr ~= screen then
            tmp_canvas = Image.createEmpty(width,height)
            tmp_canvas:blit(0,0,scr,left,top,width,height)
        else
            screen.flip()
            tmp_canvas = Image.createEmpty(width,height)
            tmp_canvas:blit(0,0,scr,left,top,width,height)
            screen.flip()
        end
    end

  6. #10176
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    figured it out myself

  7. #10177
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    a question :
    i konw that if i input
    Code:
    h={}
    h[x]={y=125,z=25}
    then when i want to use the data 25,i could simply input
    Code:
    a=h[x][z]
    but what should i do to get the value of x if i know that"y=125,z=25" ??

  8. #10178
    QJ Gamer Silver
    Points: 12.453, Level: 73
    Level completed: 1%, Points required for next Level: 397
    Overall activity: 80,0%

    Registriert seit
    Mar 2007
    Beiträge
    1.129
    Points
    12.453
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    I don't think I understand your question. Could you please rephrase that?

  9. #10179
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    i want a function that can output a number x,which makes h[x].y=125,h[x].z=25.

  10. #10180
    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 sounds like you're doing something retarded, but hey.

    Code:
    function youFail(t)
    	for k, v in ipairs(t) do
    		if v.y == 125 and v.z == 25 then
    			return k
    		end
    	end
    end

  11. #10181
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nielkie Beitrag anzeigen
    It sounds like you're doing something retarded, but hey.
    haha you just gotta love Nielkie .
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  12. #10182
    Points: 1.768, Level: 24
    Level completed: 68%, Points required for next Level: 32
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Jul 2009
    Beiträge
    26
    Points
    1.768
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard writing codes is a really confusing thing......

    problem happened again!
    When i used the comand"ShowStage(4,12,9)" ,i get an message:
    can't compare nil with a number
    i don`t know why.
    i put the following between "local dxmax=MapBack:width()/16
    local dymax=MapBack:height()/16" and" if dx<dxmax+1 and dx>0 then
    if dy<dymax+1 and dy>0 then".To my surprise ,dx and dy is nil???
    writing codes is a really confusing thing......
    Code:
     while true do
      screen:clear()
      GbkPrint(0,0,Moveable[9][11],white)
      GbkPrint(0,16,dx..dy,white)
      GbkPrint(0,32,px..py,white)
      screen.flip()
      screen.waitVblankStart()
     end
    the following is the codes for ShowStage(direction,px,py )
    Code:
    function JudgeMove(direction,px,py)
     if dircetion==4 then
      dx=px-1
      dy=py
     end
     if direction==6 then
      dx=px+1
      dy=py
     end
     if direction==8 then
      dx=px
      dy=py-1
     end
     if direction==2 then
      dx=px
      dy=py+1
     end
     local dxmax=MapBack:width()/16
     local dymax=MapBack:height()/16
     --出界判定
      if dx<dxmax+1 and dx>0 then
        if dy<dymax+1 and dy>0 then
     --不可行动区域判定
         if Moveable[dy][dx]==1 then
     --事件阻挡判定
          if MapEvent[dx][dy]~=1 then
    	   return true
            end
         end
        end
       end
    end

  13. #10183
    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

    Code:
    if dircetion==4 then
    Your error is caused by this line. It should be really obvious why if you look carefully and consider the possible reasons for a variable to be nil.

  14. #10184
    Lua Coder
    Points: 18.915, Level: 87
    Level completed: 13%, Points required for next Level: 435
    Overall activity: 99,0%

    Registriert seit
    Jan 2008
    Ort
    Iowa
    Beiträge
    834
    Points
    18.915
    Level
    87
    My Mood
    Busy
    Downloads
    2
    Uploads
    0

    Standard

    can i put a table with in a table? ie
    image = {
    x = 10,
    y = 20,
    buffer = {x = 2, y = 3},
    }
    ...

  15. #10185
    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

    Why don't you try?

    Lua code - 9 lines - codepad

  16. #10186
    Lua Coder
    Points: 18.915, Level: 87
    Level completed: 13%, Points required for next Level: 435
    Overall activity: 99,0%

    Registriert seit
    Jan 2008
    Ort
    Iowa
    Beiträge
    834
    Points
    18.915
    Level
    87
    My Mood
    Busy
    Downloads
    2
    Uploads
    0

    Standard 3d in luaplayer

    im trying to figure out how the 3d functions in lua player work, so i modifyed the cube demo:
    Code:
    System.usbDiskModeActivate()
    
    -- Colors
    red = Color.new(255, 0, 0) 
    orange = Color.new(255, 140, 0)
    yellow= Color.new(255, 255, 0)
    green = Color.new(0, 255, 0) 
    blue = Color.new(0, 0, 255)
    blue2 = Color.new(30, 144, 255)
    blue3 = Color.new(16, 78, 139)
    blue4 = Color.new(25, 25, 112)
    purple = Color.new(153, 50, 204)
    pink = Color.new(255, 110, 199)
    black = Color.new(0, 0, 0)
    brown = Color.new(107, 66, 38)
    white = Color.new(255, 255, 255)
    grey = Color.new(84, 84, 84)
    light_grey = Color.new(211, 211, 211)
    silver = Color.new(230, 232, 250)
    
    -- Move Values
    movX = 0
    movY = 0
    movZ = -10
    extra = 0
    -- Rotate Values
    rotX = 0
    rotY = 0
    rotZ = 0
    
    -- Loads Seamless Image To Tile On Cube
    logo = Image.createEmpty(64, 64)
    logo:clear(silver)
    logo:print(5, 8, "Lua", black)
    logo:print(10, 17, "3D", black)
    
    
    require("System\\analog")
    require("System\\cube")
    
    while true do
    pad = Controls.read()
    screen:clear(white)
    	analogSet(1,1)
    Gu.start3d()
    	-- clear screen
    		Gu.clearDepth(0);
    		Gu.clear(Gu.COLOR_BUFFER_BIT|Gu.DEPTH_BUFFER_BIT)
    	-- setup projection and view matrices
    		Gum.matrixMode(Gu.PROJECTION)
    		Gum.loadIdentity()
    	-- perspective length, ratio(15/8.5 is psp screen), how close to screen you can get to object before break point
    		Gum.perspective(25, 15/8.5, .5, 10000)
    		Gum.matrixMode(Gu.VIEW)
    		Gum.loadIdentity()
    	-- setup texture
    		Gu.enable(Gu.BLEND)
    		Gu.enable(Gu.TEXTURE_2D);
    		Gu.texImage(logo)
    	-- Colors/Textures Object
    		Gu.texFunc(Gu.TFX_MODULATE, Gu.TCC_RGBA)
    	-- Makes Smooth
    		Gu.texEnvColor(white)
    		Gu.texFilter(Gu.LINEAR, Gu.LINEAR)
    	-- Scale of Texture, large number small texture is, slower fps
    		Gu.texScale(.25, .25)
    	-- setup matrix for cube
    		Gum.matrixMode(Gu.MODEL)
    		Gum.loadIdentity()
    		Gum.translate(movX, movY, movZ)
    		Gum.rotateXYZ(rotX, rotY, rotZ)
    	-- draw cube
    		Gum.drawArray(Gu.TRIANGLES, Gu.TEXTURE_32BITF|Gu.COLOR_8888|Gu.VERTEX_32BITF|Gu.TRANSFORM_3D, cube[0])
    Gu.end3d()
    	
    	if pad:start() then
    		break
    	end
    
    	screen.waitVblankStart()
    	screen.flip()
    end
    i want to make a line of cubes so i have the for i=0,3 do thing. I want it so whatever i is you add/subtract it to the x of the cube:
    Code:
    for i=0,3 do 
    cube[i] = {
    -- Each 3 part section create a triagnle
    	-- unknown,unknown, color, x, y, z
    	{0, 0, red, -1+i, -1,  1},  -- 0
    	{2, 0, red, -1+i,  1,  1},  -- 4
    	{2, 2, red,  1+i,  1,  1},  -- 5
    
    	{0, 0, red, -1+i, -1,  1},  -- 0
    	{2, 2, red,  1+i,  1,  1},  -- 5
    	{0, 2, red,  1+i, -1,  1},  -- 1
    
    	{0, 0, orange, -1+i, -1, -1},  -- 3
    	{2, 0, orange,  1+i, -1, -1},  -- 2
    	{2, 2, orange,  1+i,  1, -1},  -- 6
    
    	{0, 0, orange, -1+i, -1, -1},  -- 3
    	{2, 2, orange,  1+i,  1, -1},  -- 6
    	{0, 2, orange, -1+i,  1, -1},  -- 7
    
    	{0, 0, yellow,  1+i, -1, -1},  -- 0
    	{2, 0, yellow,  1+i, -1,  1},  -- 3
    	{2, 2, yellow,  1+i,  1,  1},  -- 7
    
    	{0, 0, yellow,  1+i, -1, -1},  -- 0
    	{2, 2, yellow,  1+i,  1,  1},  -- 7
    	{0, 2, yellow,  1+i,  1, -1},  -- 4
    
    	{0, 0, green, -1+i, -1, -1},  -- 0
    	{2, 0, green, -1+i,  1, -1},  -- 3
    	{2, 2, green, -1+i,  1,  1},  -- 7
    
    	{0, 0, green, -1+i, -1, -1},  -- 0
    	{2, 2, green, -1+i,  1,  1},  -- 7
    	{0, 2, green, -1+i, -1,  1},  -- 4
    
    	{0, 0, blue, -1+i,  1, -1},  -- 0
    	{2, 0, blue,  1+i,  1, -1},  -- 1
    	{2, 2, blue,  1+i,  1,  1},  -- 2
    
    	{0, 0, blue, -1+i,  1, -1},  -- 0
    	{2, 2, blue,  1+i,  1,  1},  -- 2
    	{0, 2, blue, -1+i,  1,  1},  -- 3
    
    	{0, 0, purple, -1+i, -1, -1},  -- 4
    	{2, 0, purple, -1+i, -1,  1},  -- 7
    	{2, 2, purple,  1+i, -1,  1},  -- 6
    
    	{0, 0, purple, -1+i, -1, -1},  -- 4
    	{2, 2, purple,  1+i, -1,  1},  -- 6
    	{0, 2, purple,  1+i, -1, -1},  -- 5
    }
    end
    there is no error code, is there anything that i am doing wrong
    ...

  17. #10187
    Lua Coder
    Points: 18.915, Level: 87
    Level completed: 13%, Points required for next Level: 435
    Overall activity: 99,0%

    Registriert seit
    Jan 2008
    Ort
    Iowa
    Beiträge
    834
    Points
    18.915
    Level
    87
    My Mood
    Busy
    Downloads
    2
    Uploads
    0

    Standard

    what i meam by no error code is that all i get is
    Code:
    Error: No script file found
    press start to restart
    ...

  18. #10188
    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 cmbeke Beitrag anzeigen
    what i meam by no error code is that all i get is
    Code:
    Error: No script file found
    press start to restart
    That's your error. LuaPlayer can't find the script file.

  19. #10189
    QJ Gamer Blue
    Points: 1.900, Level: 25
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Some where
    Beiträge
    61
    Points
    1.900
    Level
    25
    Downloads
    1
    Uploads
    1

    Standard

    Hey guys, I need some help..

    i need to figure out how to download files from a URL Using lua Player, Is there any function of that sort in LuaPlayer?

    -Manaxed

  20. #10190
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    which version by which author?

    PGE has a pge.net.getfile() function
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  21. #10191
    QJ Gamer Blue
    Points: 1.900, Level: 25
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Some where
    Beiträge
    61
    Points
    1.900
    Level
    25
    Downloads
    1
    Uploads
    1

    Standard

    Hey guys what's wrong with this code?

    myfile = pge.file.open(”info.txt”, PGE_FILE_RDONLY)

    i get error message unexpected symbol near 'Ö'.

    The rest of my program is...

    Spoiler for OPEN:

    verdana16 = pge.font.load("verdana.tt f", 16, PGE_RAM)


    if not verdana16 then
    error("Failed to load font.")
    end


    if not pge.net.init() then
    error("Error on net init.")
    end


    if not pge.utils.netinit() then
    error("Error on net dialog init.")
    end


    white = pge.gfx.createcolor(255, 255, 255)




    while pge.running() do



    pge.gfx.startdrawing()


    pge.gfx.clearscreen()

    verdana16:activate()

    if pge.net.isconnected() then
    verdana16rintcenter(130, white, "UPDATING INFORMATION...")
    else
    verdana16rintcenter(130, white, "ERROR.. YOU ARE NOT CONNECTED TO WLAN.")
    end

    pge.gfx.enddrawing()


    pge.gfx.swapbuffers()

    if pge.net.isconnected() then


    pge.net.getfile("http://manaxed.freehostia.com/info.txt", "info.txt")


    pge.net.shutdown()


    pge.gfx.startdrawing()


    pge.gfx.clearscreen()


    verdana16:activate()


    verdana16rintcenter(130, white, "Finished UPDATING!")


    pge.gfx.enddrawing()


    pge.gfx.swapbuffers()
    string = " "
    i=130
    while pge.running() do
    while string~=null do

    myfile = pge.file.open(”info.txt”, PGE_FILE_RDONLY)
    name = pge.file.read(myfile, 15)
    fid = pge.file.read(myfile, 5)
    pge.gfx.startdrawing()
    pge.gfx.clearscreen()
    verdana16rintcenter(i, white, name)
    i=i+10
    pge.gfx.enddrawing()
    pge.gfx.swapbuffers()
    end
    end
    while pge.running() do
    pge.controls.update()
    if pge.controls.pressed(PGE_ CTRL_START) then
    if pge.net.isconnected() then
    pge.net.getfile("http://dl.qj.net/dl.php?fid="..fid, name..".zip")
    else
    break
    end
    end




    -Manaxed.
    Enter Signature Here.

  22. #10192
    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

    Standard

    Try:
    myfile = pge.file.open(”info.txt”, PGE_FILE_RDONLY+PGE_FILE_ CREATE)

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

    Probably something wrong with the speech marks. ” is not the same as ".

  24. #10194
    QJ Gamer Blue
    Points: 1.900, Level: 25
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Some where
    Beiträge
    61
    Points
    1.900
    Level
    25
    Downloads
    1
    Uploads
    1

    Standard

    na i got it to work had to retype but now im havin a hard time reading from a text file...
    -manaxed
    Enter Signature Here.

  25. #10195
    The German Guy
    Points: 3.797, Level: 38
    Level completed: 98%, Points required for next Level: 3
    Overall activity: 0%

    Registriert seit
    Apr 2009
    Ort
    germany
    Beiträge
    163
    Points
    3.797
    Level
    38
    My Mood
    Hungover
    Downloads
    5
    Uploads
    1

    Standard

    Can somebody tell me how to write something into a file by using SystemOSK?
    I tried this:
    Code:
    nickname = System.startOSK("","Enter your name")
    name = io.open("name.txt","w")
    name:write(nickname)
    name:close()
    but it does not write...

  26. #10196
    QJ Gamer Blue
    Points: 1.689, Level: 23
    Level completed: 89%, Points required for next Level: 11
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Mantis Coder Home.
    Beiträge
    19
    Points
    1.689
    Level
    23
    Downloads
    0
    Uploads
    0

    Standard

    How do I copy a file then paste it in another directory?

  27. #10197
    Lua Coder
    Points: 18.915, Level: 87
    Level completed: 13%, Points required for next Level: 435
    Overall activity: 99,0%

    Registriert seit
    Jan 2008
    Ort
    Iowa
    Beiträge
    834
    Points
    18.915
    Level
    87
    My Mood
    Busy
    Downloads
    2
    Uploads
    0

    Standard

    try this, it "fakes" copying a file
    Code:
    -- Sets locations of oringial file and place to copy it
    orignialFile = "ms0:/psp/common/file.txt"
    copyFile = "ms0:/psp/game/luaplayer/file.txt"
    
    -- Opens files to read and write
    file = io.open(oringinalFile,"r")
    copy = io.open(copyFile,"w")
    
    -- writes entire "oringinal file" to the new copy
    copy:write(file)
    
    -- Closes the files
    file:close()
    copy:close()
    
    -- removes the oringial file (optional)
    os.remove(orignialFile)

  28. #10198
    QJ Gamer Green
    Points: 2.617, Level: 31
    Level completed: 12%, Points required for next Level: 133
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Czech Republic
    Beiträge
    41
    Points
    2.617
    Level
    31
    My Mood
    Amazed
    Downloads
    0
    Uploads
    0

    Standard

    Please help me...

    here IS LINK:
    I need a help ! (LUA code sample)

    I really need this...its urgent for my next project
    i need it until 25-12-2009

    Plss,I donate 10-15 dollars for help..thanks !
    [CENTER][B][COLOR="DarkOrange"]PSP Slim/Lite (4.01M33)[/COLOR] | [COLOR="Sienna"]Asus Jupiter (WM 6.1) [/COLOR]| X[COLOR="DarkRed"]box1(EvoX+linux)[/COLOR] | [COLOR="Red"]Asus EEE 901[/COLOR][/B][/CENTER]
    [B][CENTER]Sorry about my weak english[/CENTER][/B]
    [CENTER][COLOR="SandyBrown"]PSP Developer from czech[/COLOR][/CENTER]

  29. #10199
    Points: 1.369, Level: 20
    Level completed: 69%, Points required for next Level: 31
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Dec 2009
    Ort
    east brunswick
    Beiträge
    7
    Points
    1.369
    Level
    20
    Downloads
    0
    Uploads
    0

    Standard

    I apologize for asking something nooby in advance. >_<


    Alright, so i'm working on an rts, however, i have no idea how to make the cursor move.
    I've been looking through some peoples code, and have not been able to find a way to get this done

    This is what i have so far. (-.-), also, how would i go about making the cursor go faster the farther you push along the analog pad?
    Code:
    if pge.controls.analogx() < -50 then
    
    end
    
    if pge.controls.analogx() > 50 then
    
    end
    
    if pge.controls.analogy() < -50 then
    
    
    end
    if pge.controls.analogy() > 50 then
    
    
    end

  30. #10200
    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

    Zitat Zitat von Creek Beitrag anzeigen
    I apologize for asking something nooby in advance. >_<


    Alright, so i'm working on an rts, however, i have no idea how to make the cursor move.
    I've been looking through some peoples code, and have not been able to find a way to get this done

    This is what i have so far. (-.-), also, how would i go about making the cursor go faster the farther you push along the analog pad?
    Code:
    if pge.controls.analogx() < -50 then
    
    end
    
    if pge.controls.analogx() > 50 then
    
    end
    
    if pge.controls.analogy() < -50 then
    
    
    end
    if pge.controls.analogy() > 50 then
    
    
    end
    it's simply variable adding and subtracting, if u want to go left, subtract the mouse's x value
    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:00 PM Uhr.

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