Hey guys/girls, I was wondering if it's possible to run the lua scripts in Windows. I don't want to start GTA, load the eLoader and then the LuaPlayer to test my script.
I'm new on this (just started) so be easy on me mmmkay? :D :P
Printable View
Hey guys/girls, I was wondering if it's possible to run the lua scripts in Windows. I don't want to start GTA, load the eLoader and then the LuaPlayer to test my script.
I'm new on this (just started) so be easy on me mmmkay? :D :P
Go to luaplayer.org and download the Window Luaplayer.
:Argh: How come *I* didn't see that :Cry:Zitat:
Zitat von matriculated
Thanks :)
i tried that but whenever i opened up the file the command came up but shut down just as fast.
also on my script i get this problem:
Click Me
plz help...
Some of you may know my Stick Dance and I am making Stick Dance V2. Well I've run into a problem. In version 1 the stick figures had white backgrounds but this time the are tranparent. And because of that, you can see the "still" figure (the one when you don't press anything, see Stick Dance V1) underneath the new move figure. So my question is, how do I make "still" dissapear when I press a button but then come back when I release it?
heres an idea.Zitat:
Zitat von Greenskull
the blit code you use for your still image, replace it with this below, of course replacing x,y, and stillimage with whatever is in your game.
This code is saying basicly that if no button is pressed then print the image.
Code:if tostring(Controls.read()) == "Controls (0)" then
screen:blit(x,y,stillimage,true)
end
why not just do "screen:clear()"?
Thanks PSPMillionaire! You are a life saver! And to Altair, Screen:clear gets rid of everyhting on the screen including the background.Zitat:
Zitat von Altair
with these lines
How do I make it so the sound only play once untill it is completely done. It plays but then if the button is pushed again or held down it repeats over and over.Code:if pad:square() then
screen:blit(99, 124, image)
screen.waitVblankStart()
sound2:play()
screen.flip()
Dr. Butcher try something like..
Code:if pad:square() and not sound2:playing() then
screen:blit(99, 124, image)
screen.waitVblankStart()
sound2:play()
screen.flip()
error: index.lua:78: loop in gettableZitat:
Zitat von PSPMillionaire
line 78 is if pad:square() and not sound2:playing() then
Hey PSPMillionaire. I have another problem. When you press two buttons you see both stick figures. How do I make it so that the first figure dissapears and the newest button pressed stays?
THIS is the error ive been trying to figure out to put in my error thread, anybody know the solution?Zitat:
Zitat von Dr. Butcher
For the loop ingettable error try loading your sound first normally...
Then put your sound into a local variableCode:sound2 = Sound.load("blah")
To play the sound useCode:local sound = sound2
instead of sound2:play()Code:voice = sound:play()
and to stop it use
instead of sound2:stop()Code:voice:stop()
This has helped me get rid of that error before in my own programs.
EDIT:
To Greenskull...
Check the value of all buttons being pressed...you could use that bit of code i gave you earlier. What you should do is print Controls.read() to the screen and see what the value is while pressing the two buttons you need. Instead of saying if pad:cross() and pad:square() you can say
if tostring(Controls.read()) == "Controls (thevalueyouneed)" then
...there are a million ways you could do it ...thats one
and mine :mrgreen:Zitat:
Zitat von PSPMillionaire
i got a problem with a piano app i'm making.
i'm trying to get into it time, so the noise only plays every second or so. i have incorporated sound into a different game, along with time, but i am unable to in this one. i swear i copied it exactly. but still same problem. i can get sounds to play if i take time out, but obviously the sound gets warped.
here's what pressing a button looks like:
Zitat:
if pad:square() then
f:play()
if time == 0 then
time = 1
end
end
by the way, it's within a while true to.
thanks.
please I want this done today. Anybody?Zitat:
Zitat von Greenskull
Millionaire, In the begining of the code I have more than one sound activated for each button, will what you said work anyway?
if theyre not playing at the same time, just change
local sound = yournewsoundhere
if they are playing at the same time you could make another set of the variables
bare with me im completely new at this
still gets me the loop errorCode:if pad:cross() and not sound4:playing() then
screen:blit(175, 177, yellow)
local sound = sound4
voice = sound:play()
screen.flip()
what do you mean by values? and will this make my newest button pressed's picture show up?Zitat:
Zitat von PSPMillionaire
Code:if pad:cross() then
screen:blit(175, 177, yellow)
local sound = sound4
if not sound:playing() then
voice = sound:play()
end
screen.flip()
end
see what that does
loop in gettableZitat:
Zitat von PSPMillionaire
EDIT I see you edited, hold on.
Nope, the same.
The line stops crashing when if not sound:playing() is removed, and then it works like it does before (repeating the sound)
Zitat:
Zitat von pauldude550
i really don't like to do this kind of thing, but i feel it went a little unnoticed. i know it is the wrong thing to do, but hopefully you can see my side, as i kind of know it wouldn't have been answered if i just left it.
hi well i converted an MP3 to the right format and whatnot and when i try to run it i get this error:
here is the code for it:Zitat:
Zitat von WindowsLuaPlayer
further down:Code:theme = Sound.load("tormtheme.wav", true)
local sound = theme
further down at end of code:Code:voice = sound:play()
Music.volume(128)
way to fix this?Code:if pad:start() then
voice:stop()
break
end
screen.flip()
end
also where is a good place to get some good sound effect .wav's because on my computer they sound good but on the psp they sound all bad...
and when u press the button it plays the .wav file but if u press it again or hold it down it replays the .wav over and over till its like a lhfslskjhfhds... ya that it overlaps. so i know alot but anyhelp?
i pm'd u Millionaire but maybe u didn't get it i unno...
What exactly do you want now..Zitat:
Zitat von pauldude550
Do you want it to play a note every time you hit a button without playing over and over while its being held?
if so in your code at the top put
oldpad = Controls.read()
in your while true do loop at the very end of it put
oldpad = pad
considering you're using pad as your button input variable
then when pressing a button do like..
if pad:cross() and oldpad:cross() ~= pad:cross() then
do your code
end
thanks for the help there pspmillionaire. i was obviously a bit silly when writing it, as i didn't even copy in the text?
was doing about 3 things at once if i remember. you got the idea though, i'll try it tomorrow, as it's a little late now!
thanks again
just gave it a quick go, and works just ace. now a few more complicated things to add...just what i like... :dry:
edit: i gave it a go on psp, and now a sound plays when pressing x. but if you try to press other buttons, they don't sound. they only make a noise when you press x as well as the button. looks like i'll have to have another look over. if you're willing, i'll just post what i got in the text (obviously not all of it).
Is it possible for a sprite to move further than pixel 480? and is it possible to move the on-screen display past pixel 480 aswell? If so can anyone help me out, I have a background which it 2000 X 272 and need the sprite to move further than pixel 480 so I need to scroll the screen display along (not move the background backwards) so that collision with objects will still work as you move along the screen..
please someone help this is important. When you press two buttons you see both stick figures. How do I make it so that one dissapears and the other stays? they have transparent backs which it what's causing the problem. you can see both underneath
they can move forever.Zitat:
Zitat von lui2603
I know they can move forever but how do I make the screen display move with them???Zitat:
Zitat von Greenskull
make an if before reading 2 buttons at the same time like..Zitat:
Zitat von Greenskull
stickpadxando = "off"
if stickpadxando = "on" then
if pad:cross() and pad:circle() then
*do whatever*
end
end
then you need another variable like stickpadx to use x on its own...
maybe there is an easier way but just an idea
i get this error: 'then' expected near 'if'Code:if pad:square()
if usb = 0 then
System.usbDiskModeActivate()
usb = usb + 1
if usb > 1 then
usb = 1
end
end
end
how do i fix it?
you put if pad:square() without a then...
Hi this is aimed at PSPmillionair or anyone else who has read this tutorial:
http://www.evilmana.com/tutorials/lua_tutorial_05.php:
ok so i tried to make a table but the tutorial was a bit confusing. and this is what i came up with:
and here is the button imput:Code:Hooger = {}
Hooger[1]= screen:print(100,100, "Hooger is #1")
Hooger[2]= screen:print(100,200, "Hooger is the best")
Hooger[3]= screen:print(200,100, "I love my PSP")
Hooger[4]= screen:print(110,110, "I am cool")
and i get this error:Code:if pad:square() then
Hooger[3]()
end
C:\Tutorial>Luaplayer Tutorial2.lua
error: Tutorial2.lua:48: attempt to index global `Hooger' (a number value)
C:\Tutorial>pause
Press any key to continue . . .
Im starting from scratch relearning everything and i didn't really understand the Tables tutorial so thats what i got.
if you need full code request it :D
oh...now i get this error:
C:\Tutorial>Luaplayer Tutorial2.lua
error: Tutorial2.lua:48: attempt to call field `?' (a nil value)
*hand slaps head*
i hate little details that get in the way...
thanks
now i get: "then" expected" near "="
you need something which equals hooger
where you have that table you should put underneath something like
hoogernumber = hooger[1]
then when square is pressed you can put
hoogernumber = hooger[3]
get it?
wont work. I mean, left trigger does one move and right trigger does another. I want it that if you press both only one appearsZitat:
Zitat von lui2603
EDIT: wait that might work if I word it differently. I'll come back with results.
Edit: ok I got a problem. It says "then expected near =" this is my code
help please!Code:if lw = "true" then
screen:blit(198, 40, l)
end
if pad:l() then
lw = "true"
ok how about haveZitat:
Zitat von Greenskull
buttonpressed = "none"
if pad:l() then
buttonpressed = "l"
end
if pad:r() then
buttonpressed = "r"
end
if pad:r() and pad:l() then
buttonpressed = "randl"
end
if buttonpressed=="l" then
*do dance for l*
end
if buttonpressed=="r" then
*do dance for r*
end
if buttonpressed=="randl" then
*do dance for randl*
end
not sure if that would work.. but give it a try
You got that error cause you only put one =
in an if statement you need if blabla==true then
.....