is there anyway to change the building cost of a building in-game, via scripting???
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)
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???
Are you saying that the building will actually cost less but it won't show that in the text?
no, i didn't use any trigger... i just put the bonus in EDB:
but, i just saw this post from gigantus: http://www.twcenter.net/forums/showt...3#post10510813Code: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
so, have you tried them???
Is it Kingdoms-only perhaps? Or non-Kingdoms-only?
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??
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:
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.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
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.
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" ???