Just in case anyone finds this useful...

Stumbled onto this while trying to iron out a bug in my modified tech tree...

Still no way I can find to trick the XML tech tree parser into allowing multiple requirements, but I did find a way to force it to allow "and/or" techs - ie, optional branches, where you can bypass a tech. Now, normally you could do this by doing, for example:

Space Weapons --> Beam Weapons --> etc
|_______> Rail Guns --> etc

and there'd by no point. But what if, say, I wanted to allow this:

------etc-------------> Hyperwarp 3
|
\|/
Speed Troopers
/|\
|
------etc-------------> Shock Troops

with either Hyperwarp 3 OR Shock Troops leading to Speed Troopers.

In other words, converging tech lines...

Ot seems to work, but I'm not using it (at the moment, at least) in my mod, so I've not really tested it. Figured I'd post how, though - someone may be able to use it.

Oh, the tech tree has issues showing this, as it's obviously not supposed to work this way. Only one of the two techs will show lines to the "Speed Troopers" tech - the other will only show it by listing it in the "Future Techs" listing.

Ok, the code example. Let's say I wanted Impulse Drive to converge to Univ Trans. Normally, if coded right, I'd do:




I then end up with two separate tech branches: Ion Drive --> Impulse Drive, and Xeno Comm --> Univ Trans.

But I want to converge them. So I do this instead:



It's still 100% valid XML, and the game processes it correctly, just as I say, it won't graphically be represented.

What you have now is: Ion Drive --> Impulse Drive, Xeno Comm --> Univ Trans, and Impulse Drive --> Univ Trans.

Voila.

Brian
6,813 views 9 replies
Reply #1 Top
Argg, the XML tags got stripped... Changing the braces to parenthesis, hope you get what I mean...

Example 1:

(Propulsion ID="ImpulseDrive")
(Group)Impulse Drive(/Group)
(DisplayName)Impulse Drive(/DisplayName)
(Cost)400(/Cost)
(Description)blah(/Description)
(Details)blah(/Details)
(Requires)IonDrive(/Requires)
(Model)hyper320(/Model)
(SpeedAbility)10(/SpeedAbility)
(AIValue)30(/AIValue)
(Category)Propulsion(/Category)
(/Propulsion)
(Culture ID="UniversalTranslator")
(DisplayName)Universal Translator(/DisplayName)
(Cost)25(/Cost)
(Description)blah(/Description)
(Details)blah(/Details)
(Requires)Xeno Communications(/Requires)
(Category)Communications(/Category)
(DiplomacyAbility)5(/DiplomacyAbility)
(Model)translator0(/Model)
(AIValue)15(/AIValue)
(/Culture)


Example 2:

(Propulsion ID="ImpulseDrive")
(Group)Impulse Drive(/Group)
(DisplayName)Impulse Drive(/DisplayName)
(Cost)400(/Cost)
(Description)blah(/Description)
(Details)blah(/Details)
(Requires)IonDrive(/Requires)
(Model)hyper320(/Model)
(SpeedAbility)10(/SpeedAbility)
(AIValue)30(/AIValue)
(Category)Propulsion(/Category)
(Culture ID="UniversalTranslator")
(DisplayName)Universal Translator(/DisplayName)
(Cost)25(/Cost)
(Description)blah(/Description)
(Details)blah(/Details)
(Requires)Xeno Communications(/Requires)
(Category)Communications(/Category)
(DiplomacyAbility)5(/DiplomacyAbility)
(Model)translator0(/Model)
(AIValue)15(/AIValue)
(/Culture)
(/Propulsion)


Brian
Reply #2 Top
GalCiv 2 tech tree wasn't designed to handle multiple prerequisites, so I don't think you can get this to work very well.

It's still 100% valid XML, and the game processes it correctly, just as I say, it won't graphically be represented.


So you somehow got it to work?
Reply #3 Top
Argg, the XML tags got stripped... Changing the braces to parenthesis, hope you get what I mean...


Replace all instances of < with &lt; next time to get them to show up.
Reply #4 Top
Yes, it works - it just won't show up with the second line drawn between the two skills. It WILL, however, show up in the future techs list, and it will let you go from the one to the other.
Reply #5 Top
I don't get it. Maybe I did something wrong but I couldn't get it to work.

Does it only work for DL and not DA?
Reply #6 Top
I spent 3 or 4 hours the other day pushing the XML code to the extreme, to see how I could make use of this. My mod is now in beta testing - just needs people to play test it, to make sure it's not unbalenced. I also can use any suggestions for additons. Drop me an email at brian.brianschweitzer@gmail, and I'll send you a copy. It makes use of many techs with multiple (and overlapping multiple) requirements.

The coding to pull off multiple reqs is a nightmare to code, but it CAN be done. Take a look at this snippet, which is only defining two techs...


Reply #7 Top
argh, ok, I used entities that time, and still the display is screwy... Just drop me an email and I'll send you a copy to check out.
Reply #8 Top
Thx for this Brian. I like the idea of what you've been doing with the tech tree - stagger it and give both positives and negatives to some research. I started a game and glaced at the tech tree. I'll try to play a decent game in a day or two when I'm not as busy.