Can anyone tell me how I might add a building to a settlement in a campaign before the player has his turn - but using a script? It is a descr_strat script, but I am not sure of the coding. Thx.
The coding is:
Note that "settlement name" in this case is the name that appears on the map in-game.Code:console_command create_building [settlement name] [building level id]
It should work from a DS script. I use it in XGM to do some AI balancing at campaign start. There are some limitations. You can't upgrade buildings (it has to be a type that doesn't exist in the settlement yet) and you can't add things that would be visible on the strat map like walls, roads, or ports.
Does it do all levels of buildings in a tech tree if they are all set at the same settlement level?
The test I am using is seeking to add a new building (i.e. one created by us) - which has no prior tree level present - to a village; the tech tree being keyed to the village level.
So, to recap, I have:
script
script.txt
at the end of the DS file. And then the script.txt is in the same folder as DS (this is a provincial campaign), that file being a single line as:
console_command create_building [settlement name] [building level id]
The settlement name is recognised as I added population to it in the RomeShell. I have tried various alternatives such as putting "script" and "end script" in and alos the tech tree level as well as just the level codename of the building. I even tried it without the console_command prefix.
There is no recognition by the game of this script.
I should confess I am not a scripter and do not intend to use scripts for anything but small tasks where they are essential to the game - no doubt just these campaign scripts for initial game set up. All the tutorials seem to be on all the other types of scripting :(
Maybe now someone can see what I may be doing wrong.
Okay, campaign scripts can be a little fiddly:
Your script file should look something like:
Note it does not need the 'script' command at the beginning as it would with a show_me script.Code:console_command create_building Londinium muster_field console_command puppify_my_love end_script
Also, and I don't know why this is, leave a few blank lines at the bottom of your DS file and at the top of script.txt.
As for creating stuff in a village - you can put anything anywhere using a script - you can put a Royal Barracks in a village if you want. The only thing you have to be careful of is buildings that affect the look of the campaign map (governor houses, roads, ports, walls), some of these cause problems.
Last edited by Epistolary Richard; 04-14-2006 at 10:58.
Epistolary Richard's modding Rules of CoolCool modders make their mods with the :mod command line switch
If they don't, then Cool mod-users use the Mod Enabler (JSGME)
Cool modders use show_err
Cool modders use the tutorials database
Cool modders check out the Welcome to the Modding Forums! thread
Cool modders keep backups
Cool modders help each other out
Ah, BI! That's the problem.Originally Posted by Dol Guldur
You need to move everything in the \Rome - Total War\bi\data\world\maps\base directory to the \Rome - Total War\bi\data\world\maps\campaign\barbarian_invasion directory. Then delete or rename the "base" directory so it is ignored.
I just tried it and it worked... I removed the barracks from Rome and added this to descr_strat.txt:
The script:Code:;start script script test_script.txt
... and an Urban Barracks appeared as the last building in Rome.Code:script console_command create_building Rome royal_barracks end_script
Hmmm...I do not think that is possible. I need it for a provincial and the full campaign is in the folders you mention. Further, if the base folder was removed or deleted I believe that custom battles (which reference the base folder map.rwm file) would not work?
The provincial, of course, already has its base folder removed and the files thereof placed in with the campaign files in the provincial folder. A number of provincials will be set up and these and the main campaign will all need this script.
What is the principle here? I will think on it more.
Thank you for your response.
Ok - I played around with this some more.Originally Posted by Dol Guldur
- I made a second folder in the "\Rome - Total War\bi\data\world\maps\campaign" folder and called it "Pickles".
- Then I copied all the files in the "\Rome - Total War\bi\data\world\maps\base" folder and the "\Rome - Total War\bi\data\world\maps\campaign\barbarian_invasion" folder into "\Rome - Total War\bi\data\world\maps\campaign\Pickles".
- I made the script and added the scripting info to the descr_strat.txt (and deleted the map.rwm of course).
- Then I started BI, selected Single Player > Provincial Campaign > Pickles > picked WRE and started the game.
Once again, the script worked. Urban Barracks appeared in Rome as the last building built.
Does that help you? You could probably do the same with the BI campaign folder - just copy the base files in and add the script/scripting info and it will probably work. And that retains the base folder files for whatever else they are used for (custom battles per your post above).
Thx. for your thoughts and tests Stuie.
Essentially then you have made a second copy of the main campaign to represent the provincial (in my case).
This is, however, the set up I already have except that the two maps and related files are not identical of course. Clearly what works in R:TW does not seem to work in BI.
Has anyone got a campaign script to work in a BI provincial? If not, I have no evidence that it can work and will need to decide when to knock it on the head. It has already taken up too much of my time already.
And yet I can't but help think it must be possible...
OK,
I now have the mod in a bi modswitch folder (sitting under the bi folder). I have the following code at present:
End of ds file:
campaign_script.txt:Code:script campaign_script.txt
(one of many I've tried but I do not have a record of the others now)Code:console_command create_building Anfalas temple_of_violence_shrine terminate_script end_script
Both these files are in the provincial campaign folder.
Still does not work.
What am I doing wrong?
What I'm wondering is can a campaign script be used to add an unbuildable AND indestructible building to a town?
For example in our Zulu Total War mod lets say you have a 'diamond mine' in town - this could trigger the formation (construction) of a 'gambling den' which could neither be bought nor destroyed but is a consequence of having too many high rollers striking it rich. Something that the player has no control over but needs to build other structures to counteract (like a 'local police force' or a 'magistrate').
Could a script be used to give a town that building - and to take it away?
Thanks,
Lord Clare / Harlechman
Zulu Total War Team
"Ad majoram Dei gloriam"
To give it, yes. To take it away, no. We don't have a demolish building command. The only thing you can do to remove its effects is to include in a background script a monitor that damages it every turn. All the reforms in EB and Res Gestae are done by placing unbuildable, undamageable buildings in settlements on certain dates (or other events).
Epistolary Richard's modding Rules of CoolCool modders make their mods with the :mod command line switch
If they don't, then Cool mod-users use the Mod Enabler (JSGME)
Cool modders use show_err
Cool modders use the tutorials database
Cool modders check out the Welcome to the Modding Forums! thread
Cool modders keep backups
Cool modders help each other out
Well, that's good enough. How would you make an unbuyable and indestructible building though, if I may ask(if it is available to, lets say the Roman factions, it won't appear in the building construction list?)
Thanks very much,
Lord Clare / Harlechman
"Ad majoram Dei gloriam"
Unconstructable - make the building require a hidden resource that doesn't appear anywhere on the map.
Indestructable - Add the hinterland_ prefix to building tree name (as used in hinterland_roads)
So you might have for example:
hinterland_newbuilding
- smallbuilding
- mediumbuilding
- largebuilding
Last edited by Epistolary Richard; 07-20-2006 at 22:46.
Epistolary Richard's modding Rules of CoolCool modders make their mods with the :mod command line switch
If they don't, then Cool mod-users use the Mod Enabler (JSGME)
Cool modders use show_err
Cool modders use the tutorials database
Cool modders check out the Welcome to the Modding Forums! thread
Cool modders keep backups
Cool modders help each other out
So let's say I call this resource PBDISSENT and make it a hidden resource then a script can create this building depending on other factors (ie. the presence of a certain religion in a settlement)?
Thanks,
Lord Clare / Harlechman
Zulu Total War Team
"Ad majoram Dei gloriam"
Gah, OK I give up. I've been having a little go at getting this very simple script working every now and again for months. It just does not work (I knew I should have left scripting alone).
Can someone point me to a mod download that uses a BI modfolder and has a campaign script working? I will have to study the files - perhaps that will help.
Thx.
p.s. the mod downloads section (which is great) could be enhanced by having a division for the form of the mod installation (does it overwrite, go into a modfolder, work of the JSGME thingy, etc.). At least, a clear symbol (along the same lines as the 'P' in the red triangle) could be used to denote the same. It would be very useful.
I've got the following setup working (in BI, but not in a -mod folder).
descr_strat
CreateBuildings_Script.txtCode:script CreateBuildings_Script.txt
Remember that you have to use the name of the settlement, not the name of the region.Code:start_script console_command create_building Minas_Tirith men0 end_script
Bookmarks