Show 40 post(s) from this thread on one page
Page 59 of 342 First ... 9 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 109 159 ... Last
• 04-20-2006, 01:31 PM
youresam
Quote:

Originally Posted by Grimfate126
hey youaresam, i dunt understand the math.ceil function much.. so howo can you do this? if analog stik moves LEFT, the speed = speed-1 . if analog stik moves RIGHT, then speed = speed+1. thx!

math.ceil(number) returns the valuse put in, and if there is any decimal value, it goes up one. like:
5 would be 5
5.1 would be 6
5.7 would be 6
8 would be 8
8.4 would be 9

I just came up with a formula that would return 1 or -1 based on if the number was positive or negative. Yeah, its a bit confusing, but it should work.
• 04-20-2006, 01:56 PM
Electro
Quote:

Originally Posted by bronxbomber92
can any explain how i could ask a question in my lua game? i am gonna be making a trivia game (no details) and for example i might wanna ask "who is the president of the U.S." then i would give for options for an answer (mutiple choice) so i would be like "a- george bush, b-clinton, c- bob villa, d- Bronxbomber92" can any1 help me out with this? thanks

look at PSPMillionaire,, that show you what you want
• 04-20-2006, 02:02 PM
Grimfate126
Quote:

Originally Posted by youresam
math.ceil(number) returns the valuse put in, and if there is any decimal value, it goes up one. like:
5 would be 5
5.1 would be 6
5.7 would be 6
8 would be 8
8.4 would be 9

I just came up with a formula that would return 1 or -1 based on if the number was positive or negative. Yeah, its a bit confusing, but it should work.

can u tell me the code pls?
• 04-20-2006, 02:11 PM
natan333
Quote:

Originally Posted by youresam
I'll help you out tomorrow after school, what exactly do you want it to do?

i want do make one text appear with out delay , and then make another text appear but with a seperate group so i need to put screen.flip again etc or make it with the same group
I think i missing a code that is not at http://wiki.ps2dev.org/psp:lua_player:functions
• 04-20-2006, 02:58 PM
siqq
Quote:

Originally Posted by Grimfate126
can u tell me the code pls?

what do want the "code" to do? your question makes no sense because wtf is a code?!!
• 04-20-2006, 03:07 PM
youresam
Quote:

Originally Posted by natan333
i want do make one text appear with out delay , and then make another text appear but with a seperate group so i need to put screen.flip again etc or make it with the same group
I think i missing a code that is not at http://wiki.ps2dev.org/psp:lua_player:functions

Ok... http://forums.qj.net/images/smilies/neutral.gif
Here, this will display "Hello", then if you press cross, it will say "Goodbye" for 1 second.

green = Color.new(0,255,0)
while true do
screen:clear()
screen:print(10,10,"Hello ",green)
screen:clear()
screen:print(10,10,"Goodb ye",green)
screen.flip()
screen.waitVblankStart(60 )
end
screen.waitVblankStart()
screen.flip()
end

And, yes, the tutorial Shine wrote has everything you need. Back when I learned, Shines tutorials were half way done! (And of course, there were NO other LuaPlayer tutorials what-so-ever)
• 04-20-2006, 03:07 PM
Grimfate126
Quote:

Originally Posted by siqq
what do want the "code" to do? your question makes no sense because wtf is a code?!!

im sorry. :Cry: :Cry:

my code:(so far)

Code:

``` speed = 0 pad = Controls.read() dx = pad:analogX() dy = pad:analogY()         if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64         end                 if math.abs(dy) > 32 then                 cursory = cursory + dy / 64         end end```
i want it so that when the analog stik goes LEFT, the speed will decrease, and when it goes RIGHT, the speed will increase.

thx for ur help(yoursam), and sry for pissing u off(sigg)
• 04-20-2006, 03:09 PM
youresam
Quote:

Originally Posted by Grimfate126
im sorry. :Cry: :Cry:

my code:(so far)

-code-

