Could i limit a building so i could only build it in one city? Like the top guild level.
Could i limit a building so i could only build it in one city? Like the top guild level.
Create a hidden resource.
http://www.twcenter.net/forums/showthread.php?t=459718
I dont want a building that you can build only where you have added the hidden resource, i want that you could buld it in every settlement, but when you build it in one of your settlements, you cant build it again in other one.
Yes, use an event counter to track when the building is built and in the building conditions add a condition for when the event counter is not been set.
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
I dont know nothing about events, conditions, triggers, counters and os on. Could you helpe me with this? Thx.
In data/world/maps/campaign/imperial_campaign/campaign_script:
1) You must set up the event counter:
2) You then add the script that will trigger once the building has been madeCode:add_events event your_building date 0 end_add_events
3) Then you must make the counter a requirement for making the building:Code:monitor_event FactionTurnStart FactionIsLocal and FactionBuildingExists >= your_building and I_EventCounter your_building = 0 set_event_counter your_building = 1 end_monitor
In data/export_descr_buildings:
Code:building your_building { levels your_building { your_building city requires factions { factionA, } and event_counter your_building 0 ...
AJStoner, it won't be good.... because before the building is completed, he will be able to build another one.... thus, ruining the effect...
so, it's better to have this:
Code:monitor_event PreFactionTurnStart FactionType faction1 and not FactionBuildingExists = your_building set_event_counter your_building_buildable 1 end_monitor monitor_event AddedToBuildingQueue BuildingName = your_building and FactionType faction1 set_event_counter your_building_buildable 0 end_monitor![]()
PS: also, the building must have 1 turn of construction....
and there must be anothert monitor event for "buildingCompleted".... because without this, there must another turn (after the building is built) for the counter to turn to 0....
PS2: what is the syntax of that monitor event??
Thx for your help!!!
And if it isnt too much work for you.... How i must do the script if the building takes X turns to build?
Thanks again!
a situation i ecountered (with the example i gave you) was this:
the construction time was 1 turn.... the problem is that (due to the script possibly... i don't know) in the next turn, the building was not built [it was still 0% complete....!!!]... i think that it was built in the turn after that (but i think, with the condition i didn't clicked the settlement... strange eeehh???)
So in order to eliminate the possibilty that, in the turn in between, the building can be built by another settlement [because it didn't existed yet...], i did this:
this could work with buildings that have more than 1 turn of construction...Code:monitor_event PreFactionTurnStart FactionType faction1 and not FactionBuildingExists = building and I_EventCounter building_under_construction = 0 set_event_counter building_buildable 1 end_monitor monitor_event AddedToBuildingQueue BuildingName = building and FactionType faction1 set_event_counter building_buildable 0 set_event_counter building_under_construction 1 end_monitor monitor_event BuildingCompleted SettlementBuildingFinished = building and FactionType faction1 set_event_counter building_under_construction 0 end_monitor
BUT, now the building is under construction for ever, with the building process stuck at 0%...
Can anyone help????
It might be because the second monitor is setting it to [building_buildable 0] which means that it is no longer available to the EDB (I assume that the EDB uses this event counter as a condition?). So even though construction has been queued it can't be built because it is no longer a 'legal' building. Just a guess.
Also be wary of using I_EventCounter on event counters that have not been 'initialised' yet. In that first monitor you're testing the value of building_under_construction but it won't have any value (not 1, not 0, it doesn't yet exist) until it is set in either the second or third monitors. Just put a [set_event_counter building_under_construction 0] before that first monitor to define and initialise it.
What happens if the construction is canceled? I think that building_under_construction will be stuck on 1. Is there even an event like BuildingConstructionAborted?![]()
If it's part way through construction then "not FactionBuildingExists" will be true (I think?), but a reset is unwanted at that point.
yes, the building does not "physically exists" yet.... for the condition to be true (andnotFactionBuildingExists) the building must be completed...
therefore, how the script should be written???
can anyone give me a hint??Code:FactionTurnStart and not FactionBuildingExists =====> set buildable 1 AddedToBuildingQueue =====> set buildable 0 (so that another construction is not allowed in your turn) FactionTurnEnd =====> set buildable 1 (so that the building can be built) (Pre?)FactionTurnStart or BuildingCompleted =====> set buildable 0 (so that the counter can be reset to 0 )
I don't know Spyros. I think to work correctly you would also need to handle the case for the building being "currently under construction". And I can't see any events or conditions that would tell you this.
Perhaps using a counter to count turns since AddedToBuildingQueue. If after that amount of turns (the number it takes to build it) the building does not exist then assume that it was aborted? But even this doesn't allow for stalled construction due to lack of funds. Plus (I think) AddedToBuildingQueue only tells you that it has been added to the queue, NOT that it is first in the queue and will therefore start construction now. So when to start the counter?
To me it seems full of potential pitfalls that won't let it work quite as it should.
Oh my God, what i have done! XD
Waiting for the final script ^^.
One thing... How the Guild headquarters do this? can exist only one in all the world.
it's a guild.... it's not a regular building... the building is offered to you, you do not build it yourself....and the building has no construction time....
guys, when the building are built/completed??? before the CharacterTurnEnd & FactionTurnEnd or after???
EDIT: and let's assume that you have enough money and the building is first in line...