|
|
|
|
|
January 24th, 2009, 10:29 PM
|
BANNED USER
|
|
Join Date: Dec 2007
Location: Illinois
Posts: 1,133
Thanks: 25
Thanked 59 Times in 36 Posts
|
|
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.
Last edited by Omnirizon; January 25th, 2009 at 04:48 AM..
|
January 25th, 2009, 06:28 AM
|
BANNED USER
|
|
Join Date: Feb 2007
Posts: 5,463
Thanks: 165
Thanked 324 Times in 190 Posts
|
|
Re: mass poptype set script
Someone had already done this. I forget who but you can doubtless find it by searching for something like 'No indy script'.
I can't really get on with these scripts where I need to install modules and they're all a bit fiddly.
|
January 25th, 2009, 12:04 PM
|
National Security Advisor
|
|
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
|
|
Re: mass poptype set script
Only because you're using Windows!
|
January 25th, 2009, 01:21 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: mass poptype set script
Pros and Cons.
We could make them EXE executables but that tends to (and really should) make people nervous about downloading them and running it on their machine. But if people wish it I could exe this.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
January 25th, 2009, 01:42 PM
|
BANNED USER
|
|
Join Date: Dec 2007
Location: Illinois
Posts: 1,133
Thanks: 25
Thanked 59 Times in 36 Posts
|
|
Re: mass poptype set script
this doesn't have any kind of UI. it's all done at the interactive interpreter. I could give it a UI, it wouldn't take much. then it could be usefully made into a .exe and/or an app
|
January 25th, 2009, 02:00 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: mass poptype set script
I also meant to add that one of the advantages of raw script is the public domain-ness of the program. Its good to see so many of our community willing to post raw code.
Many users dont know how to use a pipe or command line utility.
And if you can .exe it then yes you might want to add an input for the paramters.
For me to exe it Id probably rewrite it into a language I know and then compile it. Altho I do see there are applications on the net for compiling python to exe.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
January 25th, 2009, 03:29 PM
|
Lieutenant General
|
|
Join Date: Sep 2007
Posts: 2,691
Thanks: 5
Thanked 39 Times in 31 Posts
|
|
Re: mass poptype set script
I'd love a script where I could set certain poptypes for each landtype and then ti would randomly pick for each land from the appropriate list (this becuase dom3 K maps need defenders and poptype (I've got 5-7 or something) set manually for each province and it's a really nasty job do to.
If I could set certain poptypes for forest provinces (space) and others for all other provinces then that would be sweet.. if you could then make the defenders of the province the same as the poptype (and give a number of each defenders) it would be even better.
I'n not really asking cus it's probably a ****load more work but that is what I could use
__________________
Want a blend of fantasy and sci-fi? Try the total conversion Dominions 3000 mod with a new and fully modded solar system map.
Dragons wanted? Try the Dragons, Magic Incarnate nation.
New and different undead nation? Try Souls of Shiar. Including new powerfull holy magic.
In for a whole new sort of game? Then try my scenario map Gang Wars.
|
January 25th, 2009, 03:48 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: mass poptype set script
A lot of that is in the SemiRand code now. Either Ballbarian or I could probably cut that part out and modify it to your needs (him better than I actually)
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
January 25th, 2009, 03:50 PM
|
Lieutenant General
|
|
Join Date: Sep 2007
Posts: 2,691
Thanks: 5
Thanked 39 Times in 31 Posts
|
|
Re: mass poptype set script
that would be nice, I;ve not used the semirand yet, as it is it can't do what I need?
__________________
Want a blend of fantasy and sci-fi? Try the total conversion Dominions 3000 mod with a new and fully modded solar system map.
Dragons wanted? Try the Dragons, Magic Incarnate nation.
New and different undead nation? Try Souls of Shiar. Including new powerfull holy magic.
In for a whole new sort of game? Then try my scenario map Gang Wars.
|
January 25th, 2009, 04:08 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: mass poptype set script
Maybe. IIRC it does support having your own directory of your own files for it to fill in from
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|