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; I dont know Lua Players exit function... but you sure can cause a purposeful crash, and send you to the ...
-
08-23-2006, 04:39 PM #3331words 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 dont know Lua Players exit function... but you sure can cause a purposeful crash, and send you to the XMB.
I also heard 'os.exit()' works.

...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
-
08-23-2006, 04:43 PM #3332Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i think u need luaplayer .17dk2 or something like that tho.
Zitat von SG57
--------------------------------------------------------------------------------------
-
08-23-2006, 04:44 PM #3333
os.exit exits to xmb. But is there a way to exit to luaplayer?
-
08-23-2006, 04:45 PM #3334Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i think "break" (that only exits your loop, so if u put it in ur main loop, it should exit to luaplayer)
Zitat von Shadox75
--------------------------------------------------------------------------------------
-
08-23-2006, 04:47 PM #3335words 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
Actually, when Lua Player runs through the entire script, then does it return to Lua Player, or that weird Press STart to restart thing...
So ya, without an ifnite loop, or something stopping it from reaching hte end, then it goes to Lua Player.
...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
-
08-24-2006, 05:05 AM #3336QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- www.ultimatetalkforums.com Games, RPG, quickchat and more!
- Beiträge
- 532
- Points
- 8.746
- Level
- 62
- Downloads
- 0
- Uploads
- 0
hey how come this doesnt work...??? i want it to make it so when u press cross....you exit the game...
Code:menu = Image.load("menu5.png") while true do screen:blit(0,0,menu,true) screen.waitVblankStart(1) screen.flip() pad = Controls.read() if pad:up() then dofile ("menu4.lua") elseif pad:down() then dofile("test.lua") elsif pad:cross() then break end end[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER]
[CENTER] [/CENTER]
[CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER]
[CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER]
[CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER]
[CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER]
[COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL]
-
08-24-2006, 05:08 AM #3337Rock Star

- Registriert seit
- Aug 2005
- Ort
- CT| FW: 4.01 M33-2
- Beiträge
- 11.844
- Points
- 70.899
- Level
- 100
- Downloads
- 0
- Uploads
- 0
Well what error does it give? Anyways you put elsif, instead of elseif.
Zitat von altunozara

-
08-24-2006, 05:22 AM #3338QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- www.ultimatetalkforums.com Games, RPG, quickchat and more!
- Beiträge
- 532
- Points
- 8.746
- Level
- 62
- Downloads
- 0
- Uploads
- 0
ok well i fixed that...so now its that code...but with elseif...it goes to the thing...but when its time to click x i click x...and nothing happens?
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER]
[CENTER] [/CENTER]
[CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER]
[CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER]
[CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER]
[CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER]
[COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL]
-
08-24-2006, 06:59 AM #3339I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
You don't use "break". The only way to exit back to the XMB is "System.Quit()". But this only works in the LuaPlayer Mod by Cools. You can get it at psplua.com

-
08-24-2006, 11:20 AM #3340Developer

- Registriert seit
- Feb 2006
- Ort
- Tauranga, New Zealand
- Beiträge
- 355
- Points
- 5.162
- Level
- 46
- Downloads
- 0
- Uploads
- 0
No, you can use "os.exit()" and it works on all versions of LuaPlayer.
Zitat von ARza

-
08-24-2006, 11:31 AM #3341I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
That's news to me. I asked a question about this once, and the only answer I got was System.Quit() with the LuaPlayer mod.

-
08-24-2006, 11:45 AM #3342is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
os.exit() doesnt do anything for me
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
08-24-2006, 02:08 PM #3343I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
OK, I'm making that "game" that I made a thread about yesterday. I have all the movement done. What I want to do is make it so when you press X, it turns that square black. Well, I do an if/then statement, and of course, it stays on, then dissapears when you let go of X. The question I want to know is, how can I make that square stay black? And I don't want something like this:
if pad:cross() then
square_is_black = true
end
if square_is_black == true then
screen:blit(block)
end
If I did this, I would need over 3200 if/then statements. And I really don't want to do that.
-
08-24-2006, 02:29 PM #3344is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
use a table maybe?
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
08-24-2006, 02:41 PM #3345I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
What do you mean?
Zitat von Glynnder

