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; do you mean: "How can I run my LUA program without using LUAPlayer?" or literally, how do you run an ...
-
07-01-2007, 04:37 PM #7621QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
do you mean:
"How can I run my LUA program without using LUAPlayer?"
or literally, how do you run an eboot with a LUA script?
if it's the second one, i'm not sure if you can
-
07-01-2007, 04:43 PM #7622QJ Gamer Green

- Registriert seit
- Oct 2006
- Ort
- Cd. Juarez Mexico -
- Beiträge
- 341
- Points
- 8.244
- Level
- 61
- Downloads
- 0
- Uploads
- 0
-
07-01-2007, 04:46 PM #7623QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
i don't know, i never actually looked at the luaplayer source
Zitat von luizlizard
-
07-01-2007, 05:44 PM #7624lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
You cant.
-
07-01-2007, 05:53 PM #7625QJ Gamer Green

- Registriert seit
- Oct 2006
- Ort
- Cd. Juarez Mexico -
- Beiträge
- 341
- Points
- 8.244
- Level
- 61
- Downloads
- 0
- Uploads
- 0
-
07-01-2007, 05:53 PM #7626QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Of course you can add functions to luaplayer. You just need an SDK setup, the right libs, and a non-lua mindset as LuaPlayer is in C++.
-
07-01-2007, 07:25 PM #7627QJ Gamer Green

- Registriert seit
- Oct 2006
- Ort
- Cd. Juarez Mexico -
- Beiträge
- 341
- Points
- 8.244
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Ok, i added the function to the source, but i only have the precompiled toolchain (pspdev) so i can't compile it, can someone compile it for me?
Here it is: http://luizlizard.pspsc.com/downloads/luasystem.cpp
And just add it to the regular Lua Player .20 source.
Thanks in Advance!!!
-
07-01-2007, 11:41 PM #7628words 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
you don't need to know how Lua Player is designed to add functions to it. look at my mods (flashing capabilities, IR keyboard (didn't release as pi key released soon after and havent had a time to implement it into it) and some directory functions (dump umd, etc.)). It just takes some observational skills ;)

