...Some Advices to begin Learn LUA?
Moderators: Víctor Paredes, Belgarath, slowtiger
...Some Advices to begin Learn LUA?
HELLO! 
  I've try to learn something about LUA in several occasions (you know...) but now I really think that I must do it... Well I have visited the pages and download guides, tutorials and applicatinos, but guy... there are a lot of info and resources there and I'm now TOTALY lost... I've NO idea of programing (NOTHING) and I don't know if learn is possible for me, but for now I'd only want to know enought to can write "simple" Moho scripts (like some for I've asked in the past: http://www.lostmarble.com/forum/viewtopic.php?t=2233 (the most importan for me actually) or this other http://www.lostmarble.com/forum/viewtopic.php?t=2384 (for mention someones) ...And, of course, (don't laught 
 ) I'd want to achieve this goal as quickly as possible... Cause of this, maybe, if you know what I mean, I'd be very GRATEFULL if you coul give me some usefull advices, things like how you started to learn, essential tools or what is not necessary to learn in my case or, well... something to know how start "correctly" with all this "madness" at least... Well, any help would be WELCOMED 
  THANK YOU very much for all! ...CIAO!
			
			
									
									
						I've just started scriptwriting myself, and I can't do very complicated scripts, but I think I can offer some advise anyway.
Study scripts that might have anything to do with what you are trying to do, Try to find pieces that you think can be useful and analyse those to see what they really are doing, copy functions that you need from other scripts etc. Learn scripting as you go along, you'll learn more for every new script you're making.
Use the print command a lot when you're writing, it help a lot in finding faulty code if you put print commands inside funtions and different arguments to see whats actually running or not.
Use comments a lot (--this line might be broken, have a look at it after line 52 is fixed).
Get a good code editor, I did my first script in notepad which was a pain in the butt... After that I got SciTE which is a great help. One very useful thing you can do with it is search all document in a folder for lines of code (moho/scripts), this makes it very easy to find relative code to what you are doing.
As resources I've used the moho programming documentation and the last two links provided by LM in this thread. The second of those I think is better with lot of easily understood examples. And of course this scripting forum has been a tremendous help.
I hope I've been of some help to you. Good luck!
			
			
									
									
						Study scripts that might have anything to do with what you are trying to do, Try to find pieces that you think can be useful and analyse those to see what they really are doing, copy functions that you need from other scripts etc. Learn scripting as you go along, you'll learn more for every new script you're making.
