[GS] [XML] Need a hand on adding a new Domain for Leaders

__jack__

Warlord
Joined
Dec 29, 2009
Messages
141
Hi,

I have built an Observer mod (Better Spectator Mod), using an unique leader LEADER_SPECTATOR to trigger the change to an observer in game.
Everything is lua based and working.

My issue another one. Because LEADER_SPECTATOR is currently a member of the Players:Expansion2_Players domain it can get picked by the AI.

While I managed to prevent players from inadvertly picking it using PlayerSetupLogic and attributing an error code to that leader it is not enough from preventing it to be eligible as a RANDOM leader.

My solution is too remove it from Players:Expansion2_Players by creating a Players:Observer_Players domain and the my StagingRoom.lua pulldown would be populated by Players:Expansion2_Players through PlayerSetupLogic if a tick box is not ticked and Players:Observer_Players otherwise.

Simple enough. Except I cannot manage to simply create a new domain by having <Domain>Players:Observer_Players</Domain>
instead of
<Domain>Players:Expansion2_Players</Domain>

I am assuming I need to register that new Domain somehow in XML/SQL but I haven't been able to find the format yet - though I am sure it should be somewhere in GS XML.

Thanks in advance!
 
Code:
	<RulesetDomainOverrides>
		<Row Ruleset="RULESET_EXPANSION_1" ParameterId="PlayerLeader" Domain="Players:Expansion1_Players"/>
	</RulesetDomainOverrides>


	<RulesetDomainOverrides>
		<Row Ruleset="RULESET_EXPANSION_2" ParameterId="PlayerLeader" Domain="Players:Expansion2_Players"/>
	</RulesetDomainOverrides>
It's FrontEnd (Configuration) stuff. The new Domain is tied directly to the Ruleset.
 
Hi LeeS,

Yes I have seen it - somehow I didn't managed to create a new one just from the leader_config by adding the <Domain>Players:Observer_Players</Domain> but maybe I did something wrong.
Let me first try to display leaders from a scenario as a debug and I will work it from there
 
@LeeS This turns out to be a massive pain in the b###

Because of the parameters validation of SetupParameter and PlayerSetupLogic, it really doesn't like having value outside of the ruleset domain.
I can still launch a game using command line with LeaderTypeSetName(xxx) and Network.LaunchGame() but then I can save it and load it as the SetupParameter is unavaidable when loading a game....

Is there any criteria I could use in xml to exclude a Civ from the AI pool ?

One trick possible I see is using the PlayerId="0" like in the Nubia scenario to force a different domain range and then tie this with a MODE selection that would load a different SQL based on the number of Observers

e.g.
<Row Ruleset="RULESET_SCENARIO_NUBIA" PlayerId="0" Domain="Players:Observer_Players" Value="LEADER_SPECATOR"/>

That being said a xml flag like IsPlayablebyAI would be much more refined.... any such thing in your experience ?
 
Top Bottom