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; Zitat von moncristo_da_dev im just making a simple jump function Ok, please say what the aim of your code is ...
-
04-10-2007, 06:44 AM #6751QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Ok, please say what the aim of your code is next time.
Zitat von moncristo_da_dev
Here is a jump tutorial: http://www.evilmana.com/tutorials/lu...et_jumping.php
[CENTER]Some of my homebrew Applications/Games:
[URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
[URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]
[URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]
-
04-10-2007, 08:41 AM #6752
ya, but that one sucks, mine is simple and to the point
-
04-10-2007, 09:04 AM #6753QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
anyone??
Zitat von myschoo
[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]
-
04-10-2007, 12:19 PM #6754QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Problem. Goes up, doesn't come back down. Also, it is prone to double/triple/etc jumping.
Zitat von moncristo_da_dev
[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]
-
04-10-2007, 02:36 PM #6755
no, yours is unnecissary and flawed
Zitat von moncristo_da_dev
-
04-10-2007, 05:05 PM #6756QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
check this out here and see if it help would, write up the code but kind of busy
Zitat von myschoo
http://evilmana.com/tutorials/lua_tutorial_09.php
-
04-10-2007, 05:20 PM #6757QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
how come this doesnt work?
Code:if collision(Player,Stick) then menu1() end
-
04-10-2007, 06:31 PM #6758Developer

- Registriert seit
- Oct 2006
- Ort
- San Diego
- Beiträge
- 177
- Points
- 4.205
- Level
- 41
- Downloads
- 0
- Uploads
- 0
as long as your collision function returns either true or false and menu1() is a valid function then it should. Have to see those 2 functions for better insight.
Zitat von Urameshi
-
04-10-2007, 06:51 PM #6759QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
nvm i fixed it, but i still dont know why it wouldnt load the menu tho
-
04-11-2007, 12:00 PM #6760QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
It may be becuase you have menu1 as a function try changing it to
menu1 = Image.load("whatever")
or make sure you have something like
function menu1()
-- your code here
end
-
04-11-2007, 03:37 PM #6761QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
the code was right, but i dont know why that didnt work, but i found another way to start the script over
-
04-12-2007, 04:44 AM #6762
ya, well if the jumping codes were actually interpretable, then i would use them in my code.
Zitat von emericaska8r
-
04-12-2007, 05:16 AM #6763QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Done: http://forums.qj.net/f-psp-developme...ack-79712.html
Zitat von moncristo_da_dev
Look at the last one in the list of four.[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]
-
04-12-2007, 05:21 AM #6764Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
hi guys. Im back and think i have stumbled pon some very good advice. Would this work if i managed to incorporate it into my code
From El Xando :
What you need to do is tan-1 times (b/a). So a is how far he's gone along and b is how far he's gone up. you divide how far he's gone up by how far hes gone along, then times it by tan-1. So either tan-1 x (b/a) or b/a x tan-1, the second one is probably easiest because it doesnt use brackets, and if you are online now please come on MSN.
-
04-12-2007, 06:19 AM #6765Developer

- Registriert seit
- Jul 2006
- Beiträge
- 205
- Points
- 4.318
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Uh, this doesn't make sense at all. If I had to guess, I'd say it looks like he's trying to explain calculating the angle at which something is moving, but he doesn't understand it himself. Here's a simple explanation (scroll down to the second box):
Zitat von eldiablov
http://hyperphysics.phy-astr.gsu.edu/hbase/ttrig.html
-
04-12-2007, 12:02 PM #6766
Who actually ported LUA to Psp and When?
-
04-12-2007, 02:03 PM #6767
Shine, 2005.
Zitat von Mr305
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
04-13-2007, 07:03 AM #6768Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
our definitions of simple are quite different :)
Zitat von LMelior
-
04-13-2007, 07:07 AM #6769QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
That's simple :Cry:
Zitat von LMelior
-
04-13-2007, 07:48 AM #6770
hiii therreeee here i got some questions about gu gum... im having problems when tray to draw a 3d model... some faces that must be in bottom draw over the faces that must be in front, i have tested changing the place of the faces in the matrix but still having that problem,,, so that makes me think that my error is in the way i setup the:
Gum.matrixMode() can some body give an explanation of the parameters it got, how, when
to use and what they do
or mybe on the :
Gum.drawArray(Gu.TRIANGLE S, Gu.TEXTURE_32BITF+Gu.COLO R_8888+Gu.VERTEX_32BITF+G u.TRANSFORM_3D, yourtable)
im folowing the 3d basic tutorial from tactical penguin and got not problems drawingplanes and texturing them, but whit a more complex model.
.... sorry about my english, im from mexico.. and still ned some practice. lol... hope here not racist people. hehehe :P tnxs...Geändert von ahrimanes (04-13-2007 um 07:58 AM Uhr)
-
04-13-2007, 09:28 AM #6771Developer

