Jump to content
Sign In to follow this  
jms

LUA scripts

6 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online: A long, long time ago... 
 

g'day guys,

i was just wondering how LUA scripts differ from the actual source code inside sim city 4?
thanks

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
in the case of SC4, source code = C++ (and not publicly available I might add)
 
LUA are just small light-weigth scripts. LUA is easily executed in custom blocks wich can be loaded at runtime, meaing LUA code does not have to be compiled inside the source code to work. Basically this means that LUA scripts are a nice and clean way of extending a program after it's been compiled. They have limited use however (and can't interefere with the source code), hence they are generally used to control a number of options or custom functions (like in highly customisable GUI's, for example in WoW). 

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    cheers daeley, thanks.44.gif

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     
    oh, and just one more question...
     
    can you give me an example of what parts of the game would be written in the C++ code?  i've been looking through the lua scripts and there's a lot there.
    things like, 'if commute time is low' and 'mayor rating is a certain level' etc. then increase population by 400.  are rules like this found in lua script, or are they embedded within the game source code?
    thanks heaps!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    that's all source code... some of those have parameters adaptable trough exemplars though.

    LUA from the game only does a few things: define rewards, define news messages, control certain functions of automata (vehicles, pedestrians, trains, ...). Everything else is basically source code.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Just a follow-up... can the exemplar values be changed at runtime, or are the values only read by the game at startup? If they can be changed while the game is running, is there a possibility to change them through LUA scripts...?

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections