PDA

View Full Version : How to limit recruitment & construction by area (hidden resources)



Nero
02-17-2005, 15:19
Modding Resource Header
Title: How to limit recruitment & construction by area (hidden resources) (formerly How to...add hidden resources and use them)
Posted by: Nero
Modding area: Units (recruitment) / Buildings (construction)
Required programmes: Notepad (or other text editor)
Optional tools: Excel macro for recruit lines in edb (https://forums.totalwar.org/vb/showthread.php?t=50456)
Hardcoded limits: There can be a maximum of 64 hidden resources, this must include the Rome resource (and Italy for the Marian Reforms).
Summary: Hidden resources are used to limit the areas in which units are recruited and buildings can be constructed. They differ from normal (trade) resources in that they do not appear on the map and provide no income. This tutorial shows you how to add and use these hidden resources.
__________________________________________________


How to...add hidden resources

I haven't found a tutorial to add hidden resources, so I decided to make one myself.
Throughout this tutorial I will explain how hidden resources can be added and how you can make them have effect.

Adding hidden resources to the game

1 - Add the hidden resource to the region in descr_regions
Open up your ...RTW\data\world\maps\base map and open descr_regions.txt when you want to mod the imperial campaign resources.
For any other campaign, open the "...RTW\data\world\maps\campaign\anyothercampaign" map and look for descr_regions.txt there.
Now add any hidden resources you want to any city you want by just typing them in the resources section.

Britannia_Inferior
Eburacum
britons
Brigantes
232 41 198
stone, coastal_forest, lead, dogs, pigs, guineapigs
5
5

In this region, I've added guineapigs as a hidden resource.

2 - Delete map.rwm
Changes to map or regions file will only appear if you delete map.rwm before you relauch the game. You should delete the file in the same folder as the descr_regions file.

3 - Define the hidden resource to export_descr_buildings
Now open the export_descr_buildings.txt file in the ...RTW\data folder.
Almost at the top, there is a line starting with hidden_resources.
Now add the names of the hidden resources you've added to the descr_regions.txt file to this line:

hidden_resources rome, sparta, guineapigs

How to use the hidden resources

Now the hidden resources are present, you can make them have effect on things.
Therefore, use the export_descr_buildings.txt file and just choose anything you want to edit. I've chosen the example of "guineapigrider" as a cavalry unit, and the roman light cavalry will get an experience bonus when the guineapigs resource is present.


building equestrian_roman
{
levels stables
{
stables requires factions { greek_cities, roman, slave, }
{
capability
{
; greeks
recruit "greek cavalry" 0 requires factions { greek_cities, }

; roman
recruit "roman light cavalry" 0 requires factions { roman, } and marian_reforms
recruit "roman light cavalry" 0 requires factions { roman, } and not marian_reforms and not hidden_resource guineapigs
recruit "guineapigrider" 0 requires factions { roman, } and hidden_resource guineapigs
recruit "roman light cavalry" 1 requires factions { roman, } and not marian_reforms and hidden_resource guineapigs
}
construction 4
cost 1200
settlement_min large_town
upgrades
{
}
}
}
}
plugins
{
}
}

In the highlighted lines I have used the hidden resource in various ways and I think this pretty clearly explains how to use them.

Note, hidden resources can also be used in a similar manner to restrict the provinces where buildings can be built.

Have Fun!!!

Bob the Insane
02-17-2005, 15:59
Thank you!!!

Myrddraal
02-17-2005, 17:19
There is already a guide on this in the How To thread:

https://forums.totalwar.org/vb/showpost.php?p=661155&postcount=2 (How To's post on hidden resources)

Maybe these guides aren't very obvious, grouped as they are into one thread...

Thanks anyway though Nero, ur guide is probably better.

Sinner
02-17-2005, 17:44
Do you still have to delete maps.rwm in the \Data\world\maps\base folder for the new hidden resource to be available in v1.2? I haven't tried adding a new hidden resource since re-patching, so not sure if that has changed.

I did find pre-v1.2 that there was a limit to the number of hidden resources, I think it was 63 or 64, but that should be ample for most mods.

