Jump to content

4 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hello all great modders!

 

I am a newbie at this an want to learn a little about making a reward. I'm trying to mod another casino with the requierments: ordinance_is_on(A0D07129) and that another building is built.

Trying to use

sc4game.automata.get_source_building_count(hex2dec("0ABCDE00") does not work for me for some reason. It does not work in the query either. Do I have to define this specific buildings number somewhere?

 

The ordinance gambling seems not to be working either. Can somebody tell me the right syntax in the LUA file?

Or is there another way to do this?  :lost: Is there a tutorial somewhere?

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Guess everyone is building roads now...

     

    I have another question about UI files

    -Is there a list somewhere with all the codes you could use in it, like

     0000106c = budget cost

     0000106b = goofy stats

     00001076 = has power y/n

     00001077 = has water y/n

     

    well, guess I'll figure it out evetually...

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I have one more question about custom UI making.

    I know I can use math.random() to get a random number.

    I can use math.abs() to get a positive number from a negative.

    I would like to use math.trunc() to get an integer from a float but this is not working.

    Anyone knows what math. functions that are supported in SC4? Is it Java or C#?

     

    Guess Everyone who knows this heavy stuff is busy....

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    OK ROmeoBOT, I will try to answer your questions.

     

     

    Hello all great modders!

     

    I am a newbie at this an want to learn a little about making a reward. I'm trying to mod another casino with the requierments: ordinance_is_on(A0D07129) and that another building is built.

    Trying to use

    sc4game.automata.get_source_building_count(hex2dec("0ABCDE00") does not work for me for some reason. It does not work in the query either. Do I have to define this specific buildings number somewhere?

     

     

    The ordinance gambling seems not to be working either. Can somebody tell me the right syntax in the LUA file?

    Or is there another way to do this?  :lost: Is there a tutorial somewhere?

     

    Yes you will have to define this, look in BSC essentials.dat for instance.

    Try this link and you might learn to make a reward:

    https://www.sc4devotion.com/forums/index.php?topic=1010.0

     

    --#-package:0xxxxxxxx# -- package signature


    Again, replace the 0xxxxxxx with a unique 8-digit number of your choosing (an easy rule for this is to take the instance id and change the first digit to a zero).
    Remember, the first digit HAS to be a Zero! That's what is says, right?

     

     

     

    Guess everyone is building roads now...

     

    I have another question about UI files

    -Is there a list somewhere with all the codes you could use in it, like

     0000106c = budget cost

     0000106b = goofy stats

     00001076 = has power y/n

     00001077 = has water y/n

     

    well, guess I'll figure it out evetually...

     

    Tage has a file in this link: Query IDs.zip

     

    https://www.sc4devotion.com/forums/index.php?topic=532.0

     

     

     

    I have one more question about custom UI making.

    I know I can use math.random() to get a random number.

    I can use math.abs() to get a positive number from a negative.

    I would like to use math.trunc() to get an integer from a float but this is not working.

    Anyone knows what math. functions that are supported in SC4? Is it Java or C#?

     

    Guess Everyone who knows this heavy stuff is busy....

    About math: there are many math.functions that can be used in LText files and LUA files.

    Check in excel and try. This works for me:

    math.sqtr()

    math.abs() positive from negative

    math.min() lowest value

    math.max() highest value

    math.floor() rounds down

    math.ceil() rounds up

    many of the games variables are rounded to int when they are presented in a LText file.

     

    Many of these variables can be used in a custom query:

    //www.simtropolis.com/library/Omnibus/LUA_Constants.txt

     

     

    This thread should be closed now.

     

    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