Jump to content
Sign In to follow this  
jms

BIG problem with variables!

6 posts in this topic Last Reply

Highlighted Posts

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

i'm in the middle of creating a lua script which prints out variables to the screen with the use of an advisor script.
each time i try to print out variables such as 'game_trends.G_WATER_CONSUMED' it comes up with its initial value of hex2dec(CA14EBD0) instead of the city's actual number.
why?!?!?  the variables are obviously not being refreshed properly in the game (that's what i'm guessing)
it's driving me insane, please somebody help.

-jeremy

Share this post


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

Can you post an example of the context you are using it in? (ie the rest of the code) We don't know much without it...it could possibly be a situation where you need to use token notation (like "#mayor_name#"). Or maybe your LUA script doesn't have the right list of file requirements at the top? These are just wild guesses, I'd recommend you post part of the script so we can understand better.

-qurlix

Share this post


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

that's's because the value of 'game_trends.G_WATER_CONSUMED' is hex2dec(CA14EBD0) AT ALL TIMES... there's some sort of gettrendvalue() command if I'm not mistaken...

Share this post


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

    thanks guys,

    daeley, i found the function you were speaking about. it's trend_value(), and can be used as follows:

    game.trend_value(game_trends.XXXXXXX, $)

    where XXXXXXX is the trend value and $ is a number, i'm not quite sure what this number does yet, as i get the same result with values ranging 1-10.

    Share this post


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

    so if i wanted the current trendline value, would i place no number on the end? or a zero?

    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