Epistolary Richard
02-26-2005, 06:14
Nope, the hidden resources appear without having to delete maps.rwm.

Edit: Well, they appeared that time. But since then they haven't appeared unless I've deleted maps.rwm, so it looks like it's still necessary.

Miletus
06-03-2005, 15:10
Hey

I'm having a problem with my new hidden ressources. When I add the 'and hidden_resource guineapigs' (or whatever) to the end of a recruitment option in the 'buildings' file, the game refuse to start and is just returning me to the desktop. It only seems to be a problem with the new ressouces because i can add 'and hidden_resource rome' with no problems.
Does anybody knows what can be wrong? ~:confused: I'm running 1.2 with no mods except a few homemade scriptchanges.

Epistolary Richard
06-03-2005, 15:12
Are you putting guineapigs at the top of export_descr_buildings as well, alongside rome italy sparta?

Miletus
06-03-2005, 15:19
Damn you guys are fast!

No, I must have skipped that part of the guide! :embarassed:

Thanks a lot Richard!

PatWest
07-13-2005, 11:32
I've been trying to verify whether this actually works and so far I've had no luck at all. Will this really allow me to restict recruiting a unit to one city exactly like the Sparta resource.

PatWest
07-18-2005, 09:34
I'm really looking for some here please. What is missing in this tutorial. Will it only work for 1.0 . I've tried this a dozen different ways and it just won't recognize the new resources. This could open up a lot of new recruiting potential.

Epistolary Richard, Myrddraal, you people implied by your posts that this works, well sort of, as you put it. Please try it again and let me know if you were sucessful. It's only takes a couple minutes of experimentation to prove.

Epistolary Richard
07-18-2005, 09:51
Yes, it works, it works for 1.0, it works for 1.2. It has been used many times (not least in my own Rome Total ZOR mod which had a hidden resource for each faction). If you're following the instructions then it should work. You need to put the hidden resource in three locations, in the descr_regions file, in the recruit line for the unit in export_descr_buildings and also at the top of export_descr_buildings. Are you sure you're doing all these?

PatWest
07-18-2005, 11:18
Yes, I tried it on Vanilla 1.2 and Mundus Magnus 1.0. All it ever accomplished was to remove the ability to recruit that unit at all. What I've been trying to do for starters is limit 'Uber' units to their respective capitals. I tried it with Macedon, Pontus, Julii it doesn't recognize the new resource. I had already figured out how to write all the entries short of the Regions txt file. The tutorial pointed that out. I'll try again. when I tried it on Vanilla 1.2 . I tried it with the original maps rwm and I tried deleting it. It would never fire up when I deleted the rwm file but it did write a new dat file in the data folder. M/M 1.0 doesn't have a rwm file. I so want this to work, it would be the last, for now, of my personal modding and would make the game much more interesting. Like the Patrician and NTW mod for MTW. ~:confused:

Epistolary Richard
07-18-2005, 12:59
The map.rwm file is automatically generated by the game when you launch a campaign, no mod should come with a map.rwm file.

As you're changing the resources in descr_regions you should delete the map.rwm file (from the base folder if you're modding the imperial campaign and the individual campaign folder for provincial campaigns) before launching the game.

PatWest
07-19-2005, 09:22
Epistolary Richard, Myrddraal, Nero

You were right and I was wrong. I tender my humblest apology.

Now for some further questions. Epistolary Richard, did you always get it to work the first time, or did it balk on you occasionally? I got it to work on 1.2 , but I did it the same way as before, I think, and it worked this time. Now I'm trying to accomplish the same thing with Mundus Magnus 1.0 , I already have a lot of time invested in modding this one, and would really prefer to keep it and not go back to ground zero. It turns out that M/M does have a maps rwm file but so far I'm getting the CTD's after I delete it. This was the same problem I had at first with 1.2 so I have hope now that it may be doable. Do you have any other clues that might be of assistance?

P.S. I have one other question indirectly related to this subject. If I make Merc units recruitable by factions will they already come with the correct unit card? Its a lazy question that I can figure out soon enough but if you already know it's only a one word answer.