-
08-24-2006, 03:15 PM #3346Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
like into an array of black and white tiles.
Tiles = {
wwwwwwwwww
bbbbbbbbbb
wwbwbwbwbw
wbwbwbwbwb
wwwwwwwwww
}
and so on
F.A.L.O?
-
08-24-2006, 03:25 PM #3347I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
OK, noob question, how would I change a vaiable from an array like that. For example
array = {
121010010
101010101
101001100
}
How would I change the 2 to a 1?
-
08-24-2006, 03:26 PM #3348Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I think that would be a hard way of doing it lol cuz like a variable you would have to change the whole thing.
F.A.L.O?
-
08-24-2006, 03:29 PM #3349I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Well, does anyone know this. How would you change a variable in a table like this?
table = {}
table[1] = {1,0,1,0,1,1,1,0,1,0,1,1}
table[2] = {1,0,1,0,1,1,1,0,1,0,1,1}
table[3] = {1,0,1,0,1,1,1,0,1,0,1,1}
-
08-24-2006, 03:45 PM #3350Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
well each of those is still a variable tho... So you would still have to change the whole variable exept you would only have to do one row at a time.
F.A.L.O?
-
08-24-2006, 03:52 PM #3351I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Well, in a table like this:
table = {8,20,38,49}
I would just have to table[4] = 39 and it would change the value.
Could I just do this
table[3][6] = 0
EDIT: Turns out the above actually does work. I'm going to do that. Thanks for your help though.Geändert von ARza (08-24-2006 um 04:06 PM Uhr)

-
08-24-2006, 07:09 PM #3352Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Glad i could kinda help lol
I did help u eliminate other processes tho
F.A.L.O?
-
08-24-2006, 07:10 PM #3353I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Yeah, that helped me out. I could have spent hours trying those other ideas.

-
08-25-2006, 06:12 AM #3354
- Registriert seit
- Jul 2006
- Beiträge
- 36
- Points
- 3.957
- Level
- 40
- Downloads
- 0
- Uploads
- 0
ok is there some kind of code for a magnet effect.
so like when x is pressed object one starts moving torwards object 2
-
08-25-2006, 06:19 AM #3355I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
OK, I'll give you an example where object 2 is on the right.
if object1.x < 0bject2.x and pad:cross() then
object1.x = object1.x + 4
end
So if object1 is farther to the left than object 2 and youi press x, then object 1 will start moving to the right.
-
08-25-2006, 06:23 AM #3356
- Registriert seit
- Jul 2006
- Beiträge
- 36
- Points
- 3.957
- Level
- 40
- Downloads
- 0
- Uploads
- 0
yea i figured that out but i need it work despite where they are
like diagonal and stuff
-
08-25-2006, 06:25 AM #3357is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
you could create an invisible shape the surronds the one you want to keep the other shape away from and if the other shpae touches the invisible shape then it gets like, glued there?
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
08-25-2006, 06:27 AM #3358
- Registriert seit
- Jul 2006
- Beiträge
- 36
- Points
- 3.957
- Level
- 40
- Downloads
- 0
- Uploads
- 0
thats not what im tryin to do here ill explain my game, the enemy scrolls left to right on top and i scroll l/r on bottom. i need him to fire at me where ever i am
ill use the magnet effect for the bullet so it draws torwards me
-
08-25-2006, 06:28 AM #3359Developer

- Registriert seit
- Jul 2006
- Beiträge
- 205
- Points
- 4.318
- Level
- 41
- Downloads
- 0
- Uploads
- 0
You just need to expand ARza's code to work in the y direction also. As long as you don't use "elseif," both statements will execute and it will move diagonally.
-
08-25-2006, 06:32 AM #3360
- Registriert seit
- Jul 2006
- Beiträge
- 36
- Points
- 3.957
- Level
- 40
- Downloads
- 0
- Uploads
- 0
u dont understand, that keeps the bullet paths very limmited
ive already tried it


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