:: Navigation
:: Libère ta PSP
Les Downgrades (PSP Fat)

Version 2.80 vers 1.50 (Team Noobz)
Version 3.03 vers 1.50 (Team Noobz)
Version 3.50 vers 1.50 (Team Noobz)
Toute version vers 1.50 (Team Noobz)

Custom Firmware (PSP Fat)

Installation 3.52M33-4 (Dark_Alex)
Installation 4.01 M33-2 (Dark_Alex)

Custom Firmware (PSP Slim & Lite)

Installation 3.60 M33 (Dark-Alex)
Installation 4.01 M33-2 (Dark_Alex)

Despertar del Cementerio (Toutes PSP)

Toutes PSP vers 3.90M33-3 (Dark_Alex)


:: Publicité
:: Derniers posts

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pspground/www/modules/Forum/blok.php on line 88

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pspground/www/modules/Forum/blok.php on line 88
PSP Ground RSS : Les 20 derniers sujets Sujets Auteur Réponses Vues Dernier message
   [News] La surprise dès ce soir à minuit! View94 9 7028 Par sham94
30.07.2008 11:08
   Downgrader une psp avec un firmware 4.xx? zoolk 0 6207 Par zoolk
29.07.2008 22:40
   [test] God Of War: Chain Of Olympus ( non fini) shino01 3 1872 Par shino01
29.07.2008 21:10
   convertir theme F0 en ctf 007marvin 0 1395 Par 007marvin
29.07.2008 20:57
   [Article] Convertir des themes rco en ctf bryce 9 4291 Par 007marvin
29.07.2008 19:31
   [News] La surprise arrive très bientôt ! Willy91 13 2749 Par Nicolas184
29.07.2008 18:03
   [PRE]shino01 shino01 9 748 Par shino01
29.07.2008 13:49
   Le jeu de la suite du mot... WinterX 1924 40769 Par salut-c-mike222
29.07.2008 12:48

(LUA tutorial) Hello world made by dan369 < Sujet précédent  Sujet suivant >
Accueil du Forum -> PSP -> Développement
AuteurMessage
  dan369



Messages : 52
Inscrit(e) le: 11.03.2008
Firmware: 3.90 M33
Go!Messenger : dan3669
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 00:34  
(LUA tutorial) Hello world made by dan369
This is for beginners to lua i write this ages ago but thought i might pass on my experience

ok lets start.
Ok go and download Lua player from luaplayer.org (click on the downloads page in that website)

