Results 1 to 16 of 16

Thread: change building cost

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default change building cost

    is there anyway to change the building cost of a building in-game, via scripting???
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  2. #2
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: change building cost

    I don't see how you can change the cost via script but, since a huge number of buildings are allowed, you could have a cloned building. Version A is available until "Event 1" happens and then is deactivated. Version B is activated by the same event. This will require you to either:

    a) Destroy and replace existing Version A structures with Version B ones tied to the same event. (Fairly easy)

    or

    b) Allow "grandfathered" Version A structures to remain on the board but only allow Version B ones after the event. (Easier still)

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  3. #3
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: change building cost

    This code may interest you, you will need to do the script you want to do. It's a code for the EDB (but can surely be added to a script).

    construction_cost_bonus_other bonus 50

    Alright, the value for this code is equal to the amount of % you want to give. The 50 means all your building cost will be reduced by 50%.

    Just a small note is this code is half broken, the effect will work but you won't see it in the building description.

  4. #4
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    Quote Originally Posted by St. Polycarpe View Post
    This code may interest you, you will need to do the script you want to do. It's a code for the EDB (but can surely be added to a script).

    construction_cost_bonus_other bonus 50

    Alright, the value for this code is equal to the amount of % you want to give. The 50 means all your building cost will be reduced by 50%.

    Just a small note is this code is half broken, the effect will work but you won't see it in the building description.
    thanks very much (+rep)..... and also it suits me that it doen't appear on screen...

    i suppose sth like this: construction_cost_bonus_other bonus 50 requires event_counter....

    only one question: does this bonus works on the negative side (i want the building to cost more) ... and if yes, what's the maximum percentage???



    EDIT: and i put multiple "construction cost bonuses", will the result be accumulated???
    Last edited by SpyrosM91; October 25, 2011 at 06:18 PM.
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  5. #5
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: change building cost

    Quote Originally Posted by SpyrosM91 View Post
    thanks very much (+rep)..... and also it suits me that it doen't appear on screen...

    i suppose sth like this: construction_cost_bonus_other bonus 50 requires event_counter....

    only one question: does this bonus works on the negative side (i want the building to cost more) ... and if yes, what's the maximum percentage???



    EDIT: and i put multiple "construction cost bonuses", will the result be accumulated???
    Hmm I can't say, I never tried it yet but I believe it's cumulative but for negative (increase cost) I can't say.

  6. #6
    Cobi Wan Kenobi's Avatar Centenarius
    Join Date
    Aug 2007
    Location
    Virgin Islands
    Posts
    885

    Default Re: change building cost

    Are you saying that the building will actually cost less but it won't show that in the text?

  7. #7
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: change building cost

    Quote Originally Posted by colby340 View Post
    Are you saying that the building will actually cost less but it won't show that in the text?
    Correct, the bonus will work but it won,t show it unless you salvage a broken code that show writing code but does't have any effect in game (such as tax_income_bonus).

  8. #8
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    i have a problem, the "construction_cost_bonus_other bonus 50" is not recognised by the engine....
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  9. #9
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: change building cost

    Quote Originally Posted by SpyrosM91 View Post
    i have a problem, the "construction_cost_bonus_other bonus 50" is not recognised by the engine....
    Strange, try it without your triggering script, it should be working, not be seen but working.

  10. #10
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    no, i didn't use any trigger... i just put the bonus in EDB:

    Code:
    building market
    {
        levels corn_exchange market fairground great_market merchants_quarter 
        {
            corn_exchange city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } 
            {
                capability
                {
    
                    agent merchant  0  requires factions { northern_european, } 
                    agent merchant  0  requires factions { middle_eastern, } 
                    agent merchant  0  requires factions { eastern_european, } 
                    agent merchant  0  requires factions { greek, } 
                    agent merchant  0  requires factions { southern_european, } 
            construction_cost_bonus_other bonus 50
                    trade_base_income_bonus bonus 2
                    agent_limit merchant 1
                }
                material wooden
                construction  2 
                cost  600 
                settlement_min town
                upgrades
                {
                    market
                }
            }
            market city requires
    but, i just saw this post from gigantus: http://www.twcenter.net/forums/showt...3#post10510813
    so, have you tried them???
    Last edited by SpyrosM91; October 27, 2011 at 07:34 AM.
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  11. #11
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    i placed the line in RTW, but it didn't work either....

    is its syntax wrong??
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  12. #12
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: change building cost

    Quote Originally Posted by SpyrosM91 View Post
    i placed the line in RTW, but it didn't work either....

    is its syntax wrong??
    how strange? When I've tested it, it worked like a charm.
    I know the other construction codes doesn't work anymore but the last one works.
    Try to add these two lines and see if it works?

    construction_cost_bonus_other bonus 50
    construction_cost_bonus_other bonus 50

  13. #13
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: change building cost

    Is it Kingdoms-only perhaps? Or non-Kingdoms-only?

  14. #14
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    no, it does work.... i just had put it to a building that costed 600 florins.... so it couldn't fall lower than this..... and it also works for minus values...

    BUT, unfortunatelly it doesn't work like i wanted.... when you add this buidling to the queue it diminishes the treasury with the building's "name value"... and when you press the "end turn" button, it abstracts the real value....

    i wanted to use this for that script here: http://www.twcenter.net/forums/showt...6#post10433776

    so what i wanted was that: when you add the building to the list, if you want to build another one, it would cost so high that you couldn't because of the money, thus the icon would be grey-ed out....


    BUT this "construction cost bonus" doesn't work like this.... do you have any other idea how i could make the player unable to choose that building for a second time??
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  15. #15

    Default Re: change building cost

    well, in regard that you are trying to build a unique building,
    I don't know what building you're planning exactly and how you wish to trigger it but you could do something like this: (it's campaign_script based though, I'm a broken record as far as that's concerned )

    Firstly you're building will need 2 levels, a first level that's I dunno something like a land clearance/suitable location selected by a master builder.
    and a second level that's your actual building.

    At the start of whenever you want your building to become available:

    Code:
    monitor_event FactionTurnStart FactionIsLocal
      historic_event UNIQUE_BUILDING 
      while I_EventCounter UNIQUE_BUILDING == 1
            if I_SettlementSelected == Antwerp 
               create_building LAND_CLEARANCE antwerp 
               set_event_counter UNIQUE_BUILDING 0
            end_if 
    ....
       end_while 
    terminate_monitor 
    end_monitor
    You now have a building that can be upgraded to your wanted unique building at any time in wichever settlement you want. Since the monitor has been terminated it won't reappear ever again.
    just mention in the event that it will be build in the next settlement you select and there you go.

    if you really want you can make it into a choice event so you can postpone picking a location until you get the settlement you want ( having it repeat every so often if you haven't decided yet) or even initiate it via advisor script or the likes so you can place the foundation at any time.
    Last edited by ilmrik; October 28, 2011 at 06:07 AM.

  16. #16
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: change building cost

    thanks very much for the suggestion!! (+rep)

    btw, how should be the script for an AI faction???



    EDIT: if i'm gonna use a random-city yes/no event.... how should i cope with the command "create_building LAND_CLEARANCE antwerp" ???
    Last edited by SpyrosM91; October 29, 2011 at 06:32 AM.
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •