Zeige Ergebnis 5.071 bis 5.100 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; alright awsome...
-
01-16-2007, 03:58 AM #5071
- Registriert seit
- Dec 2006
- Beiträge
- 14
- Points
- 3.536
- Level
- 37
- Downloads
- 0
- Uploads
- 0
alright awsome
-
01-16-2007, 04:20 AM #5072QJ Gamer Bronze
- Registriert seit
- Sep 2006
- Ort
- Denmark
- Beiträge
- 664
- Points
- 9.316
- Level
- 64
- Downloads
- 0
- Uploads
- 0
Allright, BlackShark helped me before, but im afraid it didn't work.
I need this:
if pad:cross() and (collosion with my cursor, and my button here) then
(blit my new image, as a new menu will pop-up)
end
But i don't have good memories with collosion... (My crappy Ping Pong game...)
So can anyone help me here? I need from Start to End instructions, because i just don't get it sometimes.My PSP Projects:
___________________
None.
-
01-16-2007, 06:27 AM #5073QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Here's a simple click function I made for a shell a while back:
function click(ob)
if pad:cross() and (cursor.x > ob.x) and (cursor.x < ob.x + ob.w) and (cursor.y > ob.y) and (cursor.y < ob.y + ob.h) then
return true
else
return false
end
end
You'll just have to add w and h variables to the items that are clickable. Then you can use it like this:
if click(nameofobjectyou'red etectingaclickfor) then
*stuffthathappenswhenitis clicked*
end
-
01-16-2007, 06:41 AM #5074QJ Gamer Bronze
- Registriert seit
- Sep 2006
- Ort
- Denmark
- Beiträge
- 664
- Points
- 9.316
- Level
- 64
- Downloads
- 0
- Uploads
- 0
Allright, it'll go like this properbly, and ill show what i didn't understand:
function click(menu) -- which is my button
if pad:cross() and (cursor.x > menu.x) and (cursor.x < menu.x + menu.w --? is the the width or something?) and (cursor.y > menu.y) and (cursor.y < menu.y + menu.h -- ?, is that the height or something?) then
return true -- return is not supposed to be there, is it?
else
return false -- Look up.
end
end
And then:
if click(menu) then
screen:blit(where it is, where it is, start, false)
endMy PSP Projects:
___________________
None.
-
01-16-2007, 06:46 AM #5075Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Are there any tutorials in Lua for reading entire text files and printing them to the screen or can someone help me out on pg 505?
If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
Gold donations are highly appreciated!
-
01-16-2007, 07:25 AM #5076lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
http://evilmana.com/tutorials/lua_tutorial_09.phpCode:y = 10 file = io.open("testRead.txt","r") for line in file:lines() do y = y + 10 screen:print(100,y,line,white) end file:close()
-
01-16-2007, 10:45 AM #5077QJ Gamer Silver

- Registriert seit
- Oct 2006
- Ort
- Pimp'en in the US F#
- Beiträge
- 1.254
- Points
- 7.278
- Level
- 56
- Downloads
- 0
- Uploads
- 0
the return true IS suppost to be there, thats how you know if the cursor is in the button, in there, you make an if statement like "if pad:cross() and click(menu) == true (not sure if click(menu) is supposed to be like that but hey, im not so hot in collision niether) then
Zitat von gameo
do your if statement functions, here like load this or do that
end
give that a try, but again, no make sure's it will work (said "make sure's cuz i cant spell garrentie!)NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-16-2007, 01:32 PM #5078QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
The return true/return false is used for telling whether the conditions are true or not AKA whether its been clicked.
w and h are width and height
So use it like this:
menu = {x = something,y = something, w = widthofmenuimage, h = heightofmenuimage}
function click(ob)
if pad:cross() and (cursor.x > ob.x) and (cursor.x < ob.x + ob.w) and (cursor.y > ob.y) and (cursor.y < ob.y + ob.h) then
return true
else
return false
end
end
while true do
pad = controls.read()
screen:clear()
screen:blit(menu.x,menu.y ,menuimg)
screen:blit(cursor.x,curs or.y,cursorimg)
*otherstuffofrcursormovem ent*
if click(menu) then
*stuff you wanna do when menu is clicked*
end
screen.waitVblankStart()
screen.flip
end
-
01-16-2007, 01:32 PM #5079QJ Gamer Blue
- Registriert seit
- Jul 2006
- Beiträge
- 72
- Points
- 4.209
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Does anyone know if it's possible to rotate an image being displayed on the screen? Thanks. Hopeing to get a reply...:Punk:
-
01-16-2007, 02:02 PM #5080
i think i saw something like that on evilmana or something, but i have no time to look right now... sorry
Zitat von PSPhakkor
-= Double Post =-
can someone give me information about this? thanks
Zitat von emericaska8r
Geändert von emericaska8r (01-16-2007 um 02:02 PM Uhr) Grund: Automerged Doublepost
-
01-16-2007, 02:17 PM #5081Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
there is, but its buggy, and will drop your framerate below 30. so, look for better means to do it.
Zitat von PSPhakkor
--------------------------------------------------------------------------------------
-
01-16-2007, 02:45 PM #5082QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
pspsgamer... I'm pretty sure you had 1,100 posts only last month. It says you post an average of 18 a day... Are you ok?
Zitat von Anti-QJ
-
01-16-2007, 03:58 PM #5083words 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
Grimfate - One way would be to use the GU and rotate a textured quad, the texture being the image you want to rotate.

