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; ummm... still dont get it but i see you do need some if statements to trigger moving1-4 to be true ...
-
05-21-2006, 07:27 PM #2431words 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
ummm... still dont get it but i see you do need some if statements to trigger moving1-4 to be true or not... Not if pad:left() and moving3==true.... youd need if pad:left() then moving3=true...then go and say if moving3==true then screen:blit and junk... much easier and understandable...and since i cnat see your whole code.. i dunno whats going on lol

...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-21-2006, 07:36 PM #2432
ok, tomorrow i put the whole code in a zip, now i m going to bed
Bequiet!!!
I'm learning cc©cc
-
05-22-2006, 12:12 AM #2433
- Registriert seit
- Jul 2005
- Ort
- second star to the right...
- Beiträge
- 139
- Points
- 10.633
- Level
- 68
- Downloads
- 0
- Uploads
- 0
Cheers JonFrost, i think i understand it. thats the last piece in my code i'll need, i'll have a beta soon. btw this Thead is great, about 3 weeks ago i was stuck in a rutt with my learning of lua, so i started to read this, i've only got to page 70. but i'll carry on reading once i finish this dam simple game.
Zitat von EminentJonFrost
hoping some people will give it a try before i release and give me some comments/advice.
TiboricGeändert von Tiboric (05-22-2006 um 12:18 AM Uhr)