Epistolary Richard
07-19-2005, 13:27
The hidden resources have always appeared to be pretty robust to me, they've never had patchy functionality to me. If you're have trouble with the MM map, then you're best of talking to the modder himself Dead Moroz (ngr on TWC).

As for merc unit cards, to be honest, I don't know. I've never tried it. I'm interested in the answer though, so if you find out let us know.

PatWest
07-20-2005, 09:13
Thanks for the reply. I'll check with Dead Moroz, I have to ask him what that moniker means. I do think its related to the Mod. I kept trying and got nowhere with it. If I get anymore concrete information I'll post it here and at my other posts on this subject.

PatWest
08-08-2005, 09:30
I have an update, not that anyone is listening. I was able to add all my hidden resources. I added 31, one for each and every region and a some doubled up. It only liked to accept them in small batches around 20 at a time and not much more.

I now have my own ZOR's running on my M/M 1.0 Mod. I used mercs as my generic troops recruitable outside of a factions own zone. Along with capital resources so each faction can only produce their Uber units there. I added Warspites de-greened merc skins 2.1 now it looks and plays just like I wanted.

Now I need to learn how toadd a few more units to the Merc pool. I'll get there.

Epistolary Richard
08-08-2005, 09:40
Hmmm... I've never had any trouble adding large numbers of hidden resources. Anyway, you want a file called descr_mercenaries in your imperial_campaign folder. :smile:

PatWest
08-08-2005, 11:16
Hmmm... I've never had any trouble adding large numbers of hidden resources. Anyway, you want a file called descr_mercenaries in your imperial_campaign folder. :smile:

It got worse when I started using Time 5.0 to redo my accelerated startup. The first time I did that I don't remember having so many crashes. This time out though after all the resource adding I was getting to the point where I had to save after every province or it would crash. It was getting a little tedious.

If you know the ideal tutorial for adding units to the merc pool could you point me in that direction. I assume it's a little more than just knowing a file called descr_mercenaries.

Monkwarrior
08-08-2005, 12:17
If you know the ideal tutorial for adding units to the merc pool could you point me in that direction. I assume it's a little more than just knowing a file called descr_mercenaries.
ER wrote a nice tutorial for new units addition:
https://forums.totalwar.org/vb/showthread.php?t=51750

For a merc unit you must follow the tutorial with some differences:
- Put mercenary_unit as an attribute in export_descr_unit
- Put the unit card and the info pic in folders Data\ui\units\mercs and Data\ui\unit_info\merc
- Instead of making them recruitable in export_descr_building, you must put them in descr_mercenaries

I hope I didn't forget anything. :bow:

PatWest
08-09-2005, 05:38
ER wrote a nice tutorial for new units addition:
https://forums.totalwar.org/vb/showthread.php?t=51750

For a merc unit you must follow the tutorial with some differences:
- Put mercenary_unit as an attribute in export_descr_unit
- Put the unit card and the info pic in folders Data\ui\units\mercs and Data\ui\unit_info\merc
- Instead of making them recruitable in export_descr_building, you must put them in descr_mercenaries

I hope I didn't forget anything. :bow:

If I want to use them as recruitable generic troops wouldn't I want to put them in the export_descr_building txt file? I'm sure I already know that answer.

Thanks for the info on the Unit cards, Monkwarrior.

Epistolary Richard
08-09-2005, 10:39
Well, if you want to make them recruitable in settlements then you put them in edb, if you want to make them recruitable as mercs then you put them in descr_mercenaries... :smile:

PatWest
08-09-2005, 11:28
Epistolary Richard, I've been doing all my posts from work, so sometimes I sound like a bigger Moron than I actually am. I didn't have high speed at home and I didn't bother with a dial up modem in my new computer. This will be cured in 10 days.

After I got home I looked at the file you mentioned and realized that I didn't word the question correctly. I wanted to make a few more existing units into mercs so I could then use them as recruitable troops without having to add the unit cards to each faction. That was something you were curious about in one of the earlier posts. I know the easy way to make a unit recruitable for any faction. I just havn't gotten around to learning how to change the faction color or move the unit card to the right place. Making them mercs as we have found out eliminates the need to add the unit card to each faction, if that was necessary in the first place.

