An overview of LUA

Discussion of rolling-stock creation & re-painting.

An overview of LUA

Unread postby PapaXpress » Sat May 05, 2012 6:35 pm

On one of the fun blogs I subscribe to posted an overview of how LUA scripts are written.

http://www.altdevblogaday.com/2012/05/0 ... -dynamism/
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone

Re: An overview of LUA

Unread postby Kali » Sat May 05, 2012 7:09 pm

You can do some fun stuff ( and get in an almighty mess! ) with dynamic code - I would warn anyone who's starting out not to try tricks like that yet though! also that evaluating code at runtime is relatively expensive computationally; I'm not sure how much the latter matters to RW code yet.

Overloading functions is something you do every time you write your own Update() or OnControlValueChange() functions - you can quite handily do that with your own functions too, if you define them in a script and then load that script into another one. That way you can make say, one core engine script for an entire model and still customize each individual repaint's script.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea


Return to Rolling-Stock Design

Who is online

Users browsing this forum: No registered users and 1 guest