i want it so that when the analog stik goes LEFT, the speed will decrease, and when it goes RIGHT, the speed will increase.

thx for ur help(yoursam), and sry for pissing u off(sigg)

I already showed you my formula.

height = height + math.ceil(1/dx)

Modify it to your needs. Basically, if dx is positive, it adds 1 to height. if its negative, it subtracts 1 from height.

OR if you want to add or subtract more, just put a number at the end. For example, to add or subtract 4, do this:

height = height + math.ceil(1/dx)4
• 04-20-2006, 03:14 PM
siqq
im new to lua but i do know javascript and you forgot to declare 2 of your variables cursorx and cursory
• 04-20-2006, 04:16 PM
Grimfate126
Quote:

Originally Posted by siqq
im new to lua but i do know javascript and you forgot to declare 2 of your variables cursorx and cursory

that was just PART of my code.;) i have already defined the varibles. and thx yoursam!
• 04-20-2006, 04:42 PM
Grimfate126
Quote:

Originally Posted by youresam
I already showed you my formula.

height = height + math.ceil(1/dx)

Modify it to your needs. Basically, if dx is positive, it adds 1 to height. if its negative, it subtracts 1 from height.

OR if you want to add or subtract more, just put a number at the end. For example, to add or subtract 4, do this:

height = height + math.ceil(1/dx)4

hey. i tried this:
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                             speed = speed+math.ceil(1/dx)                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64                 end end```
but it only ADDS 1 to speed when i move RIGHT, and does nothing when i move left. wtf?? sry, i know im really n00bish, and ty for being patient with me, but i have no idea how to make this work.:(:(

BTW: i have deifned all my variables.
• 04-20-2006, 04:45 PM
youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64                             speed = speed+math.ceil(1/dy)               end end```
Umm.. what is the variable you want to change? You dont have a formula in there...
• 04-20-2006, 04:49 PM
Grimfate126
Quote:

Originally Posted by youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64                             speed = speed+math.ceil(1/dy)               end end```
Umm.. what is the variable you want to change? You dont have a formula in there...

i want to change speed. everything else works fine, but when i move the analok stick right, it add to the speed, BUT when i move it left, it does nothing to the speed.
• 04-20-2006, 04:58 PM
youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                             speed = speed+math.ceil(1/dx)                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64                             speed = speed+math.ceil(1/dy)               end end```
like that?
• 04-20-2006, 05:17 PM
Grimfate126
Quote:

Originally Posted by youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                             speed = speed+math.ceil(1/dx)                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64                             speed = speed+math.ceil(1/dy)               end end```
like that?

if i do that, then when i move the analog stick right, it add 1 and if i move it down, it also adds 1. BUT what i want, is this:

if analog stick moves right, then speed increases, if i move it left, then speed decreases.
• 04-20-2006, 05:44 PM
youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                             speed = speed+ math.ceil(dx/128)                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64               end end```
Whoops, I had my formula wrong, sorry. This will add or subtract 1.
Or, if you want it to be the more you push the analog, the faster it moves, just use speed = speed + (dx/64)
• 04-20-2006, 06:26 PM
slicer4ever
hello ever1 well if havent seen i've been working on a game: pspaintball and recently released v 0.1 so i want to implement wifi within the next few versions and i remeber a while back seeing sometin about lua wifi libary's now then heres my question:

A: fanjita got wifi for lua to work in 2.1+ correctly?
B:are there any tut's yet made for how to implement wifi into lua
C: if so where
D:anyway to check if it works or not as of i don't have a wifi connection spot
• 04-20-2006, 06:32 PM
Grimfate126
Quote:

Originally Posted by youresam
Code:

```if math.abs(dx) > 32 then                 cursorx = cursorx + dx / 64                             dudex = dudex + dx/64                             speed = speed+ math.ceil(dx/128)                 end         if math.abs(dy) > 32 then                 cursory = cursory + dy / 64                             dudey = dudey + dy/64               end end```
Whoops, I had my formula wrong, sorry. This will add or subtract 1.
Or, if you want it to be the more you push the analog, the faster it moves, just use speed = speed + (dx/64)

