Thread: Nation Library
View Single Post
  #18  
Old February 27th, 2009, 01:47 PM

pyg pyg is offline
BANNED USER
 
Join Date: Jan 2009
Location: a small farm
Posts: 340
Thanks: 73
Thanked 103 Times in 42 Posts
pyg is on a distinguished road
Default Re: Nation Library

I hope it's not abuse to paste in another big chunk of code, but I rewrote the ulm.py example to actually do chrispedersen's whole mod in 46 lines although some of the description text is snipped. This is the terse version. I've attached the actual output as ulm.dm.zip.

Code:
#!/usr/bin/env python                                                                                                       
# -*- Mode: Python; tab-width: 4 -*-                                                                                        

from dmg import D3MNation, D3M

era = 3
slot = 72
players = [("BlackChris", "BlackChris"),
           ("Tolkien", "CountVonTolkein"),
           ("CountSzendry", "CountSzendry"),
           ("SteurmMithras", "SteurmMithras"),
           ("PrinceLaveare","PrinceLaveare"),
           ("AdjuctantDedas","Adjuctant Dedas"),]
new_mod = D3M(era=era, modname = "UlmCivilWar")

for player, nation in players:
    LA_Ulm = D3MNation(era, slot, nation,
		       brief = "Ulm is a human kingdom... snipped ...trade in the arcane.",
		       summary = "Race: Stocky humans... snipped ...Priests: Weak.")
    LA_Ulm.add_units([482,1013,1014,1015,1017,1034])
    LA_Ulm.add_commanders([1016,1018,739,740,1023,1012])
    LA_Ulm.set_PD(1016, 739, 1013, 482, 1024)
    LA_Ulm.add_site("The Ruined Keep")
    LA_Ulm.add_site("Black Forest")
    LA_Ulm.add_site("The Black Temple")
    LA_Ulm.set_forts(25, 3, 8, 3, 35, 6, 11)
    LA_Ulm.set_startarmy(1016, 1018, 1013, 8, 1015, 8)
    LA_Ulm.copy_national(spell = "Sanguine Heritage",
                         new_name = player + "'s Taking",
                         new_desc = "And so it is given, One from another, for time immemorial.")
    LA_Ulm.copy_national(spell = "Iron Darts",
                         new_name = player + "'s Darts",
                         new_desc = "And so it is given, One from another, for time immemorial.")
    LA_Ulm.copy_national(spell = "Iron Blizzard",
                         new_name = player + "'s Blizzard",
                         new_desc = "And so it is given, One from another, for time immemorial.")
    LA_Ulm.copy_national(spell = "Pack of Wolves",
                         new_name = player + "'s Wolves",
                         new_desc = "And so it is given, One from another, for time immemorial.")
    LA_Ulm.copy_national(spell = "Sloth of Bears",
                         new_name = player + "'s Bears",
                         new_desc = "And so it is given, One from another, for time immemorial.")
    new_mod.add_nation(LA_Ulm, slot)
    slot += 1
print new_mod
Attached Files
File Type: zip ulm.dm.zip (1.0 KB, 66 views)
Reply With Quote