| Auteur | Message |
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.
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 |    |