Adding a new nation

List of Files needed:
 
 
In game ss:
 
 

Test for creating a new nation in cossacks      14/04/2009
 
Goal: creating a new playable nation Tunesia based on an already existing nation to speed up things.
 

Step1: Copy BTW to work with and test
Step2: Make a folder to put all modified gsc files in
Step3: Extract all.gsc file in + extraction mode and copy all files from the extracted folder to a new folder within the GSC utility folder.
           This step is just a precaution in case you change smth erroneously to the files and need to see the original again.
Step4: Trying to define what files will need changes. Reading http://cossacksworld.ucoz.co.uk/index/0-34 about previous test.
 
Going to use Algeria as the bases to build a new nation
So definetely these files:
Algeria.nds
Nations.lst 
TEXT+Nations.txt
TEXT+AI.txt
AI+AI.dat
DATA+Start1-9.dat
DATA+Unitslist.dat
unitslist.dat
DATA+Upglist.dat
Filelist.lst
Algeria_bld.bmp
 
Other files that might be involved:
 
AI.dat
mdlist.Txt
nmlist.lst

Note : Use mods.gs1 or mods01.gs1 to create
 
Step 5: start modifying all nation related entries from Algeria(AL) to Tunesia(TN)
 
Start off with the nds file.Locate ALGIR.NDS
Copy it to your workfolder
Rename it to TUNESIA.NDS
Open it.
Use Replace function in notepad and replace all (AL) to (TN). Saves you typing 200 times (TN)
Now manually change all the akademy references from
AKAXXAL to AKAXXTN  ( where xx is the number) ( this will have to be done aswell in upglist.txt)
Finish up any remaining entries that influence the nations appearance
for example [COUNTRY] ( setting for editor)
but dont go and change the units or you will have a lot more work then needed, right now for speeding up we will use the same units to test
Save the file
 
next file to change:
text+nations.Txt
Copy, open it
add:
#TUNESIA Tunesia to the top of the list
Save it
 
Next file to change:
text+ai.txt
Copy,open it
add:
TUNESIA.0 AI\Tunesia.dll
Save
 
next file to change:
AI+AI.dat
Copy, open it
add:
21 21
TUNESIA    Tunesia       Krestian_Turki(TN)  9 1 1 - -

Save it
 
next file to change:
data+start1:
copy, open it
add:
#Krestian_Turki(TN)
0 1000 0 0 0 0
6
Pehota_turki(TN) P
Krestian_Turki(TN) X
Oficer_turki(TN) O
Barabanshik_Turki(TN) B
BGAUZ(TN)  Q
BGAUZ2(TN) W
20 4
              B            B  
          PPPPPP  XXXXXX  PPPPPP 
          PPPPPP  XXXXXX  PPPPPP  
 Q        PPPPPP  XXXXXX  PPPPPP       W
          PPPPPP  XXXXXX  PPPPPP       
          PPPPPP  XXXXXX  PPPPPP       
O         PPPPPP          PPPPPP        O
Save it
 
Next file to open
data+ start 2:
copy it, open it
add:
#Krestian_Turki(TN)
0 20000 0 0 0 0
4
Mameluk(TN) P
Krestian_Turki(TN) X
BGAUZ(TN)  Q
BGAUZ2(TN) W
20 4
                              
       PPPPPPPPPP XXXXXX PPPPPPPPPP
       PPPPPPPPPP XXXXXX PPPPPPPPPP
 Q     PPPPPPPPPP XXXXXX PPPPPPPPPP    W
       PPPPPPPPPP XXXXXX PPPPPPPPPP    
       PPPPPPPPPP XXXXXX PPPPPPPPPP    
       PPPPPPPPPP XXXXXX PPPPPPPPPP  
   
 
next file
data+start 3
copy it, open it
add:
#Krestian_Turki(AL)
0 20000 0 1000 6000 9000
4
Strelec_Algir(AL) P
Krestian_Turki(AL) X
BGAUZ(AL)  Q
BGAUZ2(AL) W
20 4
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP
 Q    PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP   W
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP   
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP   
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP
      PPPPPPPPPPPXXXXXXXXPPPPPPPPPPP
 