Epistolary Richard
08-12-2005, 11:08
It does, my only concern is whether giving the units the mercenary_unit attribute has any other side effects. I know that mercs and normal units handle disbanding slightly differently, maybe there are other effects I don't know about...

PatWest
08-15-2005, 11:15
It does, my only concern is whether giving the units the mercenary_unit attribute has any other side effects. I know that mercs and normal units handle disbanding slightly differently, maybe there are other effects I don't know about...

I finally started playing my newest version of 'My TW' as the Julii for a start. I've nerfed the Romans considerably so it's actually quite hard. So far I havn't seen anything unusual with the merc units, and Warspites de-greened skins makes it more visually appealing. As I recall since 1.2 the mercs disband into your general population. I don't know what other differences their are other than cost.

P.S. I downloaded your tutorial for adding units and will probably add some this week. I am so ready for High Speed, this Friday Woo Hoo!

Epistolary Richard
08-15-2005, 11:22
Ah, maybe I am remembering the old v1.1 days...

Thanks and enjoy.

LestaT
09-03-2005, 07:45
Something along this line. I added resource horses and camels in desc_region because I just want to make the game dificult to myself where's I can train cavalry if got horses and archers in region that there is wood.

Just a question , should I put it under hidden_resource ? My only 'workable' slf mod before was adding " and resource timber " in export_description_building for oly ports/shipwright/dockyard with timber in the province can produce any sort of ships. I enjoy it though because now I see less ships around.

Back to the question , if I want to apply to cavalry & archers ? Is it the same way ?

1. Add 'resouce' in desc_region

2. Add " and resource horses / woods " in edb ?

OR

3. Add " and hidden_resource .... " in edb ?

I tried option 2 but it CTD right after start. Maybe because some mistakes / typo error because I tried to re-do the whole lot. This time I'll try one faction first and see how it goes. As for my 'timber' mod it works with save game so I can try it in my mid roman campaign. Maybe try not all cavalry but 'elite' cavalry first.

Or maybe add a "min_level_barrack " stuff so have to need a forge before I can train sacred band cav or noble heavy cav or somethin ? Any advice / ideas ?

Cheers.

PatWest
09-06-2005, 19:00
I tried option 2 but it CTD right after start. Maybe because some mistakes / typo error because I tried to re-do the whole lot. This time I'll try one faction first and see how it goes. As for my 'timber' mod it works with save game so I can try it in my mid roman campaign.

Option 3 is the correct one. This is an example of M/M 2.0's EDB file resource line and the regions txt using the kind of resources your doing.

hidden_resources sparta rome italy desert road highway farm2 farm3 farm4 farm5

Tribus_Brigantes
Isurium
britons
Brigantes
232 41 198
furs, lead, road, highway, farm2, farm3
5
4

Cimbrica
Hafnia
germans
Cimbri
232 41 55
timber, amber, road, farm2, farm3
5
4

Locus_Aestii
Vicus_Aestii
germans
Aestii
58 177 95
dogs, amber, road, farm2, farm3

You would have to delete MAP.RWM after you write in your resources and it would only be effective for future campaigns. Timber was already present, I believe, so it worked in-campaign.

Suraknar
10-07-2005, 18:02
Hello,

Is there a limit of how many Conditionals, Positive or Negative we can put? is there a specific Order the conditionals can be made or it does not mater...?

ex: and...and not...and...and not...

Or

and...and...and...and not...and not...and not...

Thank you

Bernhard of Clairvaux
01-25-2006, 17:31
Well I can confirm that there are something buggy about hidden_resources. As I get it you should first add the hidden_resource in region.text and at the top of descr.buildings.txt then delete the rmw.map, then launch the game. First when this is done you should start adding the resource to the actual unit or building.

I have had a lot of problems when doing everything at once and then deleting the rmw.map. Basically the game donĀ“t load or you get weird results like not being able to recruit a unit.