...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
-
07-06-2007, 09:26 AM #7629Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
hey luizlizard when i compile lua player with the luasystem.cpp you made it just makes a black screen appear when i load it from my psp and i put the system and apps folder in and added lowser and all the oter stuff in the apps folder. but it compiles without errors do u know why coz i was trying to make one with all of the functions you included also can you add the nickName function the code is
-------------------------------
static int lua_nickName(lua_State *L)
{
if (lua_gettop(L) != 0) return luaL_error(L, "no arguments expected.");
char *namebuffer = "";
sceUtilityGetSystemParamS tring(1, namebuffer, 25);
lua_pushstring(L, namebuffer);
return 1;
}
-------------------------------
and the line is
-------------------------------
{"nickName", lua_nickName},
-------------------------------
-
07-06-2007, 03:25 PM #7630
- Registriert seit
- Jul 2007
- Beiträge
- 44
- Points
- 3.279
- Level
- 35
- Downloads
- 0
- Uploads
- 0
sorry im new to this but can lua work on psp version 2.81?
-
07-06-2007, 03:30 PM #7631QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
You got to have a homebrew capable PSP firmware
-
07-06-2007, 08:51 PM #7632
xpack was trying to say no
-= Double Post =-
but i'm pretty sure with all these updates at qj you can downgrade your firmware nowGeändert von emericaska8r (07-06-2007 um 08:52 PM Uhr) Grund: Automerged Doublepost
-
07-08-2007, 07:24 AM #7633Veteran
- Registriert seit
- Jul 2006
- Ort
- Location?
- Beiträge
- 1.863
- Points
- 19.082
- Level
- 87
- Downloads
- 0
- Uploads
- 0
Simple, how do I make an image display for a period of time, then go away when the player presses... say... X?
I already have the image loaded. :)This signature has been raped by the rep system
-
07-08-2007, 08:52 AM #7634
@ TheSilenceOfNoOne :
Here is a example for you if you want to only remove the image from the screen:
My_Image = Image.load("My_Image.png" )
while true do
pad = Controls.read()
if pad:cross() then
My_Image:clear()
end
screen:blit(0, 0, My_Image)
screen.waitVblankStart()
screen.flip()
end
----------
Or like this if you want to completely remove the image from memory and not just the screen
My_Image = Image.load("My_Image.png" )
Display_Image = true
while true do
pad = Controls.read()
if pad:cross() then
Display_Image = false
My_Image = nil
collectgarbage()
end
if Display_Image == true then
screen:blit(0, 0, My_Image)
end
screen.waitVblankStart()
screen.flip()
end
-
07-08-2007, 08:58 AM #7635QJ Gamer Blue
- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 499
- Points
- 5.848
- Level
- 49
- Downloads
- 0
- Uploads
- 0
both of those are flawed...
Zitat von Xx_FightStar_xX
you want a bool for when X is pressed, set to T/F depending on what its already at.
Then the image blitted based on that.
-
07-08-2007, 09:00 AM #7636Veteran
- Registriert seit
- Jul 2006
- Ort
- Location?
- Beiträge
- 1.863
- Points
- 19.082
- Level
- 87
- Downloads
- 0
- Uploads
- 0
OK, so I am trying to do that with 3 images in a row.
Like this:?
Code:gbaxlogo = Image.load(other/slogo.png) gamelogo = Image.load(other/loading.png) teamlogo = other/Team.PNG) screen:blit(480, 272, gbaxlogo) while true do pad = Controls.read() if pad:cross() then screen:clear() while true do screen:blit(480, 272, teamlogo) if pad:cross() then screen:clear() while true do screen:blit(480, 272, gamelogo) if pad:cross() then screen:clear() end
This signature has been raped by the rep system
-
07-08-2007, 10:12 AM #7637QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
or
while not Constrols.read():cross() do
screen:blit(x,y,image)
end[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
07-08-2007, 11:06 AM #7638Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
what you are trying to do is a bit complicated give me about 10 mins
8 mins later lol
heres what i suggest
CODE:
-----------------------------------------------------------------------
gbaxlogo = Image.load(other/slogo.png)
gamelogo = Image.load(other/loading.png)
teamlogo = other/Team.PNG)
white = Colour.new(255, 255, 255)
while true do
pad = Controls.read()
CI = 0
if
pad:cross() and CI == 0
then
screen:blit(0, 0, gbaxlogo)
CI = 1
end
if
pad:cross() and CI == 1
then
screen:blit(0, 0, teamlogo)
CI = 2
end
if
pad:cross() and CI == 2
then
screen:blit(0, 0, gamelogo)
CI = 3
end
if
CI == 3
then
screen
rint(10, 10, now wasnt that cool, white)
CI = 0
end
screen.flip()
screen.waitVblankStart()
end
--------------------------------------------------Geändert von FaT3oYCG (07-08-2007 um 11:18 AM Uhr)
-
07-08-2007, 07:42 PM #7639
... no
Zitat von FaT3oYCG
what you have there will only blit the image the second 'x' is pressed. So you will basically never see it.
i'd just do:
it will cycle images everytime 'x' is pressed, and show nothing pst the third image ;)Code:img1 = Image.load("1.png") img2 = Image.load("2.png") img3 = Image.load("3.png") variable = 0 while true do screen:clear() if variable == 0 then screen:blit(0,0,img1) elseif variable == 1 then screen:blit(0,0,img2) elseif variable == 2 then screen:blit(0,0,img3) end pad = Controls.read() if pad:cross() then variable = variable + 1 end screen.flip() screen.waitVblankStart() end
-
07-08-2007, 09:27 PM #7640words 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
I would do something similar, except make it faster, more understandable and have it recyclable.
I believe you can do that in Lua.Code:image = { Image.load("1.png"), Image.load("2.png"), Image.load("3.png") } image_num = 1 exit = false while ~exit do if Controls.read():cross() then image_num = image_num + 1 if image_num > table.getn(image) then image_num = 0 end screen:clear() screen:blit(0,0,image[image_num]) screen.waitVblankStart() screen.flip() elseif Controls.read():start() then exit = true end end
...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
-
07-08-2007, 10:32 PM #7641QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
fixed.
Zitat von emericaska8r
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
07-08-2007, 10:45 PM #7642Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
heres what i suggest
CODE:
sorry about that heres my revised code
-----------------------------------------------------------------------
gbaxlogo = Image.load(other/slogo.png)
gamelogo = Image.load(other/loading.png)
teamlogo = other/Team.PNG)
white = Colour.new(255, 255, 255)
oldpad = pad
while true do
pad = Controls.read()
CI = 0
if
pad:cross() and oldpad:cross() ~= pad:cross and CI == 0
then
screen:blit(0, 0, gbaxlogo)
CI = 1
end
if
pad:cross() and oldpad:cross() ~= pad:cross and CI == 1
then
screen:blit(0, 0, teamlogo)
CI = 2
end
if
pad:cross() and oldpad:cross() ~= pad:cross and CI == 2
then
screen:blit(0, 0, gamelogo)
CI = 3
end
if
CI == 3
then
screenrint(10, 10, now wasnt that cool, white)
screen.waitVblankStart()
CI = 0
end
screen.flip()
screen.waitVblankStart()
oldpad = Controls.read()
end
--------------------------------------------------
-
07-09-2007, 05:26 AM #7643QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
you've screwed up some of your code:
where's Image.load() ?Code:gbaxlogo = Image.load(other/slogo.png) gamelogo = Image.load(other/loading.png) teamlogo = other/Team.PNG)
lua doesn't use the "u" in colour, it's "Color.new"Code:white = Colour.new(255, 255, 255)
[code]screenrint(10, 10, now wasnt that cool, white)
screen : print, not screenrint and you need quotes around the words
what happened to "if pad:cross() and oldpad:cross() ~= pad:cross then"Code:if CI == 3 then screenrint(10, 10, now wasnt that cool, white) screen.waitVblankStart() CI = 0 end
i think "CI = 0" should be declared before the main loopCode:while true do pad = Controls.read() CI = 0
also, put your whole code in [code] tags
-
07-09-2007, 05:51 AM #7644Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
sorry some of the things you sed were right but it was late at night and the screenrint bit is because on my first code post it makes : and P =