Use the print command a lot when you're writing, it help a lot in finding faulty code if you put print commands inside funtions and different arguments to see whats actually running or not.
Use comments a lot (--this line might be broken, have a look at it after line 52 is fixed).
Get a good code editor, I did my first script in notepad which was a pain in the butt... After that I got SciTE which is a great help. One very useful thing you can do with it is search all document in a folder for lines of code (moho/scripts), this makes it very easy to find relative code to what you are doing.
As resources I've used the moho programming documentation and the last two links provided by LM in this thread. The second of those I think is better with lot of easily understood examples. And of course this scripting forum has been a tremendous help.
I hope I've been of some help to you. Good luck!
Re: ...Some Advices to begin Learn LUA?
Uhhhhh-Wheeee! If you can accomplish to make LUA-Scripts you would be the greatest, cause you have GREAT feature requests and if learn how to put them into a script THIS WOULD BE HEAVEN ON EARTHRamón López wrote:I've NO idea of programing (NOTHING) and I don't know if learn is possible for me, but for now I'd only want to know enought to can write "simple" Moho scripts (like some for I've asked in the past.
...
And, of course, (don't laught) I'd want to achieve this goal as quickly as possible... Cause of this, maybe, if you know what I mean, I'd be very GRATEFULL if you could give me some usefull advices, things like how you started to learn, essential tools or what is not necessary to learn in my case or, well... something to know how start "correctly" with all this "madness" at least...
...CIAO!

THANK YOU rylleman  
  you always are so kind as your advices PRACTICAL, very GRATEFULL 
 and... yes, I like study the scripts and think how can I take benefit of they... but when I need (practicaly always) to make the minimun change of the codes, I have no idea and all get down  
 ...By the way, I used Notepad for my first scripting works in the past and was a pain in the butt, yes... untill I discovered SciTE like you! 
 What a change...
 I'm afraid I'm not sure about what this means... 
 Print comand?? Hmmm... And thank you too for the info about the links, I've been searching something in spanish but nothing 
 ...And, as I've said, in my case I have NO idea of any kind of programation works, had you any when you start to learn LUA? Only for curiosity... CIAO!
And, finaly... mr. blaaa!!!
  What can I say... I LOVE YA!!! 
  I wonder where have you been all this time when I've felt so alone here...  
 sniff... I have not words for you but emoticons... 
  
  
 THANK YOU 
  too for be SO kind (too) and "bonico" 
 CIAO!  
PS: Hmmm... Another post with more emoticons than content, I'm afraid...
 (jaja...)
			
			
									
									
						Hmmm...rylleman wrote:Use the print command a lot when you're writing, it help a lot in finding faulty code if you put print commands inside funtions and different arguments to see whats actually running or not.
And, finaly... mr. blaaa!!!
PS: Hmmm... Another post with more emoticons than content, I'm afraid...
print is a LUA command that prints things in the lua console (in moho). (And it doesn't affect your scripts)Ramón López wrote: Hmmm...I'm afraid I'm not sure about what this means...
Print comand?? Hmmm...
example;
Code: Select all
if x>y then
somevalue = 23
print "(x is greater than y and I set somevalue to 23)"
else
somevalue=12
print "(x in NOT greater than y and I set somevalue to 12)"
endNot really, just some Pascal and C(no +) from school ages ago and pieces of Flash action scripting.Ramón López wrote:...And, as I've said, in my case I have NO idea of any kind of programation works, had you any when you start to learn LUA? Only for curiosity...
It's mostly a lot of if, then, else or do. Get the hang of how those is used and you have come a long way. For the rest you can use lua and moho programming documentation.
Almost all the Lua documentation assumes you already know how to program and are using Lua as another language.
For a very quick introduction to programming, see Instant Hacking (written for Python, but worth reading for any language).
For a more extensive overview of learning to program, see Learning To Program - again, written for Python, but many of the concepts apply to any language - there are now examples in Javascript and VBScript as well.
There is also a Spanish version.
Regards, Myles.
			
			
									
									For a very quick introduction to programming, see Instant Hacking (written for Python, but worth reading for any language).
For a more extensive overview of learning to program, see Learning To Program - again, written for Python, but many of the concepts apply to any language - there are now examples in Javascript and VBScript as well.
There is also a Spanish version.
Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
						-- Groucho Marx
THANK YOU TO BOTH!!! 
 You are very kind as always... and yes, the print comand seems a usefull thing, I don't know if I get it completely now, but I'll experiment with it to see... 
 Hmmm, I was afraid it... well, I'll try start little by little... THANK YOU for the links, specially the Spanish one seems very usefull 
 , of course I'd prefer that it could be about Lua, because I can made my a mess 
 , but well... I'll try to be patient 
  ...THANKS! 
			
			
									
									
						myles wrote:Almost all the Lua documentation assumes you already know how to program and are using Lua as another language.
Just a note about the confusing use of the word "print" - why not something like "display"?
Before personal computers, early terminals had just a keyboard and a printer, no monitor/screen, and connected to a central main computer.
You would type in a command on the keyboard, and the response would be printed on the printer (on continuous paper with sprocket holes along the edges), or you would write a program that printed results.
When some terminals later got text screens/monitors, the response was "printed" on the monitor - you could use either type of terminal, with a printer or a monitor.
A lot of programming languages retained the word "print" for displaying a simple text message to the user, even after the old printing terminals disappeared.
Regards, Myles - old enough to have briefly used a printer terminal.
			
			
									
									Before personal computers, early terminals had just a keyboard and a printer, no monitor/screen, and connected to a central main computer.
You would type in a command on the keyboard, and the response would be printed on the printer (on continuous paper with sprocket holes along the edges), or you would write a program that printed results.
When some terminals later got text screens/monitors, the response was "printed" on the monitor - you could use either type of terminal, with a printer or a monitor.
A lot of programming languages retained the word "print" for displaying a simple text message to the user, even after the old printing terminals disappeared.
Regards, Myles - old enough to have briefly used a printer terminal.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
						-- Groucho Marx
Yes Myles this was a cool CT explanation for the "print" commandmyles wrote:Regards, Myles - old enough to have briefly used a printer terminal.
BTW: I never told you, your moho tips section at your hp is really great, it was one of the first i started with. Much respect.
And a question: How does it go with animation master? Iam thinking about purchasing it if it's worth the money and it has good fast time to step in.