thx! tat worked!
• 04-20-2006, 06:34 PM
slicer4ever
offtopic --
grim i read your sig sorry but not sure what h2so4 it is?

--sorry bout offtopicness
• 04-20-2006, 06:44 PM
youresam
Quote:

Originally Posted by slicer4ever
offtopic --
grim i read your sig sorry but not sure what h2so4 it is?

--sorry bout offtopicness

h2so4 = sulfuric acid.

• 04-20-2006, 06:50 PM
slicer4ever
ok well anywho can any1 answer my question?
• 04-20-2006, 07:03 PM
youresam
Sure. Dont make it online.

Any more questions?
• 04-21-2006, 12:19 AM
slicer4ever
Quote:

hello ever1 well if havent seen i've been working on a game: pspaintball and recently released v 0.1 so i want to implement wifi within the next few versions and i remeber a while back seeing sometin about lua wifi libary's now then heres my question:

A: has fanjita got wifi for lua to work in 2.1+ correctly?
B:are there any tut's yet made for how to implement wifi into lua
C: if so where
D:anyway to check if it works or not as of i don't have a wifi connection spot
i was asking if some people could direct me to where i could learn this stuff i at least arg never mind this is surpose to be a help thread and yea you apparently can't help
• 04-21-2006, 12:35 AM
Glynnder
A.fanjita HAS got wifi to wor for lua, i think it saeemed to for me and im 2.6
B. You dont need tut's, get netlib.
C. search the dl section for netlib
D. Thats dumb you cant check if it works then unless you get some beta tester's which you'd need to anyway.
E. Of course you could also use infrared....
• 04-21-2006, 01:08 AM
c5cha7
Quote:

Originally Posted by Glynnder- PSPro
A.fanjita HAS got wifi to wor for lua, i think it saeemed to for me and im 2.6
B. You dont need tut's, get netlib.
C. search the dl section for netlib
D. Thats dumb you cant check if it works then unless you get some beta tester's which you'd need to anyway.
E. Of course you could also use infrared....

I also have a small question redgarding wifi :( .
I wanna implent 2 Player into a certain game,
BUT i dont have 2 PSP's and neither doe's my friend.
I Do however have WifiMax if that can help??

Sorry i just woke up :p .
• 04-21-2006, 01:59 AM
Glynnder
if you have one psp and ur frend has on psp then borrow it.

either that or get a beta tester with 2 psp's to test it 4 ya!
• 04-21-2006, 02:36 AM
c5cha7
Quote:

Originally Posted by Glynnder- PSPro
if you have one psp and ur frend has on psp then borrow it.

either that or get a beta tester with 2 psp's to test it 4 ya!

Why o why did my friend update :( ...
he doesn't even have GTA :sad: .
I guess i will need to get some beta testers.
Also is there a way Lua can verify the psp's mac address?
or anything so i can check that its on a certain psp. :neutral:
If not then thats okay as i can do it in C anyways :p ...
• 04-21-2006, 04:58 AM
Altair
Quote:

Originally Posted by youresam
Hey guys, I got a quick question. (And, whoever helps me with this scores a cool 500 points)

I need to know more about object orientation, and maybe an example on how to use the variable "self". And whats a metatable? :confused:

Ok I have never used this, but this guy is pretty good with LUA i might say, here's a tut about classes and metatables and other stuff:
http://lordlaurin.lo.funpic.de/devbo....php?p=457#457

Hope that helps.
• 04-21-2006, 08:43 AM
Glynnder
when did youresame say that.

And sorry c5cha but i cnt help u on that, i dont think there is.
• 04-21-2006, 11:12 AM
Bronx
can any1 help me out and tell me wat this error is? error: script.lua:41: <eof> expected near `end'

it came up when i tried using windows lua player...
Show 40 post(s) from this thread on one page
Page 59 of 342 First ... 9 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 109 159 ... Last