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

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old January 24th, 2009, 10:29 PM

Omnirizon Omnirizon is offline
BANNED USER
 
Join Date: Dec 2007
Location: Illinois
Posts: 1,133
Thanks: 25
Thanked 59 Times in 36 Posts
Omnirizon is on a distinguished road
Default mass poptype set script

this is a poptype set script written in Python. at the moment, it will only do a mass set of all lands to one poptype. I really only wrote it because I wanted to make a map No Indies, but didn't want to go through by hand.

the script works like a python module. many systems already have Python installed (just type 'python' at a command line). if not, you will need to install it from python.org. you should have it anyway in this day and age; DIY scripting will be the wave of the future in an age of information anarchy and (un)interoperability.

Code:
usage:

setpop(file, type)
iterates over all '#landname' entries of file and creates a set of all province numbers.
iterates over this set and appends a sequence of:
#setland x
#poptype type
to the end of file, where x is a number popped from the set


example:

import poptypes

f = '/users/myname/mymap.map'
t = 99
poptypes.setpop(f, t)
NOTE: poptypes.py will need to be on your PYTHONPATH in order to import it. alternatively, you can just add the commands, like those shown in the example, into the file itself and launch it with the python interpreter (this is actually very easy. after adding the commands into the file just right-click it and select 'open with' then 'python'). if there's really demand for it, I will make this into a python egg, then it can be automatically added to your python's site-packages folder, and you will be able to import it with no special steps needed.

i may add to this python module, and rename it 'pydommaps' or something equally asinine. i could add scripts that automatically generate neighbor entries, or that add random poptypes.

i sorted through the mod tools list, and didn't see anything like this. is there something already? if not I can build this up if people would use it.
Attached Files
File Type: zip poptypes.py.zip (663 Bytes, 146 views)

Last edited by Omnirizon; January 25th, 2009 at 04:48 AM..
Reply With Quote
 

Bookmarks


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 02:53 AM.


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