- Registriert seit
- Oct 2006
- Ort
- San Diego
- Beiträge
- 177
- Points
- 4.205
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Maybe your drawing your tri's incorrectly. Any facing you should have their coordinates plotted clockwise, and those facing opposite should be drawn counter-clockwise.
-
04-13-2007, 10:01 AM #6772
could you explain alitle more... i dont get it..:Cry:
Zitat von KleptoOne
i think my triangles are in good order cos i have no back facing,,, i just have some triangles drawing on top when they must be on bottom.... whyyyyyy ??? mybe i shoul post an screen shot.... i will do when be in home..Geändert von ahrimanes (04-13-2007 um 10:14 AM Uhr)
-
04-13-2007, 10:27 AM #6773Developer

- Registriert seit
- Jul 2006
- Beiträge
- 205
- Points
- 4.318
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Zitat von eldiablov
Well it was the simplest one that I could find in my one minute of searching. I could have sent you to the Wolfram MathWorld page for inverse tangent instead, but I'm not that sadistic. Like I said, just look at the picture and the equation in the second box of that first page I linked to, don't even worry about the text.
Zitat von xpack
Using the same variable names as that explanation, the function you're looking for is math.atan(b/a). If you'd like, though, the text describes the problems with using that function, which is the reason we also have math.atan2(b,a) - notice the number of arguments. Of course, all of this is assuming that you actually want the angle of something, which I haven't seen proof that you actually do in the first place.
-
04-13-2007, 12:48 PM #6774
i understood it, it refreshed my memory on trigs
-
04-13-2007, 06:22 PM #6775
Hey guys i am making a game in lua to help me learn. I was wondereing if i could use a table for enmies then have a number of enemies then when they all are died it will go to the next level. I know you can make the table but i am not sure how to make it check how many enemies are left.
Sorry if this is a stupid question.
Thanks Bob Hoil
-
04-13-2007, 08:20 PM #6776
use a counter in your table, when an enemy dies -1 from the counter
-
04-13-2007, 08:20 PM #6777
Hey Bob,
Zitat von Bob Hoil
table.getn(enemies)
Thanks, Sam牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
04-13-2007, 08:24 PM #6778QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Lol that's about all you need to figure the rest out. numberofenemies = table.getn(enemies)
if *enemy is killed* then table.remove(enemies,1) end
-
04-14-2007, 06:42 AM #6779
Thanks guys and by the way tactical i finally got the shooting to work i didn't use your shooting method though.
-= Double Post =-
One more question. Ok i have a collision code but want to know how to make it destroy and object when it hits it. Right now it just restarts the game.
Thanks Bob HoilGeändert von Bob Hoil (04-14-2007 um 11:02 AM Uhr) Grund: Automerged Doublepost
-
04-14-2007, 09:34 PM #6780words 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
Bob Hoil -
Thats very very very basic.... Youd have to incorporate a timer to increase the current frame in the explosion so its not every loop it increases, adapt it to your code, etc.Code:explosion_frame = 0 explosion = {} for i=1,NUM_FRAMES_IN_EXPLOSION do explosion[i] = Image.load("explosion_frame" .. i .. ".png") end -- in infinite loop if collision(bullet,object) then object.dead = true end if object.dead == true then explosion_frame=explosion_frame+1 screen:blit(object.x,object.y,explosion[explosion_frame]) if explosion_frame >= NUM_FRAMES_IN_EXPLOSION then explosion_frame = 0 object.dead = false -- your 'restart' code or w/e you said... 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


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