Temporary Factions

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Temporary Factions

Post by shadowmane20 »

Is there a python code to activate a temporary faction? Say I want to have an in-system faction or two who are in a political battle over control of the system. I could use two of the factions in the game, but it would be much simpler to add a code to a campaign to create two (or more) temporary, in-system factions who you could help, hinder, or ignore (to your detriment). I've searched through some of the missions and quests to see if anything presented itself, but I've found nothing.
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Temporary Factions

Post by TBeholder »

Unlikely, factions are at least partially hardcoded.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

How about a separate factions.xml for them? You would have to add another factions_xml_gen.py for them, as well as a faction_ships.py as well. Could it be done by sidestepping the hardcoding?
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Temporary Factions

Post by TBeholder »

Well, you can add a ton of custom factions, of course. With logos, ship lists and whatever else they need.
I just don't see support for manipulating this data. In the source there's LoadFactionXML, it runs only once in src/universe_generic.cpp, and that's it.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

But isn't that what a scripting language is for. To add things that aren't hard coded in the source?

Edit: Geez. This game really don't want you mucking around in the factions_ships.py file.
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

So how about another angle. I was thinking about this. If you use factions.xml to deal with the major and minor "powers" (Aera, Confederation, Rlaan, Shmrn, Forsaken, Uln, etc.), that establishes the relation between them. You then break down each "power" into another xml file that shows the factions within that power and how they relate to one another. You could even break that down another time or two and create subfactions of subfactions.

For instance, when you start the game, the Aera are hostile towards you. Why? Why would a typical Aeran care about a washed up ex-military pilot trading cargo? They would have their sights on bigger fish, like that military transport over there carrying war supplies. The only way they would care about you is if you tried to defend said military transport, or were mistaken for said military transport. However, an Aeran privateer (if such a beast existed) would probably have a vested interest in stopping you from smuggling that contraband into the Aeran Acendancy that he could carry himself. In other words, the Aeran military and/or government would not care if you existed unless you broke one of their laws or interfered in one of their military campaigns. But the Aeran civilian could very well have a reason to stop you from what you are doing.

You would simply create python classes that put the subfactions together with the factions in factions.xml and you would have a more robust system. You might not even have to tweak the c++ code that much to get it to work.
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

TBeholder wrote:Well, you can add a ton of custom factions, of course. With logos, ship lists and whatever else they need.
I just don't see support for manipulating this data. In the source there's LoadFactionXML, it runs only once in src/universe_generic.cpp, and that's it.

Code: Select all

void Universe::Init( const char *gal )
{
    ROLES::getAllRolePriorities();
    LoadWeapons( VSFileSystem::weapon_list.c_str() );
    galaxy.reset(new GalaxyXML::Galaxy( gal ));
    static bool firsttime = false;
    if (!firsttime) {
        LoadFactionXML( "factions.xml" );
        firsttime = true;
    }
    script_system = NULL;
}
So it loads it there. What does it do with it? Where is the code for what it does with it? It says "script_system= NULL;". Does that mean there is a script that can be called to do something with this if it's not "NULL"?

Also, why does it start with this:

Code: Select all

using namespace GalaxyXML;
Should that not say milky_wayXML?
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Temporary Factions

Post by TBeholder »

"Two Eyes Good, Eleven Eyes Better." -Michele Carter
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

Wow. You know where all the code is. Do you have some kind of search function going on there, or do you just work with the code that much?
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Temporary Factions

Post by loki1950 »

There is an overall structure to the whole code base after all the founders of the project all hold Phd's in computer science currently :wink: which is most likely why they have life to live instead of contributing to the project.

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
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Temporary Factions

Post by TBeholder »

I just go straight for text search in the local copy of repository. It's far too big and was overwritten too much to guess a lot. Beyond the few things already personally explored, that is.
Though IDE lookup isn't bad either.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

I've got TortoiseSVN up and running. I've also got Visual Studio 2017 installed. I've started using Visual Studio to look at the Python files now. It showed me a lot of little errors (I think) in the campaign file I was working on.

The only SVN version I have been able to get running without crashing is the one jacks put up in 2015 on Sourceforge. The newest flavor crashes on me. I can make a jump from Cephid 17 to Stirling. But when I go to jump into Bernards Star, it dumps me. Also, the jumps remain active, which is annoying. I'd file a bug report, but I don't even know why it's dumping me.

Having looked at that code, it would take some work to get sub-factions the way I had them envisioned in my head when I started this thread.
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Temporary Factions

Post by shadowmane20 »

repost
Post Reply