vastator
07-13-2006, 21:58
I'd just like to say I found this article very useful. I've set up Africa and Asia as hidden resources so that elephant recruitment depends on the continent - e.g. you can't recruit Indian elephants in Numidia.

DukeofSerbia
10-09-2006, 12:24
2 - Delete map.rwm
Changes to map or regions file will only appear if you delete map.rwm before you relauch the game. You should delete the file in the same folder as the descr_regions file.



Solution for my problems...:2thumbsup:

DaVinci
10-24-2006, 02:20
Well I can confirm that there are something buggy about hidden_resources. As I get it you should first add the hidden_resource in region.text and at the top of descr.buildings.txt then delete the rmw.map, then launch the game. First when this is done you should start adding the resource to the actual unit or building.

I have had a lot of problems when doing everything at once and then deleting the rmw.map. Basically the game don´t load or you get weird results like not being able to recruit a unit.

Bold: Well, a pretty old post, but i would like to give a hint to this above, and perhaps just an addition to the tutorial.

I work/mod with hidden recources (hr) intensive since ca. 1 year, so you might believe, what i have to say: (but it's all from my mind now without having files open, so there might be little typo faults in code-examples)

- With RTW patch 1.2, hr modding was indeed a bit buggy, and the order of deleting map.rwm etc. wasn't very stable or secure until the hr works. However, patch 1.2 times are gone.

- With RTW patch 1.5 or BI 1.6, you should mod in this order, to have a successful result: (the maximum is still 64 different hr's)

a) 'World' folder: Delete the relevant map.rwm of the active campaign folder. It must not be the map.rwm in the base folder (depends on your mod structure).

b) Campaign folder/descr_regions.txt: Open and add the new hr to the certain region as you wish, comma separated. Save and close.

c) export_descr_buildings.txt (edb): Add the new hr to the already listed ones by default, at the top of the file.

Note: It is indeed possible to add these first into the edb list, and then going to delete map.rwm and add the hr to the descr_regions file.
After a-c the hr is set/active, and you can launch the game, if you wish, but it has naturally no affect as yet.

d) edb further: Now there is the task to set them active. If you intend to combine them with a former building requirement then it will be complicate in some cases due to the tech-tree structure and can lead to actual problems, so i give only examples without them.

d1) Option: building requirement (for example)

dungeons requires faction { ..., ..., } and hidden_resource x and not hidden_resource y and not hidden_resource z

or

dungeons requires hidden_resource x and not hidden_resource y and not hidden_resource z

d2) Option: boni requirement (for example)

law_bonus 2 requires faction { ..., ..., } and hidden_resource x and not hidden_resource y and not hidden_resource z

or

law_bonus 2 requires hidden_resource x and not hidden_resource y and not hidden_resource z

d3) Option: unit requirement (for example, well here a special unit, but it can be "replaced" with any kind of units)

spy 1 requires faction { ..., ..., } and hidden_resource x and not hidden_resource y and not hidden_resource z

or

spy 1 requires hidden_resource x and not hidden_resource y and not hidden_resource z

---

Well, you can add several lines of those kinds as d2-d3 below a building to the capability sections of buildings in edb.


Hope this helps.

Spartan198
02-23-2008, 18:27
So can I add hidden_resource Sparta to all cities and make Spartan hoplites recruitable in all cities?

PS - Are there really Guineapig riders in the game,or is that just an example?

Aradan
02-24-2008, 14:22
Yes, you can add sparta to every region of the map if you want...

Spartan198
02-24-2008, 16:27
What about just removing hidden_resource Sparta all together? Or will that just make Spartan hoplites disappear from my roster campaign roster completely?

Aradan
02-24-2008, 16:43
If you delete the resource , you will have to delete/outcomment the "and hidden-resource sparta" from the Spartan Hoplite recruitment lines in EDB, otherwise it will give you an error (and then you'll also need to delete the map.rwm in order for the change to take effect). But yes, removing sparta resource will make spartans unavailable anywhere. Best way is to simply outcomment the resource prerequisite in the EDB recr lines, that way you'll get Spartan Hoplites everywhere.