i origionally coppied the image load stuff from another post as this was meant to help someone.
and the pad cross stuff i dont want on the last one so it makes it automatically loop to start but i did forget the time in screenwaitvblankstart
make some images and test it it works like i meant it toCode:gbaxlogo = Image.load(other/slogo.png) gamelogo = Image.load(other/loading.png) teamlogo = Image.load(other/Team.PNG) white = Color.new(255, 255, 255) oldpad = pad while true do pad = Controls.read() CI = 0 if pad:cross() and oldpad:cross() ~= pad:cross and CI == 0 then screen:blit(0, 0, gbaxlogo) CI = 1 end if pad:cross() and oldpad:cross() ~= pad:cross and CI == 1 then screen:blit(0, 0, teamlogo) CI = 2 end if pad:cross() and oldpad:cross() ~= pad:cross and CI == 2 then screen:blit(0, 0, gamelogo) CI = 3 end if CI == 3 then screen:print(10, 10, "now wasnt that cool", white) screen.waitVblankStart(150) CI = 0 end screen.flip() screen.waitVblankStart() oldpad = Controls.read() end --------------------------------------------------
-
07-09-2007, 03:59 PM #7645Veteran
- Registriert seit
- Jul 2006
- Ort
- Location?
- Beiträge
- 1.863
- Points
- 19.082
- Level
- 87
- Downloads
- 0
- Uploads
- 0
Error arguments expected near "and" on line 30.
This signature has been raped by the rep system
-
07-09-2007, 05:18 PM #7646QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
your forgot the "()" at the end of pad:cross()Code:if pad:cross() and oldpad:cross() ~= pad:cross and CI == 0 then screen:blit(0, 0, gbaxlogo) CI = 1 end if pad:cross() and oldpad:cross() ~= pad:cross and CI == 1 then screen:blit(0, 0, teamlogo) CI = 2 end if pad:cross() and oldpad:cross() ~= pad:cross and CI == 2 then screen:blit(0, 0, gamelogo) CI = 3 end
-
07-09-2007, 08:05 PM #7647
oh yea i wasn't even thinking about putting in oldpad. thats a good idea so it won't cycle through them real fast with just pressing once
-
07-09-2007, 09:07 PM #7648Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
youre welcome and what were u useing this code for by the way???
my code was the best reference???
u think
thanks
-
07-10-2007, 01:33 AM #7649QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
ur coded doesnt work.
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
07-10-2007, 02:56 AM #7650Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
ill work on it itll be finished complete and working by the end of the week i have other things to do and its the least of my worries at the monent
family issues
time issues
prodject issues
work issues
and
DarK~AleX has left
could it get much worse for me------ 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).


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