can you go to flash chat on qj
-= Double Post =-
But first I need to give you my game, PMing now
Printable View
can you go to flash chat on qj
-= Double Post =-
But first I need to give you my game, PMing now
sure i'll be on flash chat soonZitat:
Zitat von pspfreak9
done sending PM im on flash chat now,
Does anyone know how to get the file size of the ms0:/ or flas0:/ LUA code though, I had a script with it but I cant seem to find it anymore
would this code work for a helllo world? just wnat to make sure
Code:AliceBlue=Color.new(240,248,255)
while true do
screen:clear()
screen:print(320,160 "Hello World, by michaelp",AliceBlue)
screen.waitVblankStart()
screen.flip()
end
Look here: http://forums.qj.net/f-psp-developme...rld-14654.htmlZitat:
Zitat von michaelp
yes, that will work.Zitat:
Zitat von michaelp
okay thanks :D one more question:
where can i find a lua player that will play my lua files so that i don't have to test them on my psp?
You mean for the pc then go to luaplayer.org and download the windows version of luaplayer
okay, downloaded it, and now i have a bunch of files
i tried running the luaplayer.exe file, but for some reason, it wont' install
does anyone know why?
edit: i have windows xp
Here is my source:
Spoiler for source:
This is line 127:
This is the error: index.lua:127: attempt to concatenate global 'room_number' (a nil value)Code:netsend("StickArena_numberofplayers"..room_number,"1","w")[/
So what's wrong with that?
You have to make i cmd file.Zitat:
Zitat von michaelp
Open up notepad and type in
"luaplayer yourscriptname.lua
pause"
then save it as
"anyname.cmd"
then click on it and ot should work then
room_number isnt defined. it appears roomnumber is though.
Here I fixed it still doesn't work same error.
Code:name = "SOMEONE"
roomnumber = "roomnumber.txt"
function savenumber()
file = io.open(highscoreFile, "w")
if file then
file:write(number)
file:close()
end
end
function loadnumber()
file = io.open(roomnumber, "r")
if file then
room_number = file:read("*n")
file:close()
else
while true do
screen:clear()
screen:print(0,0,"GAME INSTALLATION ERROR :",Color.new(255,255,255))
screen:print(0,10,"No roomnumber.txt file found.",Color.new(255,0,0))
screen:print(0,20,"HOW TO FIX:",Color.new(0,255,0))
screen:print(0,30,"1) Re-install the game from dl.qj.net",Color.new(0,255,0))
screen:print(0,40," OR",Color.new(0,255,0))
screen:print(0,50,"2) Go to the this game directory, right click go to New > Text Document.",Color.new(0,255,0))
screen:print(0,60," And rename the file to 'roomnumber.txt'",Color.new(0,255,0))
screen:print(20,80,"*NOTE* Number 2 ONLY works for Windows if you own another OS please use Number 1",Color.new(0,0,255))
screen.flip()
end
end
end
x,y = 240,136;
pad = Controls.read();
if math.abs(pad:analogX()) > 20 then
x = x + pad:analogX() / 180;
end
if math.abs(pad:analogY()) > 20 then
y = y + pad:analogY() / 180;
end
---------------------------------------------------------------------------------------
screen:clear()
screen:print(0,0,"Connecting...",Color.new(255,0,0))
screen.flip()
dofile("netlib.lua")
netlib_server = "66.25.53.65"
Wlan.init()
Wlan.useConnectionConfig(1)
System.sleep(50)
screen.flip()
screen:print(0,10,"Connecting to netlib...",Color.new(255,0,0))
screen.flip()
netconnect()
System.sleep(50)
screen.flip()
---------------------------------------------------------------------------------------
screen:print(0,20,"Getting room data...",Color.new(255,0,0))
screen.flip()
netget("StickArena_room")
System.sleep(50)
StickArena_timer = Timer.new()
StickArena_timer:start()
while Wlan.getIPAddress() do
netrecv()
roomData = netvalue("StickArena_room")
if roomData == "empty" then break end
if StickArena_timer:time() >= 4000 then --resend request
netget("StickArena_room")
StickArena_timer:reset()
StickArena_timer:start()
end
screen.waitVblankStart()
end
---------------------------------------------------------------------------------------
if roomData == "error_missing_id" then --server has never had a yourgame connection, send variables
roomData = "empty"
System.sleep(50)
netsend("StickArena_number","1","w")
System.sleep(50)
end
screen.flip()
screen:print(0,20,"Getting room data...done, value: "..roomData,Color.new(255,255,255))
screen.flip()
---------------------------------------------------------------------------------------
if roomData == "empty" then
player = "one"
--wait for someone to join
netreg("StickArena_room")
System.sleep(50)
p1x = name
while Wlan.getIPAddress() do
if Controls.read():start() then --will cut connection from netlib
System.sleep(50)
netsend("StickArena_room","empty","w")
System.sleep(50)
netunreg("StickArena_room")
System.sleep(50)
netclose()
Wlan.term()
System.Quit()
end
netrecv()
buffer = netvalue("StickArena_room")
---------------------------------------------------------------------------------------
if buffer == "0" then --Assume that someone has joined!
screen.waitVblankStart(15)
screen.flip()
screen:print(0,30,buffer.." has joined!",Color.new(255,255,255))
netsend("StickArena_room",px1,"w")
screen.flip()
opon = buffer
System.sleep(50)
netget("StickArena_number")
screen.flip()
screen:print(0,40,"Getting room number...",Color.new(255,255,255))
screen.flip()
while Wlan.getIPAddress() do -- get the current room number
netrecv()
room_number = netvalue("StickArena_number")
screen.waitVblankStart()
netsend("StickArena_room"..room_number,"0"..":".."0"..":".."0"..":".."0"..":".."0"..":".."0"..":".."0"..":".."0","w")
netsend("StickArena_room","DONE","w")
if room_number ~= "" then break end --done, lets play!
screen.waitVblankStart()
end
System.sleep(70)
break
end
netsend("StickArena_numberofplayers"..room_number,"1","w")
screen.waitVblankStart()
end
else --someone is waiting for another player
---------------------------------------------------------------------------------------
use CODE tags...
hey guys ;)
want some help,...
when i'm useing wave files in my lua project, it isn't working,...just with mono sound....
but when i convert it to mono,...and test it on my psp it sounds horrible,....
do you have some tips how to convert the file ?
Yeah, but the souce is huge and it would take up alot of page space. (Why code tags? Are you viewing this from your PSP.)Zitat:
Zitat von myschoo
Because it properly indents it and it looks a lot better.
ok hold on
-= Double Post =-
There post edited.
-= Double Post =-
Hmmm... I think I found the problem I put no netget for it it.... I check it out.
with lua player how do i escape the lua script to get back to the player?
and how do i make lua scripts to eboot format?
Thanks alot
1) You have to reach the end of the script and hold start
2) You replace the Lowser folder with your game folder.
P.s.: can someone help me with my problem (After that hackman me and you can test.)
You bet i'll be on flash chatZitat:
Zitat von pspfreak9
and thanks
Hi, When I start this I get everything blitted and so but when I press X nothing happens...
It just, Doesn't do anything :|
Code:
index.lua
game.luaCode:pad = Controls.read()
if pad:cross() then
screen:clear()
dofile("game.lua")
end
white = Color.new(255, 225, 225)
while true do
room = Image.load("IMG/briefing_scrn.png")
screen:blit(0,0,room)
screen:print(75, 45, "Welcome soldier,", white)
screen:print(75, 55, "The Germans has just passed the bridge", white)
screen:print(75, 65, "and it is your mission to stop them.", white)
screen:print(75, 75, "Please be carefull", white)
screen:print(75, 85, "G.I. Joe.", white)
screen:print(75, 95, "Uhh, I mean General Jorge.", white)
screen:print(75, 105, "Developers note:", white)
screen:print(75, 115, "This game is still beta.", white)
screen:print(75, 125, "Enjoy the game and PM me bugs via QJ!", white)
screen.flip()
end
Code:
screen:clear()
gun = Image.load("IMG/gun.png")
crosshair = Image.load("IMG/crshr.png")
bullet = Image.load("IMG/Bullet.png")
health_bar = Image.load("IMG/health_bar.png")
tools = Image.load("IMG/Toolkit.png")
used = Image.load("IMG/line.png")
while true do
screen:clear()
screen:blit(1,1,gun)
screen:blit(0,0,tools)
screen:blit(1,1,health_bar)
screen:blit(200,50,crosshair)
screen:blit(400,260,bullet)
screen:blit(400,250,bullet)
screen:blit(400,240,bullet)
red = Color.new(225, 0, 0)
screen:fillRect(6, 206, 14, 62, red)
screenwidth = 480 - crosshair:width()
screenheight = 272 - crosshair:width()
screen.waitVblankStart()
screen.flip()
end
while true do
pad = Controls.read()
screen:clear()
screen.waitVblankStart()
screen.flip()
end
Hi can someone tell me how to check the FW version in LUA code? ?
-= Double Post =-
maybe you should remove the screen:clear() before the dofile("game.lua")
this is the last statement in your game.luaCode:while true do
pad = Controls.read()
screen:clear()
screen.waitVblankStart()
screen.flip()
end
it is an infinite loop
you're reading the controls, but not telling the psp to do anything when something is pushed.
add
somewhere in that loop and you can break out of it.Code:if pad:cross() then
break
end
Zitat:
Zitat von ai3gtmc
Code:white = Color.new(255,255,255)
file = io.open("flash0:/vsh/etc/version.txt","r")
mystring = file:read()
file:close()
newstring = string.sub(mystring,9,12)
screen:clear(white)
screen:print(155,136,"Firmware Version: "..newstring)
screen.flip()
screen.waitVblankStart()
end
Zitat:
Zitat von Anti-QJ
I just looked at that version.txt...How did the code know its 3.03OE-C? what did it read?
another question:
how can i make it Detect the fw then do somethings ?
sample:
if it detects 3.03OE-C or 3.10 OE then
if pad:cross() then
System.writeFile("ms0:/ltn0.pgf","flash0:/vsh/font/ltn0.pgf","yes")
end
but if it detects that its 1.5 then
screen:print(xxx,xxx,"You are Unprotected!:rtfm: ")
screen:print(xxx,xxx,"Upg rade To OE!!!")
thx!
I'm pretty sure that will work.Code:white = Color.new(255,255,255)
file = io.open("flash0:/vsh/etc/version.txt","r")
mystring = file:read()
file:close()
newstring = string.sub(mystring,9,12)
screen:clear(white)
if newstring == "3.03 OE-C" or newstring == "3.10 OE-A" then-- And so on...(Put all the OE firmwares there or protected firmwares.)
screen:print(155,136,"Firmware Version: "..newstring.." You are protected")
while true do
pad = Controls.read()
--(Your other flashing/ text here.)
screen:print(0,0,"PRESS X to flash a custom font",Color.new(255,255,255))
if pad:cross() then
System.writeFile("ms0:/ltn0.pgf","flash0:/vsh/font/ltn0.pgf","yes")
if pad:start() then
screen:print(480,272,"OFFscreen",Color.new(255,255,255))
end
end
if pad:home() then
screen:print(0,136,"YOU MAY NOT EXIT THE PROGRAM NOW, PRESS START TO EXIT THE PROGRAM.")
if pad:start() then
break
end
screen.flip()
screen.waitVblankStart()
end
else
screen:print(155,136,"YOU ARE NOT PROTECTED PLEASE UPGRADE TO OE")
end
screen:clear()
screen:print(0,0,"You are now done flashing press home to exit the program.",Color.new(255,255,255))
screen.waitVblankStart()
screen.flip()
Edit: I did alot of it for you, added more security.. It may not be all right please go through it.
AND DON'T FORGET TO UNASSIGN FLASH0 FOR READ AND WRITE PRIVLEDGES, I FORGOT TO ADD IT.
okay, i tried making this file, but it still wouldn't workZitat:
Zitat von xpack
i tried running the .exe file again, and the cmd file, but it wouldn't run
You can't read the version.txt above firmware 2.01. You should make it that if reading the version.txt fails, read vshctrl.prx and sysctrl.prx to see it it's OE or SE. You should also check to see if it has 1.50 custom firmware. I think it would be easiest to check the size of the vshmain.prx.
^ well Im not gonna do that he can do it himself I spent too much time on it already
Can you read that with Lua if so howZitat:
Zitat von Access_Denied
same way you read a txt file ;)
Can you explain doesn't look like a regular txt what about the ("set", whatever)Zitat:
Zitat von pspfreak9
do you need that
Tell me more about hacking and we'll get around to it ;)
what?!?Zitat:
Zitat von xpack
can you post an example
oh hold on...
-= Double Post =-
An example of the string.sub is this:Code:function readprx()
prx = "(location of prx)"
file = io.open(prx, "r")
if file then
prxvalue = string.sub(file:read((total number of chars in that file)),number of the char through ,this char)
file:close()
end
end
readprx() -- load that when you need to... and you can do...
if prx value == "(whatever)" then
(whatever you want here)
end -- or you can do..
screen:print(0,0,"System version:"..prxvalue)--reaplace system version with whatever you want
Hopefully you get that.Code:prxvalue = string.sub(file:read(5),2 ,4)-- 5 is the total number of characters in the file and 2 and 4 is basically read from 2 to 4 characters out of the five. So prxvalue is equal to characters 2 through 4
Yeah i understand it but how to you get the char of a file
like the total?