next file
data+Start4
copi it, open it
add:
#Krestian_Turki(TN)
0 20000 0 1000 6000 9000
3
Krestian_Turki(TN) X
BGAUZ(TN)  Q
BGAUZ2(TN) W
20 4
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Q    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   W
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
next file:
data+start5
open it
this is a difficult entry ( its the diff nations one)
First add tunesia as a whole:
#Krestian_Turki(TN)
5000 5000 5000 0 5000 5000
23
Krestian_Turki(TN) B
Krestian_Sved(SW) M
Kreposnoi_pruss(VG) N
Kreposnoi_pruss(BA) E
Kreposnoi_pruss(DA) R
Kreposnoi_pruss(au) T
Krestian_Turki(AL) Y
Krestian_Sved(en) U
Krestian_Sved(fr) I
Kreposnoi_pruss(GE) O
Krestian_Sved(HO) P
Kreposnoi_portugal(PI) A
Kreposnoi_evro(PL) S
Kreposnoi_portugal(PO) D
Kreposnoi(RU) F
Kreposnoi_pruss(SA) G
Kreposnoi_portugal(sp) H
Krestian_Sved(SV) J
Krestian_Turki(TU) K
Kres_ukranian(UA) L
Kreposnoi_portugal(VE) Z
BGAUZ(AL)  Q
BGAUZ2(AL) W
20 19
                    Q          
 
 
 
 
 
        BBBBBBBBBBBB  MMMMMMMMMMMM
        EEEEEEEEEEEE  RRRRRRRRRRRR
        TTTTTTTTTTTT  YYYYYYYYYYYY
        UUUUUUUUUUUU  IIIIIIIIIIII     
        OOOOOOOOOOOO  PPPPPPPPPPPP     
 Q      AAAAAAAAAAAA  SSSSSSSSSSSS     W
        DDDDDDDDDDDD  FFFFFFFFFFFF      
        GGGGGGGGGGGG  HHHHHHHHHHHH
        JJJJJJJJJJJJ  KKKKKKKKKKKK
        LLLLLLLLLLLL  ZZZZZZZZZZZZ
        NNNNNNNNNNNN
 
 
 
 

                    W

Then second part, add for each(all) nation the line:
23
Krestian_Turki(TN) B
and type 12 times B in the figure , make sure you space out the M&M's right
 
Wow, long list. Time for a coffee
 
next file:
data+Start6
copy, open
add:
#Krestian_Turki(TN)
0 20000 0 1000 6000 9000
3
Krestian_Turki(TN) X
Bashnia_3(TN)  Q
Bashnia_3(TN) W
12 4
             
        XXXXXX
        XXXXXX
 Q      XXXXXX     W
        XXXXXX   
        XXXXXX   
        XXXXXX

save
 
next file:
data+start7
copy open
add:

#Krestian_Turki(TN)
0 20000 0 1000 6000 9000
4
Pushka(TN)  P
Krestian_Turki(TN) X
Bashnia_3(TN) Q
Bashnia_3(TN) W
12 4
 P P P P P P P P P P P             
        XXXXXX
        XXXXXX
 Q      XXXXXX       W
        XXXXXX   
        XXXXXX   
        XXXXXX

        

next file
data+Start8
copy, open
add:
#Krestian_Turki(TN)
0 20000 0 1000 6000 9000
5
Mortira(TN) M
Pushka(TN)  P
Krestian_Turki(TN) X
Bashnia_3(TN)  Q
Bashnia_3(TN) W
12 4
 P P P P P P P P P P P             
        XXXXXX
        XXXXXX
 Q      XXXXXX       W
        XXXXXX   
        XXXXXX   
        XXXXXX
 M M M M M M M M M M M

next file
data+start 9
copy open
add
#Krestian_Turki(TN)
2000 65000 2000 1000 6000 9000
2
Krestian_Turki(TN) X
Barack_Turki(TN) E
20 4
      X                          X
      X                          X
      X                          X
E     X       E        E         X     E
      X                          X   
      X                          X   
      X                          X
      X                          X

Well so far the start files ;-)
 
next file:
nations.lst
copy, open
add
23
TUNESIA Tunesia TUNESIA.NDS #TX 17 93     (tn) (TN)
Save
 
next file
data+units list
copy open
add:
Tunesia
Krestian_Turki(TN) Peasant
Pehota_turki(TN) Light Infantryman
Pikiner_turki(TN) Ottoman Pikeman
Strelec_Algir(TN) Archer
Barabanshik_Turki(TN) Drummer
Mullan(TN) Mullah
Oficer_turki(TN) Officer
Mameluk(TN) Mameluke
Pushka(TN) Cannon
Mortira(TN) Howitzer
Mortira_b(TN) Mortar
Center_Algir(TN) Town Hall
Dom_Algir(TN) Dwelling
Rinok_Turki(TN) Bazaar
Sclad4(TN) Storehouse
shahta(TN) Mine
shahta_FE(TN) Mine
shahta_UG(TN) Mine
Kuznia_Turki(TN) Blacksmith
Mechet_Turki(TN) Mosque
Minaret(TN) Minaret
Diplomatic_Turki(TN) Diplomatic Centre
Barack_Turki(TN) Barracks
Konushnia_Turki(TN) Stable
Art_Depo_Turki(TN) Artillery Depot
Bashnia_3(TN) Tower
WALL_TU(TN) Wall
WALL_UKR(TN) Paling
FIELD(TN) Grain Crops
Lodka(TN) Boat
PERES_KOR(TN) Ferry
GALERA(TN) Galley
Shebeka(TN) Xebec
Linkor(TN) Ship of the Line
Port(TN) Shipyard
Melnica_tu(TN) Mill
Rundashir_Avstria_DIP(TN) Roundshier (mercenary)
Grenader_DIP(TN) Grenadier (mercenary)
Pehota_turki_DIP(TN) Infantryman (mc.)
Strelec_Algir_DIP(TN) Archer (mercenary)
Kozak_loshad_DIP(TN) Sich Cossack (mc.)
Dragun_18_DIP(TN) Dragoon, 18th c. (mc.)
BGAUZ(TN) Blockhouse
BGAUZ2(TN) Blockhouse
 
next file
data+upglist
copy, open
add:
Tunesia Pikiner_turki(TN)ATTACK Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Pikiner_turki(TN)ATTACK3 Conduct a fencing drill (cold steel weapons' attack +2)
Tunesia Pikiner_turki(TN)ATTACK4 Conduct a fencing drill (cold steel weapons' attack +3)
Tunesia Pikiner_turki(TN)ATTACK5 Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Pikiner_turki(TN)ATTACK6 Conduct a fencing drill (cold steel weapons' attack +2)
Tunesia Pikiner_turki(TN)SHIELD Conduct a physical training (morale, defence +1)
Tunesia Pikiner_turki(TN)SHIELD3 Conduct a physical training (morale, defence +2)
Tunesia Pikiner_turki(TN)SHIELD4 Conduct a physical training (morale, defence +3)
Tunesia Pikiner_turki(TN)SHIELD5 Conduct a physical training (morale, defence +1)
Tunesia Pikiner_turki(TN)SHIELD6 Conduct a physical training (morale, defence +2)
Tunesia Pehota_turki(TN)ATTACK Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Pehota_turki(TN)ATTACK3 Conduct a fencing drill (cold steel weapons' attack +2)
Tunesia Pehota_turki(TN)ATTACK4 Conduct a fencing drill (cold steel weapons' attack +3)
Tunesia Pehota_turki(TN)SHIELD Conduct a physical training (morale, defence +1)
Tunesia Pehota_turki(TN)SHIELD3 Conduct a physical training (morale, defence +2)
Tunesia Pehota_turki(TN)SHIELD4 Conduct a physical training (morale, defence +3)
Tunesia Barabanshik_Turki(TN)SHIELD Conduct rehearsals (morale, defence +70)
Tunesia Oficer_turki(TN)ATTACK Conduct a fencing drill (cold steel weapons' attack +150)
Tunesia Oficer_turki(TN)SHIELD Conduct a physical training (morale, defence +20)
Tunesia AKA01AL Cultivate new cultures of wheat (harvesting +20%)
Tunesia AKA02AL Cultivate new cultures of rye (harvesting +15%)
Tunesia AKA03AL Raise agriculturists' salary (harvesting +10%)
Tunesia AKA04AL Carry out field melioration (field capacity +200%)
Tunesia AKA05AL Design new tackle and fishing nets (boats' efficiency +100%)
Tunesia AKA06AL Develop new woodworking methods (xebec building)
Tunesia AKA07AL Build new shipyards for fishing boats (fishing boat cost -85%)
Tunesia AKA08AL Design new woodworking tools (wood extraction efficiency +100%)
Tunesia AKA09AL Use new construction materials (durability of buildings +85)
Tunesia AKA10AL Raise builders' salary (buildings' construction time -75%)
Tunesia AKA11AL Research new fortification grades (walls' and towers' durability +80)
Tunesia AKA16AL Research improved additions to gunpowder formula (range of artillery fire +5%)
Tunesia AKA17AL Design new barrel types: unicorn, carronade (range of artillery fire +10%)
Tunesia AKA18AL Design more durable gun carriage: Gribovalle system (artillery durability +150%)
Tunesia AKA20AL Research new sighting devices for artillery (shooting accuracy +35%)
Tunesia AKA21AL Finance artillery repair shops (repair all artillery)
Tunesia AKA22AL Develop geology (previously hidden deposits appear on the map)
Tunesia AKA23AL Develop mining (stone extraction efficiency +100%)
Tunesia AKA24AL Raise miners' salary (stone extraction efficiency +300%)
Tunesia AKA26AL Develop medical science (heals all live units)
Tunesia AKA27AL Develop mathematics (accuracy of artillery fire +35%)
Tunesia AKA28AL Design new rigging types (vessels' speed +40%)
Tunesia AKA29AL Design new rib system and new hulls (battleship building)
Tunesia AKA30AL Train carpenters (increases vessel building speed 10 times)
Tunesia Bashnia_3(TN)PAUSE Increase number of defensive cannon (20%)
Tunesia Bashnia_3(TN)PAUSE3 Increase number of defensive cannon (20%)
Tunesia Bashnia_3(TN)PAUSE4 Increase number of defensive cannon (20%)
Tunesia Bashnia_3(TN)PAUSE5 Increase number of defensive cannon (20%)
Tunesia Bashnia_3(TN)PAUSE6 Increase number of defensive cannon (20%)
Tunesia Bashnia_3(TN)PAUSE7 Increase number of defensive cannon (30%)
Tunesia shahta(TN)INSIDE Enlarge mines and build extensive railroad network for them (+5)
Tunesia shahta(TN)INSIDE3 Enlarge mines and build extensive railroad network for them (+8)
Tunesia shahta(TN)INSIDE4 Enlarge mines and build extensive railroad network for them (+10)
Tunesia shahta(TN)INSIDE5 Enlarge mines and build extensive railroad network for them (+12)
Tunesia shahta(TN)INSIDE6 Enlarge mines and build extensive railroad network for them (+15)
Tunesia shahta(TN)INSIDE7 Enlarge mines and build extensive railroad network for them (+40)
Tunesia Melnica_tu(TN)GETRES Improve grain crops treatment (harvesting +140%)
Tunesia KUZ01AL Manufacture agricultural equipment (fields' efficiency +100%)
Tunesia KUZ02AL Forge metal armature and gratings (buildings' defence +50)
Tunesia KUZ03AL Forge harnesses for horses (increases mounted units' building speed 4 times)
Tunesia KUZ05AL Forge new types of broadswords and sabres (cavalry attack +5)
Tunesia Pushka(TN)COST Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)COST3 Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)COST4 Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)COST5 Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)COST6 Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)COST7 Foundry mechanization (decreases cost by 7%)
Tunesia Pushka(TN)BUILD Develop new metalworking methods (speed up building by 50%)
Tunesia Pushka(TN)BUILD3 Develop new metalworking methods (speed up building by 50%)
Tunesia Pushka(TN)BUILD4 Develop new metalworking methods (speed up building by 50%)
Tunesia Pushka(TN)BUILD5 Develop new metalworking methods (speed up building by 50%)
Tunesia Pushka(TN)BUILD6 Develop new metalworking methods (speed up building by 50%)
Tunesia Pushka(TN)BUILD7 Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)COST Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)COST3 Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)COST4 Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)COST5 Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)COST6 Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)COST7 Foundry mechanization (decreases cost by 7%)
Tunesia Mortira(TN)BUILD Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)BUILD3 Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)BUILD4 Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)BUILD5 Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)BUILD6 Develop new metalworking methods (speed up building by 50%)
Tunesia Mortira(TN)BUILD7 Develop new metalworking methods (speed up building by 50%)
Tunesia Mameluk(TN)ATTACK Conduct a fencing drill (cold steel weapons' attack +2)
Tunesia Mameluk(TN)ATTACK3 Conduct a fencing drill (cold steel weapons' attack +3)
Tunesia Mameluk(TN)ATTACK4 Conduct a fencing drill (cold steel weapons' attack +4)
Tunesia Mameluk(TN)ATTACK5 Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Mameluk(TN)ATTACK6 Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Mameluk(TN)ATTACK7 Conduct a fencing drill (cold steel weapons' attack +1)
Tunesia Mameluk(TN)SHIELD Conduct a riding drill (morale, defence +3)
Tunesia Mameluk(TN)SHIELD3 Conduct a riding drill (morale, defence +4)
Tunesia Mameluk(TN)SHIELD4 Conduct a riding drill (morale, defence +5)
Tunesia Mameluk(TN)SHIELD5 Conduct a riding drill (morale, defence +2)
Tunesia Mameluk(TN)SHIELD6 Conduct a riding drill (morale, defence +2)
Tunesia Mameluk(TN)SHIELD7 Conduct a riding drill (morale, defence +2)

Save
 
next file:
units list ( this is not the same file as data+units list) ( told you to exctract all gsc as + mode)(otherwise use file renamer to rename)
copy, open
add:
Tunesia 0
 
next file
Algir_bld.bmp
Copy, rename to Tunesia_bld.bmp
 
next file
Algeria.dll
copy rename Tunesia.dll

next file:
filelist.lst
here we will add all the new files that are not in the game yet:

TUNESIA.NDS
 


Time to see where we are
 
Put all files in to gsc utility and create mods.gs1

should have 19 files to process
 
Paste mods.gs1 in BTW test folder. Go to editor and check if the nation is present. Go to random map, check if the nation is present in the drop down list
 
AHAHAHAHAHAHAHAH, kewl, loaded straight up, didnt show no errors, can select Tunesia in editor AND in Random Map
Didnt even look back to see if i made mistakes.  Don't know what i forgot to do last time that it didnt work.
 
(...2 minutes later...)
Ok i cheered to soon. When I start playing debugger says that i have an invalid name for shahta(AL), obviously an entry i forgot to change.
Back to the upglist and nds files to clean up the remaining errors.
 
But the fact that the nation is present besides all other nations is a great improvement.

Time for a break
 
Well clearly I forgot a bunch of entries that refer to the upgrades in the NDS file. I suggest you change them all to (AL) or AL but also in the upglist aswell then
example
//SHAHTA
shahta(TN)INSIDE SH1 #POSITION 2 2 #LEVEL 2 shahta(tn)INSIDE #COST 2 FOOD 1000 GOLD 1250 #TIME 500
 SINGLE_INSIDE shahta(TN) +5
(from nds)
(and in upglist)( see list above -still has plenty of AKAxxAL
Manually verify all [ENTRIES]
 
time to test again
mods.gs1

Still the same error appearing invalid upg shahta(AL) +5
If i ignore it runs trough the list up mine upgrades that cause errors

Ok so the shahta upg issue is solved ,i forgot another entry

but now when i hit start to play with tunesia vs bavaria(ai) it starts loading and crashed to desktop with out any warning.
Did something wrong
Gotta think again.
 
There must be other files involved or i must have made an error in one of the entries.

 
Ok, some more information on this test:
 
When i go in to map editor, and place units for Tunesia and then go to Random Map/Designed, i can start playing. All buildings are accessible and all units work fine:
 
So the nation is present & playable .
Now why i get a ctd on starting up a random game(default) and not in designed, eludes me somewhat at the moment.
But it also means that the error cant be too big since the nation is present & playable
 
A wild shot in the dark but it might have to do something with placing the peasants on start up on the map.Though i have no clear idea of how to start tackling this problem.
If someone has an idea....
 

Update 15/04:
 
After some tests i narrowed the problem down. What I did was instead of in random map-starting with default options, i started with an army. It loaded fine and is playable:
 
 
So this must mean there is a problem with the initial start file.
Will do some more tests but this should be in the data+Start options, but there is no data+Start0 which would be the default, because the data+Start1 is the second option in the menu ( army)
So where is this file located?
I guess a workaround is possible by deleting the default @@@RMID option in the txt file and rewrite all data+Starts but hey thats to much work for something that really should be there in the first place.
 

Update:
 
So another test under debugger gives me following message: Unable to assign Peasant ID.
Which proves that it has something to do with the starting settings for peasants as describe above.
 

 
Update:
 
Thanks to [BOB]Grandline we found a solution that was rather surprising. Copied the data+start4 and renamed it data+start0 . Works like a charm except as expected (!) to start with aop under default, it started with default.(lol)
I'll update soon the above text so that any remaining errors are deleted.
Finally a working new nation offline.
 

Update:
 
After doing some more tests we finally were succesfull in making the new nation work online aswell :
 
 
First there was an issue with the nations not appearing properly. This was solved by using the same ai.dat file in main directory for both users. ( Dont think here to deep , its where i made a mistake, by thinkin that the ai.dat cant have consequences for showing the list of nations in random online, it shouldn't , but it does...)
Another problem was that the game first crashed when i chose the color purple. We have not been able to recreate this problem and it has not occured anymore since.
All colors are playable on both sides. We have not done tests with more then 2 players, since we havent distributed the mini mod and it was only for testing purposes.
 
Now about changing the nations particularities (units, upgrades, building order,...) i refer to the anatomy of the files and previous tests.