...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
-
01-16-2007, 04:01 PM #5084QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
i keep getting the error:
wrong number of arguments
here is the code
Zitat von code
-
01-16-2007, 04:45 PM #5085QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
if current == 1 then
screenrint("Alphabet",r ed)
end
if current == 2 then
screenrint("Usefull Phrases",red)
end
if current == 3 then
screenrint("Dictionary" ,red)
end
No xy coordinates.
-
01-16-2007, 04:47 PM #5086words 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
Itd help immensly if you gave us a line number...
Until then, try adding some X and Y coordinate values to lines 20,23 and 26.
EDIT
Weird, my thing didnt show someone already answered...
...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
-
01-16-2007, 05:59 PM #5087
can someone answer my post at the top please?
-
01-17-2007, 03:55 AM #5088.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Anyone know some good AI tuts?
Also, can anyone help me with using netlib? I REALLY need both these things :)
Thanks to anyone who can help me out ;)
-
01-17-2007, 06:02 AM #5089QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
I havent written any games with netlib but I do know how to use it if you need help.
-
01-17-2007, 10:31 AM #5090QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Here is a start. Look around Gamedev for more or get a good book: http://www.gamedev.net/reference/art...article784.asp
Zitat von Yongobongo
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
01-17-2007, 03:04 PM #5091.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
You do? Great :) I'll PM you when i need you :)
Zitat von TacticalPinguin
Thanks Tactical!
-
01-17-2007, 03:22 PM #5092
- Registriert seit
- Sep 2006
- Beiträge
- 484
- Points
- 8.718
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Hey yoyobongo try this site: (it shows you how to make a infastructure game with netlib.)
http://www.cools.biaklan.com/Tutorial/netlibtut.html
-
01-17-2007, 03:47 PM #5093.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Thanks, ill have a look at it :)
-
01-17-2007, 04:11 PM #5094QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Is there a limit in Lua on how many images you can load? In my index.lua I can only load 13 images... Any more and i'll get an error that it can't load it. They're all 480x272.
-
01-17-2007, 04:14 PM #5095QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
The limit is the amount of memory you have available for LuaPlayer, the large the image, the more memory you take up.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
01-17-2007, 04:31 PM #5096QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Well maybe i dont need an image anymore? How do I delete it from RAM or wherever it goes when I preload it.
-
01-17-2007, 05:00 PM #5097Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von Cheez Pirate
that will free the memory.Code:name_of_image = nil
and, 13 480x272 images is WAYYY too much. you wont even be able to load 6 detailed ones.--------------------------------------------------------------------------------------
-
01-17-2007, 05:14 PM #5098QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
nameofimage = nil will clear it from ur ram. same goes for anything else
-= Double Post =-
whoa thats odd i didnt see grimfates postGeändert von TacticalPinguin (01-17-2007 um 05:14 PM Uhr) Grund: Automerged Doublepost
-
01-17-2007, 05:22 PM #5099QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- Missouri
- Beiträge
- 451
- Points
- 6.041
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Hey thanks TacticalPenguin
-
01-17-2007, 05:48 PM #5100
this is more of a general programing question, but how do you get the angle and distance between 2 points, (x1,y1,x2,y2).


LinkBack URL
About LinkBacks
Mit Zitat antworten
rint(10,10,"Quick Japanese",white)

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