-
05-22-2006, 07:05 AM #2434QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
Zitat von Tiboric
I wouldn't use that rotating code.. I used it and it made my game lag like crazy.
-
05-22-2006, 11:46 AM #2435
- Registriert seit
- Jul 2005
- Ort
- second star to the right...
- Beiträge
- 139
- Points
- 10.633
- Level
- 68
- Downloads
- 0
- Uploads
- 0
got any sugestions then?
Zitat von montrob
but lag doesn't really matter that much in my game.
thanks for the heads up though
-
05-22-2006, 11:56 AM #2436QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
I got no suggestions.. I just had to leave the text unrotated.. and well, if lag doesnt matter then use it.
-
05-22-2006, 12:08 PM #2437
Why dont you just use a prerotated image? Or is the text different each time?
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
05-22-2006, 12:43 PM #2438
Here is the whole code that the moving picture only stop working for only 1 blocking picture and not the others.
search for Buggykiller and above that is the code to make the moving picture stopworking when it tryes to go inside blockGeändert von natan333 (05-22-2006 um 12:47 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-22-2006, 06:37 PM #2439
so anyone knows whats the problem ?
~edit . ah never mind, one of the codes in buggy that was making only 1 block work
Geändert von natan333 (05-22-2006 um 06:52 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-22-2006, 08:21 PM #2440QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
well its printing the score that you have for the game.. so ya its different every time
Zitat von Altair
-
05-23-2006, 12:49 AM #2441
- Registriert seit
- Jul 2005
- Ort
- second star to the right...
- Beiträge
- 139
- Points
- 10.633
- Level
- 68
- Downloads
- 0
- Uploads
- 0
its two countdown timers!
Zitat von Altair
so i could use pics, but its not something i favour.
i've got some work to do on my bonus features.
but its something im considering.
-
05-23-2006, 02:34 AM #2442
One thing you could do is, you have all the numbers saved as a seperate image. Then you blit the right one at the right places. Hope thats clear enough.
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
05-23-2006, 02:50 AM #2443
- Registriert seit
- Jul 2005
- Ort
- second star to the right...
- Beiträge
- 139
- Points
- 10.633
- Level
- 68
- Downloads
- 0
- Uploads
- 0
Zitat von Altair
yeah thats what I was just talking about. :)
-
05-23-2006, 03:13 AM #2444
yeah i see now, sorry. I read montrobs reaction after yours and he doesn't use this, i think. I should have added "@Montrob" before my post.
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
05-23-2006, 03:36 AM #2445
- Registriert seit
- Jul 2005
- Ort
- second star to the right...
- Beiträge
- 139
- Points
- 10.633
- Level
- 68
- Downloads
- 0
- Uploads
- 0
LOL, no worries,
thanks for the help, i'll be needing lots more later on Im sure. :)
-
05-23-2006, 02:04 PM #2446
guys i m stuck in something

look at the picture
I made the square boxes to make the player picture moves to be false if it tries to get through the boxes and i made player moves to be true if its at the left side and bellow of the boxs.
The code above will make player picture to go up if its bellow the box and to the left side of the boxes as its showing at the picture above.Code:if moving1 == false and x0 <= block[c].x-14 and x0 >= block[c].x-16 and y0 >= block[c].y+16 then moving1 = true end
At the picture above, player picture moves is true becuase its left side and bellow the box.
The problem is:
If there is another box at the left side of the 3 boxes so its above the player picture, player picture will try to get through the box but it stops when it pass 1-2 pixels.
my question is? Is there a code that i can add in the code above to make the moving1 = true if it reads the color of the background to the left side of any box ?
so if it dosent match the background color to the left side of a box, the player1 will not move up
~Edit like this code bellow for an example, i added "white == screen
ixel(block[c].x-14, block[c].y)" but it dosent work
Code:if moving1 == false and x0 <= block[c].x-14 and x0 >= block[c].x-16 and y0 >= block[c].y+16 and white == screen:pixel(block[c].x-14, block[c].y) then moving1 = true end
Geändert von natan333 (05-23-2006 um 02:34 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-23-2006, 02:49 PM #2447QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
Could it be this part:
Zitat von natan333
Are you sure you meant for "x0" to be specifically in between those two #s?Code:x0 <= block[c].x-14 and x0 >= block[c].x-16
That means "x0" can only equal one number at all for "moving1" to be true.[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-23-2006, 03:05 PM #2448
Zitat von EminentJonFrost
if it dosent have "y0 >= block[c].y+16" picture player that have x0 and y0 axis will bypass any box and not bypass the corners bellow. and if it dosent have "x0 <= block[c].x-14 and x0 >= block[c].x-16 " it will just go through the box.
the code i put works great but my question is what code i put to read the white background color to the left side so the white background will also be needed to make moving up trueGeändert von natan333 (05-23-2006 um 03:15 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-23-2006, 03:10 PM #2449QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
no no, look, I'm saying you limited that "moving1" to be true ONLY if
Zitat von natan333
"x0" is 14 < x > 16
see?
the chances are very narrow.
at least I'm guessing, i dont what "x0" would equal otherwise.
as for the "y0", I said nothing of it.[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-23-2006, 03:14 PM #2450QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
If you are saying you want moving1 to be true if the background is white, then can't you do:
Zitat von natan333
I think that is what you meant, but I kept getting moreCode:if screen:blit(480,272,white) == true then moving1 = true end
as I kept re-reading it.
-
05-23-2006, 03:20 PM #2451
Zitat von EminentJonFrost
from what it shows in my psp, the "x0" is 14 < x > 16 is telling to be true outside of the box to the left and right but it makes bug if there is more then 2 boxes close together so y0 >= block[c].y+16 makes to be left only to be trueBequiet!!!
I'm learning cc©cc
-
05-23-2006, 03:28 PM #2452
like that is for the whole background. i want to make like a 16x , 16y invisible square to the left of all box so if its white in that invisible square, it becomes true for moving1 and if there is another color, it dosent do nothing
Zitat von PSPduh
Geändert von natan333 (05-23-2006 um 03:33 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-23-2006, 05:25 PM #2453
does anyone know why my scripts keep getting an error because 'there is no loop to break'? The thing I have (by help of Jon Frost) is that at the beginning of a function it says :
if quit == true then
break
end
What is wrong with it, and why can't it break the function loop?
Also, I just took that part out of my code, saved and retried the program, yet it had the same error? I am so confused.
-
05-23-2006, 05:37 PM #2454words 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
Think my friend...... think... break = break a loop = has to be in a loop... Not neccessarly a function...
Basically, just put the 'if' statment for breaking the loop in the/a loop
...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-23-2006, 05:59 PM #2455
hmm
how can i make the opposite of
Code:if moving1 == false and x0 >= block[c].x+16 and y0 >= block[c].y+16 then moving1 = true end
Geändert von natan333 (05-23-2006 um 07:13 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-24-2006, 03:55 AM #2456QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
The opposite of that?
Zitat von natan333
(This is assuming you want "moving1" to be false again.)
That what you mean?Code:if moving1 ~= false and x0 >= block[c].x+16 and y0 >= block[c].y+16 then moving1 = false end
I'll take another look at it.
Zitat von emericaska8r
EDIT - emericaska8r, check your PM or email.Geändert von EminentJonFrost (05-24-2006 um 04:20 AM Uhr)
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-24-2006, 05:15 AM #2457is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
i think that that is what he means...
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
05-24-2006, 06:52 AM #2458QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
I think so too, but I've been wrong before.
Zitat von Glynnder- PSPro
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-24-2006, 07:15 AM #2459
This code makes the player moving1 (up) to be true if its at the right side of the block and bellow itCode:if moving1 == false and x0 >= block[c].x+16 and y0 >= block[c].y+16 then moving1 = true end
i want to change the right to left.Bequiet!!!
I'm learning cc©cc
-
05-24-2006, 08:56 AM #2460QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
How is it stuck if the player it isnt touching and is not going to touch a block?
Zitat von natan333
I'm gonna go back read over everything again. This is confusing me. Plus, the way you explain it (no offense) is not helping.
EDIT - OOOOOOHHHHH!! Ok. I get it now.
All right, you want it luaplayer to check if theres a block in the way of the player, and if there is, the player cannot go through it. Makes sense. It was harder to understand that since some parts of your post were repetitive.
Ok, umm...all right, heres an example:
does that help you?Code:-- box is 20x20 pixels box_x = 100 box_y = 100 box2_x = 120 box2_y = 120 --[[this means the box will cover from: (100, 100)____________(120, 100) | | | | | (100, 120)_____________(120, 120) <bottom right of pic ]] if player_x > box2_x or player_x < box_x and player_y > box2_y or player_y < box_y then can_move = true end if player_x >= box_x and player_x <= box2_x then can_move = false end if player_y >= box_y and player_y <= box2_y then can_move = false end
Geändert von EminentJonFrost (05-24-2006 um 09:17 AM Uhr)
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]


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