Zeige Ergebnis 8.611 bis 8.640 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; how do you get in to use the code?...
-
05-11-2008, 08:05 PM #8611
how do you get in to use the code?
-
05-11-2008, 09:08 PM #8612words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
omegaridley - You clearly didnt read my post correctly lol. I said nothing about moving things around or even to load after the code executes. i'm saying that in order for Ogg.EndOfStream() to return anything but nil, an Ogg must be loaded. That's all i'm saying for the second time. You should be able to figure out how to make sure an Ogg is loaded before executing code that contains Ogg.EndOfStream(), if not and even still please start with very early basics and fundamentals, learning by trial and error isn't a very good path to go.
scryerth - what...?
...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
-
05-11-2008, 11:58 PM #8613QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
It sounds like you have a problem with your PSP, not LUA. LUA is just a scripting language for creating basic applications and games. Go post in the PSP General Help forum.
Zitat von scryerth
-
05-12-2008, 03:58 AM #8614
- Registriert seit
- Mar 2008
- Beiträge
- 40
- Points
- 2.784
- Level
- 32
- Downloads
- 0
- Uploads
- 0
i DO have an OGG loaded before the Ogg.EndOfStream(), look at my code:
Zitat von SG57
but it STILL returns nil...Code:white = Color.new(255, 255, 255) green = Color.new(0, 255, 0) background = Image.load("SYSTEM/images/background.png") Ogg.load("SYSTEM/music/system.ogg") while true do done = false pad = Controls.read() if pad:cross() and done == false then System.message("UMD ISO will be dumped in name 9660.ISO, if u have a UMD dumped by this app, rename the ISO in the memory stick. Are you ready to dump the UMD?",1) button = System.buttonPressed(1) if button == "yes" then UMD.ripISO("ms0:/ISO/9660.ISO") end button = System.buttonPressed(1) if button == "no" then end done = true end if done == false then if Ogg.EndOfStream() == "true" then Ogg.play() end screen:blit(0, 0, background, false) screen:print(1, 1, "Press X to Dump UMD Game", white) end
i have tried Ogg.eos() and the error goes away, but doesnt loop the song...?Geändert von omegaridley (05-12-2008 um 04:37 AM Uhr) Grund: Automerged Doublepost
-
05-12-2008, 06:25 AM #8615Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Code:white = Color.new(255, 255, 255) green = Color.new(0, 255, 0) background = Image.load("SYSTEM/images/background.png") Ogg.load("SYSTEM/music/system.ogg") Ogg.play() while true do done = false pad = Controls.read() if pad:cross() and done == false then System.message("UMD ISO will be dumped in name 9660.ISO, if u have a UMD dumped by this app, rename the ISO in the memory stick. Are you ready to dump the UMD?",1) button = System.buttonPressed(1) if button == "yes" then UMD.ripISO("ms0:/ISO/9660.ISO") end button = System.buttonPressed(1) if button == "no" then end done = true end if done == false then if Ogg.EndOfStream() == "true" then Ogg.play() end screen:blit(0, 0, background, false) screen:print(1, 1, "Press X to Dump UMD Game", white) end------ 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).
-
05-12-2008, 01:36 PM #8616Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I need help. Not with scripting but generally, i dont understand wifi much and 3d and would like to know if there are any gd snippets/examples etc. Also with wifi you connect to an server? ( i think) could you possible connect to an web pg OR would you have 2 have your own server, if So how would you make an server?
-
05-12-2008, 01:37 PM #8617Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
------ 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).
-
05-12-2008, 01:57 PM #8618
I still cant get the Ogg to work...
-= Double Post =-
oops ignore my post, wrong forum...
Zitat von jaki54321
Geändert von jaki54321 (05-12-2008 um 01:57 PM Uhr) Grund: Automerged Doublepost
-
05-13-2008, 12:45 AM #8619
So far i've created a basic menu for a game but i can't go into a sub-menu. When i go into the sub-menu it will execute the file once then go back to the main menu so i'm wondering what the best way to fix this is (i'm guessing some kind of loop)
EDIT: The sub-menu is a separate .lua file loaded into the main script through dofile
-
05-13-2008, 01:28 AM #8620Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Could you post the code up? by sub-menu do u mean options, credits etc.
-
05-13-2008, 08:46 AM #8621Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
there is your problem
Zitat von drag_93
------ 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).
-
05-13-2008, 01:58 PM #8622QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
No, the problem is that he does not have a main loop in his sub-menu. My guess is that he copied the menu code from somewhere and has no idea how games and applications usually run.
-
05-16-2008, 10:13 AM #8623QJ Gamer Blue
- Registriert seit
- Jun 2007
- Ort
- Melfi PZ
- Beiträge
- 76
- Points
- 4.074
- Level
- 40
- Downloads
- 0
- Uploads
- 0
how i can go to next line (with one string?) i used '\n' but it din't work
(i see the square)
-
05-16-2008, 10:46 AM #8624Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
This would be an better example were u would use \n :)Code:file:write("Player.x = 165 "...\n)Geändert von dan369 (05-16-2008 um 12:22 PM Uhr)
-
05-16-2008, 11:22 AM #8625QJ Gamer Blue
- Registriert seit
- Jun 2007
- Ort
- Melfi PZ
- Beiträge
- 76
- Points
- 4.074
- Level
- 40
- Downloads
- 0
- Uploads
- 0
i will try thank you
-
05-16-2008, 12:29 PM #8626Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
you can only use the \n statement when saving to a file, you cant for examplr do this
screen
rint(10, 10, "hello\n hi")
as it will be on one line, if you load it from a file then you can use
for line in file:lines() do
end
to display then sequentially on the screen------ 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).
-
05-16-2008, 01:39 PM #8627QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Wow...i haven't coded lua in a while. Do you guys recommend that i go back to it?
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-16-2008, 01:40 PM #8628Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
not if you know c no
------ 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).
-
05-16-2008, 01:42 PM #8629QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Why not? Lua is like a sexy blonde chick. They are really hot and juicy, but they are very simple and ignorant to be enticed into your malicious intentions.
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-16-2008, 01:43 PM #8630Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
lol fine but there isnt much left to make, it mainly just for the fun of it that people make stuff in lua anymore
------ 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).
-
05-16-2008, 02:54 PM #8631Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
so true :)
Zitat von FaT3oYCG
-
05-16-2008, 03:11 PM #8632
actually, there havent been many fun card games in lua that i know of, i am making one based of uno, when it is at least playable i am gonna release it
Zitat von FaT3oYCG
My Projects
[URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
working on Zuno, an uno like game
[QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]
-
05-16-2008, 06:08 PM #8633QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
Not True ifiwere1337: PSPMillionaire BEST Lua Game Ever
-
05-16-2008, 07:14 PM #8634
thats not a card game, is it?
Zitat von xpack
My Projects
[URL="http://www.megaupload.com/?d=Q860B1VV"]BUMPER HARVEST MOD - PEGGLE DELUXE BETA 1[/URL]
working on Zuno, an uno like game
[QUOTE=FreePlay]It's a picture of a monkey. There, I spoiled it for you.[/QUOTE]
-
05-17-2008, 03:16 AM #8635Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I wouldn't call PSPMillionaire an Card game
Zitat von xpack
more like an question game.
-
05-21-2008, 10:54 PM #8636QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
Just wondering, is there a known limitation in LuaPlayer 0.16 in that it doesn't support semi-transparency when blitting to an image?
-
05-22-2008, 05:03 AM #8637QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
I don't know for SURE but I almost always run stuff on 0.16 modded with a couple extra functions and I've never had any issues. Details about what you might be referring to and I'll try to recreate it
-
05-22-2008, 05:34 AM #8638QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
Well, I've got a image buffer, on which I blit unanimated objects at the start of a level and whenever something changes. I just noticed when I transfered one of my more complex objects (rather than just the little sprites I've only been using previously) from my blit-every-frame table to my blit-to-the-buffer table, that it was blocky and aliased. This seams to be because all semi-transparent pixels are being made fully-transparent. Here is the basic scenario:
The example image is attached, you will notice is looks a lot better when blitted directly.Code:object = {} object.pics = {side = Image.load("side.png")} object[1] = {type = "hexagonthing",x = 0, y = 0, width = 30,height = 30} --This would be created by an object.new function object.intFunction = { ["hexagonthing"] = function(aObject) object.buffer:blit(aObject.x,aObject.y,object.pics.side) end } object.intDraw = function() object.buffer = Image.createEmpty(480,272) object.buffer:clear(Color.new(0,0,0)) for i,aObject in ipairs(object) do object.intFunction[aObject.type](aObject) end end object.intDraw() while true do screen:blit(0,0,object.buffer) screen.waitVblankStart() screen.flip() end
P.S. Yeah, 0.16 is great apart from the few annoying things that are broken(SIO,Font:getTextSi ze, etc.)Geändert von Nielkie (05-22-2008 um 06:00 AM Uhr)
-
05-22-2008, 09:20 AM #8639Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
OK, How would you make an object move without an if statement, AI? I want to move sumthing left and right without any IF statement.
Also How would you do it that so when the object is going back and forth and you hit into this object that you would DIE?
Note: Not good with collisions or Ai, thats why i'm asking 4 help :)
-
05-22-2008, 03:04 PM #8640
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
If you're going to make an AI it's probably going to have at least one if statement in it. If you want it to walk three spaces left then three spaces right and then loop you'd have to make a loop that checked its position or a counter and caused it to step left until its position was as far left as you wanted and then step right until its position was as far right as you wanted.
step = 0
while 1 do
if step < 3 then
stepleft()
else
stepright()
end
step = (step + 1) % 6
end
As for collision detection you'll just need to compare your x,y with the object's x,y and if they're equal then trigger your 'die' event or whatever. Sorry, this question is really too vague to give more of an answer.
There are tutorials available on AI and collision around the scene. Poke around a bit and see what you can find. These things are not as mysterious or difficult as they may sound.


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum