Historic Ship Names Modcomp [WIP]

orlanth

Storm God. Yarr!
Joined
Nov 17, 2001
Messages
1,805
As a Perl learning project, I made some quick regular expressions to extract arrays of historic ship names from wikipedia articles. It worked well and I'll paste a list of the resulting ship names below.
Spoiler :
Dutch
if ($line =~ /^\W+([\D]+)\d/) {printf OUT"\"$1\",";}
"Eenhoorn","Salamander","Gelderland","Fredrik Hendrik","Eendracht","Zon","Groningen","Ter Goes","Prinses Roijael","Utrecht","Gewapende Ruyter","Maan","Zeven Provincien","Haarlem","Brederode","Huis van Nassau","Graaf Willem","Kameel","Postiljon van Smyrna","Vrede","Jaarsveld","Vrijheid","Mercurius","Louisa Hendrika","Vogelstruis","Witte Lam","Groote Liefde","Campen","Sint Matheeus","Rosenkrans","Zeelandia","Vlissingen","Middelburg","Kampveere","Prins Willem","Gelderland","Eendracht","Prinses Amalia","Dordrecht","Sint Matheeus","Caleb","Jupiter","Drie Helden Davids","Willem van Nieuhoff","Westergo","Stad en Lande","Prinses Albertina","Oostergo","Huis te Swieten","Huis te Cruiningen","Delfland","Amsterdam","Landman","Huis te Oosterwijk","Beurs van Amsterdam","Jozua","Duivenvoorde","Doesburg","Carolus Quintus","Zeelandia","Westvriesland","Prinses Maria","Admiraal Generaal","Kapitein Generaal","Hollandia","Akerboom","Prince Friso","Prins Willem","Kasteel van Medemblik","Koning William","Keurvorst van Brandenburg","Keurvorstin van Brandenburg","Keurvorst van Saksen","Beschermer","Beschermer","Unie","Gouda","Reigersberg","Zeven Provincien","Vrijheid","Zeelandt","te Veere","Nassauw","Middelburg","Eendragt","Matenes","Hardenbroek","Overwinnaer","Buis","Wolfswinkel","Starrenburg","Schonauwen","Huis te Nek","Loosdregt","Boetzelaer","Amsterdam","Ter Meer","Duinveld","de Purmer","Leyden","Gelderland","Roozendaal","Gouda","Souterwoude","Haarlem","Kasteel van Egmont","Polaanen","Damiaten","Tholen","Heemstede","Kasteel van Medenblick","Valkenburg","Beemsterlust","Twikkelo","Maas","Proventie Utrecht","Ramhorst","Prins Friso","Boekenroode","Delft","Brederode","Vrijheid","Moriaanshoofd","Watervlied","Zierikzee","ter Goes","Vlissingen","Assendelft","Haarlem","Delft"