now make an plain text document using notepad, PSPad etc
then click file save as
"Test.lua" --- Make sure u use the speech marks!!!
now save that file to were ever you exracted Luaplayer 0.20 (I use the desktop for easy access but that's just me!!)

now open up Test.lua in notepad etc
and it's time to start going

at the top leave an little note saying wat this is and who made it!! e.g

Code :

---Your Title Hello World
---Your Name and Date


ok now were going to make an colour, making colours in lua is an bit like paint where they have the Three main values RGB. Depend on wat u put as the values the colour changes.
so were going to make an Blue colour like so

Code :

Blue = Color.new(0,0,255)


now i bet ur think why Color? and Why only 255?
well 255 is the max you can go up to us


Legend of Zelda alpha 4 nearing release???
Revenir en haut
  dan369



Messages : 52
Inscrit(e) le: 11.03.2008
Firmware: 3.90 M33
Go!Messenger : dan3669
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 00:46  
RE : (LUA tutorial) Hello world made by dan369 Part 2

Code :
Part 2..

255 is the max you can go up to using Lua and why it's called Color instead of Colour isn't really
important that's just the way Lua was programmed!!!

add this next line then i'll explain

Code :

screen:print(200,100,"Hello world!!",Blue)


ok the screen:print tells Luaplayer to print something to the screen. 200,100 are the X and Y
cordinates, were it will be printed a bit like an graph. and "" the sentence in brackets
is what will get print basically.

now add this line.

Code :

screen.flip()


this is an important piece of code which my sound confusing but it isn't all it does is
that Lua prints everything offscreen don't know why but it does anyway this flips the screen
so you can see the words, etc you've printed. (hense the name FLIP)

2 more lines of code and that's it.
add this line underneath..

Code :

while true do
screen.waitVblankStart()
end

Here we created an Loop so every such and such it checks if everything is working
so that it will work.


Legend of Zelda alpha 4 nearing release???
Revenir en haut
  dan369



Messages : 52
Inscrit(e) le: 11.03.2008
Firmware: 3.90 M33
Go!Messenger : dan3669
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 00:57  
Part 3
I'll explain Loops more in an future tut but for now leave it at that save the file.

By now your very exicted and wanting to test what you've made.
Make an brand new file and add this:
luaplayer Test.lua

then click File, Save as:
"Test.cmd" --- again use the brackets

this will save the file with an little gear image in the middle, but basically it tells luaplayer to load your code and that's it.
Double-Click on Test.cmd and 2 windows should pop up one should say C;/username/desktop/luaplayer0.20/Test.lua
this is just the file source DON'T click X in the corner it will terminate the program.
If everything went well you should see the text in blue near the center of the other window.
This ends Tutorial 1 More to come

Note: To mods if ain't in the right place please move Thank you

Legend of Zelda alpha 4 nearing release???
Revenir en haut
  Mizou93



Messages : 701
Inscrit(e) le: 30.08.2007
Firmware: 3.90 M33
Go!Messenger : Mizou93
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 05:49  
Réponse au sujet : (LUA tutorial) Hello world made by dan369
No, it's ok you can let it here =) it's linked to the developpement section. But if you're ok I'll do a french translation and put it in the official tutorial section. Anyway, thanks for this tutorial it'll help lua beginners and we have some in our forums =).

Edit : I put this topic in the top of the developpement section, thanks again !

Revenir en haut
  benjiwolff



Messages : 494
Inscrit(e) le: 09.01.2008
Firmware: 3.90 M33
Go!Messenger : benjiwolff
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 06:55  
RE : (LUA tutorial) Hello world made by dan369
mizou peux tu le traduire stp {je suis nul en anglais)



Je creer vos avatars ICI
[color=#00008B]Réponse par MP ou par MSN

Venez voter pour moi ICI
Revenir en haut
  sami31270
[210-330] Messages



Messages : 298
Inscrit(e) le: 21.10.2007
Firmware: 3.90 M33
Go!Messenger : sami31270 ou seyfou31
Statut : Hors ligne
Avertissement(s) : 4
Posté le 30.03.2008 11:03  
Réponse au sujet : (LUA tutorial) Hello world made by dan369
Bai sa existe es traducteur anglais francais.







PSP 2.80>2.81>3.00>3.10>3.50>3.50>3.60>3.70>3.71>3.72>3.73>3.80>3.90>3.90m33>3.90m33-2




Revenir en haut
  dan369



Messages : 52
Inscrit(e) le: 11.03.2008
Firmware: 3.90 M33
Go!Messenger : dan3669
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 17:27  
RE : (LUA tutorial) Hello world made by dan369
yeah go ahead and do the French translation

Legend of Zelda alpha 4 nearing release???
Revenir en haut
  bryce



Messages : 1670
Inscrit(e) le: 02.11.2006
Firmware: 3.03 OE
Go!Messenger : bryce781
Statut : Hors ligne
Avertissement : 0
Posté le 30.03.2008 17:30  
Réponse au sujet : (LUA tutorial) Hello world made by dan369
Les traducteurs anglais francais sont bof ....
The translator english - french is bof

PS : admirez ma belle maitrise de l'anglais



Revenir en haut

Fermer
PSP ground devient Console Life.

Console Life - PC, PS3, Xbox360, Wii, PSP, DS
:: Chat
0 utilisateur est connecté sur le chat !

:: Sondage
Nos News vous semblent-elles suffisament précises ?
 Oui, elles sont parfaites
 Oui, mais je ne comprends pas tout desfois
 Non, il manque des détails
 Non, je n'ai rien compris à tout ça

 
Autres Sondages
:: Syndication

Suivez PSP Ground 
grâce aux fils RSS 2.0

Les 20 dernières news
Les 20 derniers articles
Les 20 derniers téléchargements
Les 20 derniers liens
Les 20 dernières images
Les 20 derniers sujets

:: Publicité