Jump to content

Archived

This topic is now archived and is closed to further replies.

jms

Triggers

3 posts in this topic Last Reply

Highlighted Posts

  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    hi again, guys!

    here's the thing.  every time the game value 'game.g_day' increments by 1 i'd like to run a certain function in my script.
    the only way i can see this happening at the moment is by creating an advice object which contains a link to my function.  eg, an advice pops up with a certain link, you click it, and it executes your function.
    i am looking for something more automatic.
    is there any way that each time g_day increments by 1, i can have a certain function run without creating an advice object?

    Share this post


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

    there's a workaround to periodically run a function, but I doubt it will work every day... this would severely increase computational power required anyway.

    the values in the advice triggers are checked on a continuous base, so if you make an advice like this:

    a = create_advice_cityplanning(

    "1234567")

    a.type = advice_types.ENVIRONMENT

    a.trigger = "Do_My_Function( ) "

    a.title = [[dummy text]]

    a.message = [[dummy text]]

    the function Do_My_Function() will be checked peridically... just make sure it returns false and the message will never trigger. Be sure to use a random number for the news ID, and don't give your global variables and functions an obvious name...

     

    Share this post


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

    thanks daeley, once again!!

    Share this post


    Link to post
    Share on other sites

    • 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