Spanish
if ($line =~ /^\W+\* ([\D]+)\(/) {printf OUT"\"$1\",";}
"Algeciras","Nuestra Señora de la Concepción","Nuestra Señora del Buen Consejo","San Miguel","San Joseph","San Pedro y San Pablo","Santa Ana","Nuestra Señora de la Almudena","Real Mazi","San Felipe","Santa Rosa Palermo","Conde de Tolosa","Incendio","Retiro","Constante","Fuerte","Andalucia","Constante","Africa","Europa","Asia","America","Dragon","Castilla","Invencible","Glorioso","Bizarro","Invencible","Conquistador","Africa","Vencedor","Tigre","Princesa","Galicia","Infante","Oriente","Eolo","Neptuno","Magnanimo","Aquilon","Gallardo","Brillante","Hector","Soberano","Astuto","America","San Telmo","San Felipe","Santiago el Mayor","San Martin","San Juan Baptista","Santiago","San Juan Bautista","San Agustín","San Tomás de Aquino","San Agustín","San Ambrosio","San Gerónimo","Santo Cristo de Burgos","La Visitación de Nuestra Señora","Nuestra Señora de la O","La Natividad de Nuestra Señora","La Concepción","Nuestra Señora de la Purificatión","La Salutación de la Virgen"
if ($line =~ /^(\D+)\s\s/) {printf OUT"\"$1\",";}
"San Miguel","Águila de Nantes","Esperanza","Sorpresa","Juno","Tigre","San Fernando el Chico","San Fernando el Pequeño","Fernandillo","Principe de Asturias","Ynfante","Santa Isabel","Reina Santa Isabel","San Felipe","Felipillo","El Chico","San Juan el Chico","San Juanico","Santa Ana","Volante","Perla de España","San Francisco","San Antonio de Padua","San Marcos","Galera de España","Victoria","Conde de Tolosa","Pingue Pintado","Águila Volante","Andalucia Baja","Iris","Júpiter","Peregrina","Tolosilla","Providencia","Sán Jose","El Real Jorge","Rebeca","San Francisco JavierHermiona","San Jorge","El Selerais","Unicornio","Galera Victoria","Galgo de Andalucia","Fidela","Santa Rita","Galera de Neptuno","Gusana","Pingue Volante","San Andrés","Santa Susana","Santa Teresa","Júpiter","Nuestra Señora de Atocha","La Griega","San Esteban Apedreado","La Catalina","Santa Catalina","El Jardín de Tritón","Santiago","Neptuno","Burlandín","El Burlando","Gusana","Concepción","Nuestra Señora de Aránzazu","Nuestra Señora del Rosario","Santa Susana","Neptuno","Santa Bárbara","La Chata","La Señora Sara","San Francisco Javier","Victoria","Galera Victoria","Galera Victoria","San Cayetano","Concepción","Hermione","Flora","Triunfo","San Cristóbal","Astrea","Santa Bárbara","Santa Bárbara","Estrella","Águila","Aurora","Concepción","Flora","Santa Rosalía","La Galga","Perla","Flecha","Pena","Venganza","Júpiter","Águila","Dorada","Esmeralda","Ventura","Venturera","Liebre","Santa Cristina","Venus","Santa Brígida","Victoria","Industria","Juno","Santa Cecilia","Palas","Santa Yrene","Astra","Santa Catalina Virgen y Mártin","Concepción","Tetis","Guadalupe","Fenix","Santa Bárbara","Soledad","Santa Rosa","Santa Rosalía","Santa Catalina","Santa Teresa","Santa Gertrudis","Santa Bárbara","Santa Lucía","Nuestra Señora del Rosario","Nuestra Señora del Carmen","Santa Dorotea","Nuestra Señora de la Asunción","Santa Perpetua","Santa María de la Cabeza","Santa María Magdalena","Esmeralda","Santa Clara","Santa Margarita","Santa Marta","Santa Dorotea","Santa Clara","Santa Leocadia","Santa Rufina","Santa Mónica","Santa Águeda","Santa Cecilia","Grana","Nuestra Señora de la Paz","Santa Matilde","Nuestra Señora de la O","Santa Escolástica","Santa Balbina","Santa Bibiana","Santa Paula","Héroe","Real Jorge","San Jorge","Santa María de la Cabeza","Santa Clara","Santa Sabina","Nuestra Señora de Loreto","Santa Rosa","Nuestra Señora del Pilar","Colón","Santa Elena","Santa Tecla","Santa Casilda","Santa Brígida","Santa María","Nuestra Señora de la Paz","Nuestra Señora de las Mercedes","Nuestra Señora de Guadalupe","Santa Florentina","Santa Leocadia","Santa Teresa","Santa Catalina","Nuestra Señora de la Soledad","Santa Catalina","Nuestra Señora de Atocha","Mahonesa","Santa Mónica","Palas","Juno","Perla","Santa Mónica","Minerva","Santa Marta","Ceres","Nuestra Señora de la Almudeda","Preciosa","La Divina Pastora","Esmeralda","Santa Petronila","Diana",Santa Ana","Tetis","Santa Amalia","Gloria","Santa Mónica","Venganza","Santa Petronila","Sirena","Santa Genoveva","Ifigenia","La Paloma","Santa Quiteria","La Flora","Santa María Magdalena de Pacis","Fama","Santa Victoria","Ninfa","Nuestra Señora del Rosario","Anfítrite","Santa Úrsula","Medea","Proserpina","Hermione","Prueba","Cornelia","María Isabel","Mercurio","Astrolabio","Ligera","Pronta","Viva","Aretusa","Lealtad","Iberia","Villa de Bilbao","Esperanza","Cortes","Isabel II","Reina María Cristina","Bailén"

French
if ($line =~ /^.+o \/([^\d<]+)\//) {printf OUT"\"$1\",";}
"Galathée","Mutine","Emeraude","Fine","Sirène","Renomée","Amphitrite","Megere","Topaze","Thétis","Heroine","Comète","Fleur de Lys","Licorne","Sauvage","Hermine","Opale","Minerve","Oiseau","Blonde","Brune","Aigrette","Vestale","Félicité","Alcmène","Aimable","Infidèle","Légère","Sincère","Inconstante","Blanche","Enjouée","Dédaigneuse","Belle Poule","Amphitrite","Tourterelle","Indiscrète","Sensible","Pourvoyeuse","Consolante","Nymphe","Andromaque","Astrée","Sibylle","Diane","Néréide","Fine","Émeraude","Charmante","Junon","Gracieuse","Inconstante","Hélene","Concorde","Courageuse","Hermione","Iphigénie","Surveillante","Résolue","Gentille","Amazone","Prudente","Gloire","Bellone","Médée","Magicienne","Précieuse","Vestale","Alceste","Iris","Réunion","Modeste","Topaze","Cérès","Fée","Galathée","Railleuse","Fleur de Lys","Charente Inférieure","Capricieuse","Friponne","Capricieuse","Prudente","Vénus","Cléopâtre","Félicité","Calypso","Fidèle","Fortunée","Sémillante","Insurgente","Charente Inférieure","République Française","Décade Française","Cocarde Nationale","Régénérée","Bravoure","Patriote","Fidèle","Dédaigneuse","Thémis","Heureuse","Chiffonne","Vénus","Hébé","Dryade","Proserpine","Sibylle","Carmagnole","Danae","Méduse","Didon","Nymphe","Thétis","Cybèle","Concorde","Minerve","Junon","Impérieuse","Melpomene","Minerve","Valeureuse","Infatigable","Carrère","Muiron","Seine","Révolutionnaire","Spartiate","Indienne","Furieuse","Virginie","Courageuse","Harmonie","Volontaire","Cornélie","Didon","Rhin","Belle Poule","Surveillante","Atalante","Preneuse","Africaine","Armide","Minerve","Pénélope","Flore","Amphitrite","Niémen","Saale","Saale","Alcmène","Circé","Antigone","Cléopatre","Magicienne","Gloire","Président","Topaze","Vénus","Junon","Calypso","Amazone","Consolante","Piémontaise","Italienne","Danae","Bellone","Néréide","Illyrienne","Galatée","Milanaise","Vistule","Oder","Oder","Perle","Hortense","Hermione","Pomone","Manche","Caroline","Pauline","Corona","Pallas","Elbe","Amélie","Clorinde","Renommée","Elisa","Favorita","Astrée","Fidèle","Adrienne","Aurore","Nymphe","Iphigénie","Méduse","Pregel","Ariane","Médée","Andromaque","Yssel","Carolina","Principessa di Bologna","Gloire","Meuse","Terpsichore","Erigone","Aréthuse","Jahde","Trave","Weser","Melpomene","Rubis","Ems","Atalante","Cérès","Piave","Dryade","Dryade","Sultane","Étoile","Rancune","Amphitrite","Cybele","Duchesse de Berry","Constance","Thétis","Astrée","Armide","Proserpine","Iphigénie","Néreide","Ceylon","Vengeance","Résistance","Forte","Egyptienne","Romaine","Immortalité","Impatiente","Incorruptible","Revanche","Libre","Comète","Désirée","Poursuivante","Jeanne d'Arc","Clorinde","Amazone","Vestale","Vénus","Cérès","Syrène","Atalante","Artémise","Andromède","Gloire","Poursuivante","Virginie","Cléopatre","Danae","Néreide","Zénobie","Alceste","Pandore","Sibylle","Reine Blanche","Surveillante","Iphigénie","Terpsichore","Dryade","Belle Gabrielle","Herminie","Melpomène","Didon","Uranie","Belle Poule","Sémillante","Andromaque","Forte","Renommée","Persévérante","Vengeance","Entreprenante","Erigone","Africaine","Jeanne d'Arc","Pénélope","Chartre","Psyché","Clorinde","Héliopolis","Algérie","Isis"

English
if ($line =~ /o \/(.+?)\//) {printf OUT"\"$1\",";}
"Royal Prince","Charles","St Andrew","London","Prince","Royal James","Royal Charles","Royal James","Royal Katherine","Royal Oak","Loyal London","Victory","French Ruby","St Michael","Clove Tree","House of Sweeds","Golden Phoenix","Slothany","Helverson","Cambridge","Warspite","Defiance","Rupert","Resolution","Monmouth","Edgar","Swiftsure","Harwich","Royal Oak","Defiance","Arms of Rotterdam","Montagu","Bonaventure","West Friesland","Seven Oaks","Charles V","Guilder de Ruyter","Maria Sancta","Mars","Delfe","St Paul","Hope","Black Spread Eagle","Golden Lion","Zealand","Unity","Young Prince","Black Bull","Constant Warwick","St Patrick","Greenwich","St David","Stathouse van Harlem","Stavoreen","Arms of Terver","Oxford","Woolwich","Kingfisher","Britannia","Vanguard","Windsor Castle","Sandwich","Duchess","Albemarle","Neptune","Duke","Ossory","Coronation","Lenox","Hampton Court","Anne","Captain","Restoration","Berwick","Burford","Eagle","Expedition","Grafton","Pendennis","Northumberland","Essex","Kent","Exeter","Suffolk","Hope","Elizabeth","Stirling Castle","Breda","Devonshire","Cornwall","Boyne","Russell","Norfolk","Humber","Sussex","Torbay","Lancaster","Dorsetshire","Cambridge","Chichester","Newark","Shrewsbury","Cumberland","Ranelagh","Somerset","Bredah","Ipswich","Yarmouth","Medway","Carlisle","Winchester","Canterbury","Sunderland","Pembroke","Gloucester","Windsor","Kingston","Exeter","Bedford","Orford","Nassau","Revenge","Dreadnought","Association","Barfleur","Namur","Triumph","Chatham","Centurion","Chester","Norwich","Weymouth","Falmouth","Rochester","Portland","Southampton","Norwich","Dartmouth","Anglesea","Colchester","Romney","Lichfield","Lincoln","Coventry","Severn","Burlington","Harwich","Pendennis","Blackwall","Guernsey","Nonsuch","Warwick","Hampshire","Winchester","Salisbury","Worcester","Dartmouth","Jersey","Carlisle","Tilbury","Falkland","Royal William","Queen","Victory","Royal Oak","Defiance","Swiftsure","Crown","Dragon","Newcastle","Bristol","Dover","Northumberland","Stirling Castle","Resolution","Nassau","Elizabeth","Restoration","Nottingham","Mary","York","Swallow","Antelope","Leopard","Panther","Newcastle","Reserve","Saint Albans","Colchester","Prince George","St George","Royal Katherine","Union","Devonshire","Chichester","Cornwall","Resolution","Burford","Eagle","Expedition","Kent","Stirling Castle","Suffolk","Berwick","Edgar","Essex","Grafton","Hampton Court","Lenox","Northumberland","Restoration","Elizabeth","Monmouth","Warspite","Rupert","Defiance","Montague","Monck","Dunkirk","Plymouth","Dreadnought","Advice","Assistance","Bonaventure","Greenwich","Kingfisher","Deptford","Southampton","Reserve","Tiger","Falkland","Crown","Ruby","Marlborough","Blenheim","Neptune","Vanguard","Princess","Sandwich","Barfleur","Boyne","Humber","Russell","Cumberland","Devonshire","Dorsetshire","Shrewsbury","Cambridge","Torbay","Newark","Resolution","Captain","Grafton","Hampton Court","Edgar","Yarmouth","Orford","Royal Oak","Expedition","Monmouth","Revenge","Suffolk","Plymouth","Lion","Gloucester","Rippon","Montague","Medway","Kingston","Nottingham","Salisbury","Dragon","Falmouth","Pembroke","Ruby","Chester","Romney","Bonaventure","Bristol","Warwick","Ormonde","Assistance","Gloucester","Advice","Strafford","Worcester","Panther","Dartmouth","Rochester","Nonsuch","Salisbury","Winchester","St Albans","Guernsey","Norwich","Deptford","Tiger","Weymouth","Swallow","Royal Sovereign","Prince George","Union","Namur","Neptune","Marlborough","Lancaster","Princess Amelia","Cornwall","Norfolk","Somerset","Princess Caroline","Russell","Edinburgh","Northumberland","Burford","Captain","Stirling Castle","Berwick","Lenox","Kent","Grafton","Ipswich","Buckingham","Prince of Orange","Canterbury","Plymouth","Sunderland","Windsor","Deptford","Swallow","Tilbury","Warwick","Pembroke","Dunkirk","Falkland","Chatham","Colchester","Leopard","Argyll","Portland","Assistance","Romney","Salisbury","Oxford","Falmouth","Lichfield","Greenwich","Newcastle","Victory","Duke","St George","Boyne","Cumberland","Elizabeth","Suffolk","Essex","Nassau","Prince Frederick","Bedford","Royal Oak","Stirling Castle","Monmouth","Revenge","Captain","Berwick","Weymouth","Strafford","Worcester","Augusta","Dragon","Jersey","Superb","Lion","Kingston","Rupert","Dreadnought","Medway","Princess Mary","Exeter","Nottingham","Gloucester","St Albans","Severn","Guernsey","Hampshire","Leopard","Nonsuch","Sutherland","Antelope","Dartmouth","Woolwich","Preston","Hector","Anglesea","Diamond","Mary Galley","Ludlow","Pearl","Kinsale","Lark","Adventure","Roebuck","Torrington","Princess Louisa","Southsea Castle","Dover","Folkestone","Faversham","Lynn","Gosport","Sapphire","Hastings","Liverpool","Kinsale","Adventure","Diamond","Launceston","Looe","Ramillies","Prince","Newark","Devonshire","Lancaster","Culloden","Somerset","Northumberland","Edinburgh","Hampton Court","Kent","Yarmouth","Princess Louisa","Defiance","Canterbury","Sunderland","Tilbury","Eagle","Windsor","Chester","Harwich","Winchester","Maidstone","Colchester","Portland","Falkland","Salisbury","Advice","Gloucester","Norwich","Ruby","Colchester","Lichfield","Panther","Bristol","Rochester","Royal George","Britannia","Princess Amelia","Vanguard","Somerset","Orford","Grafton","Swiftsure","Northumberland","Buckingham","St Albans","Anson","Tiger","Weymouth","York","Medway","Assistance","Greenwich","Tavistock","Falmouth","Newcastle","Dartmouth","Severn","Woolwich","Namur","Union","Neptune","Cambridge","Chichester","Dunkirk","Achilles","America","Montagu","Preston","Pembroke","Rippon","Chatham","Burford","Dorsetshire","Boyne","Temple","Conqueror","Victory","Royal Sovereign","Royal George","Queen Charlotte","Queen Charlotte","Sandwich","Blenheim","Ocean","London","Barfleur","Prince George","Princess Royal","Formidable","Queen","Duke","St George","Glory","Atlas","Prince","Impregnable","Windsor Castle","Boyne","Prince of Wales","Caesar","Dublin","Norfolk","Lenox","Mars","Shrewsbury","Warspite","Resolution","Fame","Hero","Hercules","Thunderer","Bellona","Dragon","Superb","Kent","Defence","Valiant","Triumph","Arrogant","Cornwall","Edgar","Goliath","Zealous","Audacious","Elephant","Bellerophon","Saturn","Vanguard","Excellent","Illustrious","Canada","Majestic","Orion","Captain","Albion","Grafton","Alcide","Fortitude","Irresistible","Ramillies","Monarch","Magnificent","Marlborough","Suffolk","Terrible","Russell","Invincible","Robust","Prince of Wales","Ajax","Royal Oak","Conqueror","Bedford","Hector","Vengeance","Sultan","Egmont","Elizabeth","Resolution","Cumberland","Berwick","Bombay Castle","Powerful","Defiance","Swiftsure","Culloden","Thunderer","Venerable","Victorious","Ramillies","Terrible","Hannibal","Theseus","Alfred","Alexander","Warrior","Montagu","Ganges","Culloden","Tremendous","Invincible","Minden","Minotaur","Leviathan","Carnatic","Colossus","Minotaur","Asia","Essex","Africa","St Albans","Augusta","Director","Exeter","Europa","Trident","Prudent","Ardent","Raisonnable","Agamemnon","Belliqueux","Stately","Nassau","Indefatigable","Worcester","Lion","Stirling Castle","Intrepid","Monmouth","Defiance","Nonsuch","Ruby","Vigilant","Eagle","America","Anson","Polyphemus","Magnanime","Sampson","Repulse","Diadem","Standard","Inflexible","Africa","Dictator","Sceptre","Crown","Ardent","Scipio","Veteran","Edgar","Panther","Firm","Warwick","Romney","Salisbury","Centurion","Portland","Bristol","Renown","Isis","Leopard","Hannibal","Jupiter","Leander","Adamant","Assistance","Europa","Experiment","Medusa","Grampus","Cato","Trusty","Caledonia","Britannia","Prince Regent","Royal George","Nelson","Saint Vincent","Howe","Saint George","Royal William","Neptune","Waterloo","Trafalgar","Ville de Paris","Hibernia","Ocean","Impregnable","Trafalgar","Princess Charlotte","Royal Adelaide","Dreadnought","Neptune","Temeraire","Boyne","Union","Rodney","Nile","London","Formidable","Ganges","Asia","Bombay","Calcutta","Monarch","Vengeance","Thunderer","Powerful","Clarence","Foudroyant","Rochfort","Sandwich","Waterloo","Cambridge","Indus","Hindostan","Brunswick","Mars","Centaur","Courageux","Plantagenet","Bulwark","Valiant","Ajax","Kent","Conqueror","Dragon","Northumberland","Renown","Spencer","Achille","Superb","Revenge","Milford","Princess Amelia","Colossus","Warspite","Fame","Albion","Hero","Illustrious","Marlborough","York","Hannibal","Sultan","Royal Oak","Aboukir","Bombay","Swiftsure","Victorious","Repulse","Eagle","Sceptre","Magnificent","Valiant","Elizabeth","Cumberland","Venerable","Talavera","Belleisle","Malabar","Blake","Santo Domingo","Armada","Cressy","Vigo","Vengeur","Ajax","Conquestador","Poictiers","Berwick","Egmont","Clarence","Edinburgh","America","Scarborough","Asia","Mulgrave","Anson","Gloucester","Rodney","Hogue","Dublin","Barham","Benbow","Stirling Castle","Vindictive","Blenheim","Duncan","Rippon","Medway","Cornwall","Pembroke","Indus","Redoubtable","Devonshire","Defence","Hercules","Agincourt","Pitt","Wellington","Russell","Akbar","Cornwallis","Wellesley","Carnatic","Black Prince","Melville","Hawke","Chatham","Hastings","Augusta","Imaun","Antelope","Diomede","Grampus","Jupiter","Salisbury","Romney","Isis","Brave","Alexandre","Duquesne","Implacable","Mont Blanc","Scipion","Brave","Maida","Marengo","Abercrombie","Genoa","Rivoli","Royal Albert","Windsor Castle","Marlborough","Royal Sovereign","Prince of Wales","Queen","Victoria","Frederick William","Algiers","Royal Sovereign","Albion","Aboukir","Exmouth","Saint Jean D'Acre","Hannibal","Princess Royal","Hannibal","Algiers","Caesar","Vanguard","Goliath","Superb","Meeanee","Collingwood","Centurion","Mars","Lion","Majestic","Colossus","Irresistible","Brunswick","Orion","Hood","Edgar","Sans Pareil","Boscawen","Cumberland","Duke of Wellington","Marlborough","Royal Sovereign","Prince of Wales","Royal Albert","Windsor Castle","Orion","Hood","Edgar","Caesar","Algiers","Princess Royal","Hannibal","Rodney","Nile","London","Nelson","Prince Regent","Royal George","St George","Royal William","Neptune","Waterloo","Trafalgar","Albion","Aboukir","Exmouth","Queen","Frederick William","Cressy","Goliath","Collingwood","Centurion","Mars","Lion","Majestic","Meeanee","Colossus","Brunswick","Irresistible","Bombay","Sans Pareil","Ajax","Blenheim","Edinburgh","Hogue","Cornwallis","Hastings","Hawke","Pembroke","Russell","Victoria","Howe","St Jean d'Acre","Conqueror","Donegal","Duncan","Gibraltar","Agamemnon","James Watt","Victor Emanuel","Edgar","Hero","Revenge","Renown","Atlas","Anson","Defiance","Bulwark","Robust","Repulse","Zealous","Royal Alfred","Royal Oak","Triumph","Ocean","Caledonia","Blake","Kent","Pitt","Warrior","Black Prince","Defence","Resistance","Hector","Valiant","Minotaur","Agincourt","Northumberland","Prince Consort","Caledonia","Ocean","Lord Clyde","Lord Warden","Captain","Audacious","Invincible","Iron Duke","Vanguard","Swiftsure","Triumph","Devastation","Thunderer","Superb","Agamemnon","Ajax","Scorpion","Wivern","Cerberus","Magdala","Belleisle","Orion","Conqueror","Hero"
I'm hoping to make use of these lists by making a quick modcomp that anyone can include in their mods, which randomly assigns an appropriate historic ship name from the above lists to each ship unit in the game. I've got a bit stuck on the Python part though, I guess I'm not understanding the object names correctly. Here is what I tried so far:

In CyEventManager.py, added the following block
PHP:
#shipname modcomp
		unit = iPlayer.getUnit(iUnitId)
		if unit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
			newName = NameGen(unit)
			unit.setName(newName)
#end shipname modcomp
to these existing functions:
def onUnitCreated(self, argsList):
def onUnitBuilt(self, argsList):
def onUnitBoughtFromEurope(self, argsList):

And here's an outline of a function to assign the random ship names:
Spoiler :
PHP:
#shipname modcomp			
	def NameGen(self, unit):
		pPlayer = gc.getPlayer(unit.getOwner())
		pCiv = pPlayer.getCivilizationType()
		sFull = ""
		if pCiv == gc.getInfoTypeForString('CIVILIZATION_SPAIN') or pCiv == gc.getInfoTypeForString('CIVILIZATION_SPAIN_EUROPE'):
			lName = ["Nina","Pinta","Santa Maria"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_ENGLAND') or pCiv == gc.getInfoTypeForString('CIVILIZATION_ENGLAND_EUROPE'):
			lName = ["Mayflower"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_FRANCE') or pCiv == gc.getInfoTypeForString('CIVILIZATION_FRANCE_EUROPE'):
			lName = ["Louis"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_DUTCH') or pCiv == gc.getInfoTypeForString('CIVILIZATION_DUTCH_EUROPE'):
			lName = ["Zuiderzee"]
		sFull = lName[CyGame().getSorenRandNum(len(lName), "Name Gen")-1]
		# trim name length			
		if len(sFull) > 25:
			sFull = sFull[:25]		
		return sFull
#end shipname modcomp
where the actual historic lists could be pasted in when working.

To TC01, Androrc, or anyone with python skills, could you maybe help out with getting this into a working modcomp? Whoever is the first to finish it gets to name some ships after themselves! ;):king:
 

Attachments

I'm not very good with python either... I believe this could be done through the SDK and xml though, changing the already existing "<UniqueNames>" field in UnitInfos to account for different civilizations, like this:

Code:
			<Type>UNIT_CARAVEL</Type>
			<Class>UNITCLASS_CARAVEL</Class>
			<UniqueNames>
				<CivilizationUniqueName>
					<Civilization>CIVILIZATION_SPAIN</Civilization>
					<UniqueName>Nina</UniqueName>
					<UniqueName>Pinta</UniqueName>
					<UniqueName>Santa Maria</UniqueName>
				</CivilizationUniqueName>
			</UniqueNames>

And then replace the check in CvUnit.cpp for the unit's name with an appropriate check. Well, it could work.
 
After some trial and error, I think I've almost got it working. The remaining issue seems to be that it's not getting the unit owner's civilization type correctly (eg CIVILIZATION_SPAIN). I'm using the code below, but pCiv seems to never match the if statements and always just uses the default contents of lName. There are no python exceptions. Any ideas how to access civ type appropriately?

Spoiler :
PHP:
#shipname modcomp            
	def NameGen(self, unit):
		pPlayer = gc.getPlayer(unit.getOwner())
		pCiv = pPlayer.getCivilizationType
		sFull = "test"
		lName = ["test1","test2"]
		if pCiv == gc.getInfoTypeForString('CIVILIZATION_SPAIN') or pCiv == gc.getInfoTypeForString('CIVILIZATION_SPAIN_EUROPE'):
			lName = ["Nina","Pinta","Santa Maria"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_ENGLAND') or pCiv == gc.getInfoTypeForString('CIVILIZATION_ENGLAND_EUROPE'):
			lName = ["Mayflower"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_FRANCE') or pCiv == gc.getInfoTypeForString('CIVILIZATION_FRANCE_EUROPE'):
			lName = ["Louis"]
		elif pCiv == gc.getInfoTypeForString('CIVILIZATION_DUTCH') or pCiv == gc.getInfoTypeForString('CIVILIZATION_DUTCH_EUROPE'):
			lName = ["Zuiderzee"]
		sFull = lName[CyGame().getSorenRandNum(len(lName), "Name Gen")-1]
		# trim name length
		if len(sFull) > 25:
			sFull = sFull[:25]        
		return sFull
#end shipname modcomp
 
Great, here's the (almost) completed modcomp. The changes are limited to several blocks in CvEventManager.py marked with "#shipnames modcomp" so it should be easy to add to an existing mod.

The last remaining issue is that it doesn't assign names to the starting ships; I unsuccessfully tried adding the block below to onBeginGameTurn and also tried it on onGameStart. I guess that doesn't matter too much though.
Spoiler :
PHP:
#shipname modcomp
		if iGameTurn == 1:
			for iPlayer in range(gc.getMAX_PLAYERS()):
				(unit, iter) = player.firstUnit()
				while (unit):
					if unit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
						newName = CvEventManager.NameGen(self,unit)
						unit.setName(newName)
					(unit, iter) = player.nextUnit(iter)
#end shipname modcomp
 
Solved it! Just needed to add
player = gc.getPlayer(iPlayer)
to the block. Well I'll post it in the files forum so anyone can use it.
Anyway, this modcomp is looking good
Obrigado! Se vc quiser, para o seu mod posso fazer listas para Russia e Sweden. The wikipedia only shows 6 ships for Austria though :p
 
Back
Top Bottom