Jump to content
BobbyHPB

Anybody know anything wrong with this my LUA script?

8 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Dear Simtropolis people, anybody know how to make my LUA below works? Or anything wrong with it? It just seem never work, all files are inside the lot and only this script I think never work, thanks in advance.

--#-package:c65081a0# -- package signature
----------------created by BobHPB-------------------

------------------------------------------------------
-----------------  Reward - My City Hall  ------
------------------------------------------------------
dofile("_adv_sys.lua")
dofile("_adv_advice.lua")
dofile("adv_game_data.lua")
dofile("adv_fluffnews.lua")

BobHPB_MyCityHall_ID = hex2dec("8c4a805b") 

-- R$$$ Population.

a = create_reward_cityplanning('8c4a805b') 
a.type = advice_types.ENVIRONMENT
function a.condition()
    if  (game.g_city_r3_population > 250) 
     then
        return reward_state.AVAILABLE
    else
        return [[text@8fd3874e]]
    end
end
a.timeout = 100
a.title = [[text@b95ab9f4]]
a.message   = [[text@be09e152]]
a.priority  = tuning_constants.ADVICE_PRIORITY_URGENT
a.mood = advice_moods.GREAT_JOB
a.persist = 1
a.once = 1

 

Appreciate for any helps.

BobHPB

  • Like 1

BobHPB

Happy City Maker

Share this post


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

Hiya @BobbyHPB, Beforeb the real masters come along with much better advice, May i talk about my thoughts?*:blush:

1 hour ago, BobbyHPB said:

BobHPB_MyCityHall_ID = hex2dec("8c4a805b") 

is it necessary to transform this hex to dec? i mean with my premature understanding, The ID shouldn't be a Hex?

1 hour ago, BobbyHPB said:

if  (game.g_city_r3_population > 250) 

is game.g_city_r3_population a dec?

Sorry that i have never been through it before and come in rudely, Looking forward your success by the help of our specialists.:}

Sincerely,

-- Raymond

  • Like 2

What is impossible with men is possible with God…!

5d9ffb6b62888_-1.jpg.d47b771d09c95f9e7590c44cf6711098.jpg

I've contributed some to Simtropolis

My Emotion

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    2 minutes ago, Raymond7cn said:

    Hiya @BobbyHPB, Beforeb the real masters come along with much better advice, May i talk about my thoughts?*:blush:

    is it necessary to transform this hex to dec? i mean with my premature understanding, The ID shouldn't be a Hex?

    is game.g_city_r3_population a dec?

    Sorry that i have never been through it before and come in rudely, Looking forward your success by the help of our specialists.:}

    Sincerely,

    -- Raymond

    Hi Raymond,

    Thanks for you question, the first variable is to transform to dec not so important, I just test it and I will use in the future for other script if this script runs well. The second Q, some of dec value is important for statistical things, but again this I will use for future, so the last question that I think has relation with current problem, so far I know the variable game.g_city_r3_population is actually a template from SG script in their LUA, and this I use for requirements to the reward. But this doesnt work at all.

    Perhaps you can or ever see any of discussion like this and refer it to me? Thanks in advance bro.

    Kind regards,

    BobHPB 

    • Like 1

    BobHPB

    Happy City Maker

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 8/20/2020 at 4:24 PM, BobbyHPB said:

    Hi Raymond,

    Thanks for you question, the first variable is to transform to dec not so important, I just test it and I will use in the future for other script if this script runs well. The second Q, some of dec value is important for statistical things, but again this I will use for future, so the last question that I think has relation with current problem, so far I know the variable game.g_city_r3_population is actually a template from SG script in their LUA, and this I use for requirements to the reward. But this doesnt work at all.

    Perhaps you can or ever see any of discussion like this and refer it to me? Thanks in advance bro.

    Kind regards,

    BobHPB 

    Ah, if so, Sorry BobHPB, i don't know that, I mean the relevant threads.

    so i guess that the game.g_city_r3_population as you mentioned is a dec and has been included, which means we could use it directly, I know we don't have the Debugging environment here, but i thought maybe you could output some key values with .io to a txt, so that you could observe them obviously. i don't know if you could do this with Reader 1.54, you may want to give it a try.

    Here is an output sample:

     Sorry couldn't be more helpful.*:blush:

    Sincerely,

    -- Raymond

    -- Edit: the io output method maybe a bad suggestion, it's not that simple as i thought, i should make a test first.*:read: Sorry!


      Edited by Raymond7cn  

    My suggestion maybe wrong here.
    • Like 1
    • Thanks 1

    What is impossible with men is possible with God…!

    5d9ffb6b62888_-1.jpg.d47b771d09c95f9e7590c44cf6711098.jpg

    I've contributed some to Simtropolis

    My Emotion

    Share this post


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

    Ah, i just searched a bit and got this one:

    Thread

    You may want to take a look at the last reply of Andreas. I have no idea if 8c4a805b is city hall and if other LTEXT's ids is correct, however maybe carlos would be interested in. @carlosmarcelo,(Sorry to beep you Suddenly carlos.*:blush:)

    • Like 1
    • Thanks 1

    What is impossible with men is possible with God…!

    5d9ffb6b62888_-1.jpg.d47b771d09c95f9e7590c44cf6711098.jpg

    I've contributed some to Simtropolis

    My Emotion

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    12 minutes ago, Raymond7cn said:

    Ah, i just searched a bit and got this one:

    Thread

    You may want to take a look at the last reply of Andreas. I have no idea if 8c4a805b is city hall and if other LTEXT's ids is correct, however maybe carlos would be interested in. @carlosmarcelo,(Sorry to beep you Suddenly carlos.*:blush:)

    Raymond,

    Your last refer thread it works, I did all andreas suggestion and all works, thanks alot raymond...you bright up my day...thank alot again bro! Great works...now I am fully understand how the LUA works.

    Regards,

    BobHPB

    • Like 1

    BobHPB

    Happy City Maker

    Share this post


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

    @BobbyHPB You are welcome, I'm happy for you, May i ask a reward here? *:D since i'm learning English, Is Bob an English name? it's same as Bobby? what's the relationship between them? I just saw you changed it with Bob when you replying.:}

    • Haha 1

    What is impossible with men is possible with God…!

    5d9ffb6b62888_-1.jpg.d47b771d09c95f9e7590c44cf6711098.jpg

    I've contributed some to Simtropolis

    My Emotion

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    6 minutes ago, Raymond7cn said:

    @BobbyHPB You are welcome, I'm happy for you, May i ask a reward here? *:D since i'm learning English, Is Bob an English name? it's same as Bobby? what's the relationship between them? I just saw you changed it with Bob when you replying.:}

    You may call me either Bob or Bobby, all are my real name...different with western guy, when you have name robert then they call you bob....but my name is bobby then my family and my friend call me bob...and I like to use nickname BobHPB...and for those people that I think I have trust them then I ask them to call me bob not BobHPB...

    • Thanks 1

    BobHPB

    Happy City Maker

    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


    ×

    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