.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
The Star and the Crescent- Save $9.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old February 26th, 2009, 03:26 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

So I have a prototype now with dmg (DomModGen) I used chrispedersen's UlmCivilWar mod as an example and wrote the equivalent of his second nation (Tolkein's) with dmg classes and methods. The last couple of lines wrap the nation in a mod and printing it lets you >file.dm or |more to test. This example is included in the dmg.zip if you want to mess with it. I've included variable names and snipped text for readability. Anyway just applying a loop, incrementing the slot, and changing name could generate chris's mod. Seems to be missing unique pretenders unless LA Ulm doesn't have any.... and dmg is missing it because there has not yet been a need This has not been well tested so bugs are probable but I started a game with it and it looked Ulmish.

Code:
#!/usr/bin/env python                                                                                                       
from dmg import D3MNation, D3M

era = 3
slot = 73

LA_Ulm = D3MNation(era,
                   slot,
                   name = "CountVonTolkien",
                   brief = "Ulm is a human kingdom... snipped ...trade in the arcane.",
                   summary = "Race: Stocky humans... snipped ...Priests: Weak.",
                   flag = None)
LA_Ulm.add_units([482,1013,1014,1015,1017,1034])
LA_Ulm.add_commanders([1016,1018,739,740,1023,1012])
LA_Ulm.set_PD(defcom1 = 1016,
              defcom2 = 739,
              defunit1 = 1013,
              defunit1b = 482,
              defunit2 = 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(castleprod = 25,
                 startfort = 3,
                 defaultfort = 8,
                 farmfort = 3,
                 forestfort = 35,
                 mountainfort = 6,
                 swampfort = 11)
LA_Ulm.set_startarmy(startcom = 1016,
                     startscout = 1018,
                     startunittype1 = 1013,
                     startunitnbrs1 = 8,
                     startunittype2 = 1015,
                     startunitnbrs2 = 8)
LA_Ulm.copy_national(spell = "Sanguine Heritage",
                     new_name = "Tolkien's Taking",
                     new_desc = "And so it is given, One from another, for time immemorial.")

new_mod = D3M(era = era, modname = "LA_Ulm Test")
new_mod.add_nation(LA_Ulm, slot = slot)

print new_mod
Reply With Quote
The Following 2 Users Say Thank You to pyg For This Useful Post:
  #2  
Old February 27th, 2009, 02:24 AM

chrispedersen chrispedersen is offline
BANNED USER
 
Join Date: May 2004
Posts: 4,075
Thanks: 203
Thanked 121 Times in 91 Posts
chrispedersen is on a distinguished road
Default Re: Nation Library

You guys never cease to amaze me.

I did make a bug in the original mod (obviously not your fault). The corrected mod adds 4 new spells, you can grab it from the Ulm Civil War thread.

Note however I was lazy on the spell descriptions.
Reply With Quote
  #3  
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, 75 views)
Reply With Quote
  #4  
Old February 27th, 2009, 02:18 PM

chrispedersen chrispedersen is offline
BANNED USER
 
Join Date: May 2004
Posts: 4,075
Thanks: 203
Thanked 121 Times in 91 Posts
chrispedersen is on a distinguished road
Default Re: Nation Library

Hmmm... I *think* I'm willing to keep working on this with you pvg. We can include the NationalLibrary as part of ChrisCBM...

If we do one nation a day.. well be done in two months....
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 08:41 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.