Problem adding sectors
-
- Explorer
- Posts: 8
- Joined: Fri Oct 05, 2007 2:31 am
Problem adding sectors
I'm trying to make a mod for PR that includes more of the WC universe then just gemini, but I can't work out a few glitches.
What I want is to custom-make every system in the 3 sectors surrounding gemini, so I started by adding a folder called Sol in the Sectors folder (Sectors\Sol\) and created about 1/4 of the systems. The biggest problem that occurs is every system in sol has at least one space station that I didn't put in the code.
What I want is to custom-make every system in the 3 sectors surrounding gemini, so I started by adding a folder called Sol in the Sectors folder (Sectors\Sol\) and created about 1/4 of the systems. The biggest problem that occurs is every system in sol has at least one space station that I didn't put in the code.
-
- Confed Special Operative
- Posts: 317
- Joined: Mon Jan 19, 2004 12:48 pm
- Location: Konstanz, Germany
In the faction_ships.py, there is a line like the followingThe biggest problem that occurs is every system in sol has at least one space station that I didn't put in the code.
As far as i know, these station types there are automatically spread across your universe. Maybe it is worth trying to delete them.generic_bases = ("mining_base","mining_base","mining_base","mining_base",)
-
- Elite Hunter
- Posts: 1149
- Joined: Mon Aug 14, 2006 3:56 pm
- Location: Black Forest, Germany
-
- Confed Special Operative
- Posts: 317
- Joined: Mon Jan 19, 2004 12:48 pm
- Location: Konstanz, Germany
-
- The Shepherd
- Posts: 5841
- Joined: Fri May 13, 2005 8:37 pm
- Location: Ottawa
- Contact:
@Paladin just use the attachment function when you post you may have to zip it but py file are allowed attachments.
Enjoy the Choice
Enjoy the Choice
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
Okay thanks.
I think the offending line is on line 110 of generate_dyn_universe.py
It has code to generate bases in each system.
Add an if statement to remove all bases.
The error is coming because it is taking a random number between 0 and 0.
if len(faction_ships.bases[fsfac])==0:
for i in range(numbases):
...
(make sure you indent it right... Python is very picky about indentation, and PhpBB removes spaces)
========
Actually, if you want to be really lazy, make it not add any bases to any systems by disabling the AddBasesToSystem function by returning immediately:
EDIT: Make sure you recreate your saved game file. Delete New_Game in the root directory if you have to. This only affects generation of the dynamic universe data.
I think the offending line is on line 110 of generate_dyn_universe.py
It has code to generate bases in each system.
Add an if statement to remove all bases.
The error is coming because it is taking a random number between 0 and 0.
if len(faction_ships.bases[fsfac])==0:
for i in range(numbases):
...
(make sure you indent it right... Python is very picky about indentation, and PhpBB removes spaces)
========
Actually, if you want to be really lazy, make it not add any bases to any systems by disabling the AddBasesToSystem function by returning immediately:
Code: Select all
def AddBasesToSystem (faction,sys):
return
if (sys in doNotAddBasesTo):
return
...
EDIT: Make sure you recreate your saved game file. Delete New_Game in the root directory if you have to. This only affects generation of the dynamic universe data.
-
- Confed Special Operative
- Posts: 317
- Joined: Mon Jan 19, 2004 12:48 pm
- Location: Konstanz, Germany
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
Right now you can do it based on faction easily.
In fact if you look in faction_ships.py, all the factions are set to generic_bases, but you can replace the generic_bases on each line with a list of bases.
To do it based on a system name would be more work, but it is possible since you know which system you are in, and you can run VS.getGalaxyProperty to get info from the universe XML file if you need to.
In fact if you look in faction_ships.py, all the factions are set to generic_bases, but you can replace the generic_bases on each line with a list of bases.
To do it based on a system name would be more work, but it is possible since you know which system you are in, and you can run VS.getGalaxyProperty to get info from the universe XML file if you need to.
-
- Confed Special Operative
- Posts: 317
- Joined: Mon Jan 19, 2004 12:48 pm
- Location: Konstanz, Germany
So at the moment, it looks like
generic_basesA=("perry", "perry")
generic_basesB=("new_constantinople")
bases = (generic_bases,
generic_basesA, #kilrathi
generic_basesA, #nephilim
generic_basesB, #merchant
generic_basesA, #retro
generic_basesB, #pirates
)
etc ?
could i make something likegeneric_bases = ("perry","perry",
"new_constantinople","new_constantinople","new_constantinople","new_constantinople",
"mining_base","mining_base","mining_base","mining_base","mining_base","mining_base","mining_base","mining_base","mining_base","mining_base",
"refinery","refinery","refinery","refinery","refinery","refinery",)
bases = (generic_bases,
generic_bases, #kilrathi
generic_bases, #nephilim
generic_bases, #merchant
generic_bases, #retro
generic_bases, #pirates
generic_bases, #hunter
generic_bases, #militia
generic_bases, #unknown
generic_bases,#landreich
generic_bases,#border_worlds
generic_bases, #firekkan
)
generic_basesA=("perry", "perry")
generic_basesB=("new_constantinople")
bases = (generic_bases,
generic_basesA, #kilrathi
generic_basesA, #nephilim
generic_basesB, #merchant
generic_basesA, #retro
generic_basesB, #pirates
)
etc ?
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
yes.. but you have an error (not a syntax error but it will cause an annoying run-time error instead).
Beware that a tuple (list) of one element is ("value",) and not ("value")... note the ending comma. If you do not put the comma at the end it will evaluate the parentheses.
Having an extra comma at the end does not hurt, however, so do it in all the lists.
For example:
generic_basesA=("perry", "perry",)
generic_basesB=("new_constantinople",)
you can also specify them directly inline but that might also be more work if that list is used in multiple places.
Beware that a tuple (list) of one element is ("value",) and not ("value")... note the ending comma. If you do not put the comma at the end it will evaluate the parentheses.
Having an extra comma at the end does not hurt, however, so do it in all the lists.
For example:
generic_basesA=("perry", "perry",)
generic_basesB=("new_constantinople",)
you can also specify them directly inline but that might also be more work if that list is used in multiple places.
-
- Confed Special Operative
- Posts: 317
- Joined: Mon Jan 19, 2004 12:48 pm
- Location: Konstanz, Germany
you mean something likeyou can also specify them directly inline.
("perry", "perry",), #nephilim
?
And one more question.
Up to now, it looks like
in bases=(bases = (generic_bases,
generic_bases, #kilrathi
generic_bases, #nephilim
generic_bases, #merchant
generic_bases, #retro
there is generic_bases, and then the individual factions.
why is generic_bases there in the first line, without any faction following? If i define more than one bases list, do i have to add them also, like
bases=(generic_basesA,
genetic_basesB,
generic_basesA, #kilrathi
etc ?