Logo Platform
logo amplifiers simplified

Adding a drop down to Game Settings menu

Reply
Copied to clipboard!
9 years ago
Jan 3, 2016, 9:40:11 PM
Where can I find the for specific functions? I have most of what I need for a season selection in game options menu set up as of now, but I can't find the value I need for that for the GameOptionDefinitions.xml. Any help would be greatly appreciated.
0Send private message
9 years ago
Jan 4, 2016, 12:59:19 AM
Alternatively I have also put said code in the Diag SubCatagory to get it to be under the Misc.



Now then, selecting them is fine and works but the use of them in a match has no effect.



This is the current code under GameOptionDefinitions



[CODE]



Advanced



ShortSummer





LongSummer





ChaoticSummer





InfiniteSummer





InfiniteWinter





[/CODE]



I also added a GameModifiers[Season].xml file to the Options folder for calling the seasons, I believe this is where my not functioning correctly is coming in, anyone able to point me in the right direction it would be much appreciated.



[CODE]









Season

















Season

















Season

















Season

















Season

















[/CODE]



To note, I did find that by changing what was in the Registry.xml file in the root of the Public folder I can change starting season and when InfiniteWinter begins but that is it. I assume this is where the current call for seasonal weather is at. If that is the case, do I need to assign a %season tag somewhere to call the selected function from the drop down menu to enable my selected seasonal type? Any help would be appreciated.





This is Registry.xml file.



[CODE]



Summer

InfiniteWinter

3001



[/CODE]



This is what I'm kind of looking to do.



[CODE]



%GameOptionSeason

InfiniteWinter

3001



[/CODE]



If I use the above code I get this error when starting a game

[CODE]

ArgumentNullException: Argument cannot be null.



Parameter name: source

--------------------------------------------------------------------------------

System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate)

System.Linq.Enumerable.FirstOrDefault[Season] (IEnumerable`1 source, System.Func`2 predicate)

SeasonManager.GetStartingSeason ()

SeasonManager.OnBeginTurn ()

GameServerState_Turn_Begin+c__Iterator580.MoveNext ()

Amplitude.Coroutine.Run ()

GameServerState_Turn_Begin.Run ()

Amplitude.Unity.Framework.FiniteStateMachine.Update ()

GameInterface.Update ()

GameServer.Update ()

Session.Update ()

Amplitude.Unity.Session.SessionManager.LateUpdate ()



--------------------------------------------------------------------------------

V1.3.5 S3 (64-bit)

[/CODE]



It appears as if the call needs to have more added than the 'Summer' and 'Winter' selection or to open it to be able to call other variables.



Am I heading in the wrong direction?
0Send private message
9 years ago
Jan 4, 2016, 12:53:25 PM
I don't have a solution, but I, too, am interested in the answer to this.



I think that the options menus/implementations are relatively hard-coded, but that's mostly speculation.
0Send private message
9 years ago
Jan 4, 2016, 4:01:34 PM
ZenTractor wrote:
I don't have a solution, but I, too, am interested in the answer to this.



I think that the options menus/implementations are relatively hard-coded, but that's mostly speculation.




I think so too, but if I can get the call Key then I can implement this. They have almost all the code buried in the folders but none of it functional at this point in time. They said they would look at it a year ago and it still isn't in. Most of the "Mods" I've seen thus far are just editing the current values in code that is already working. I am basically writing new code to fit in a function that isn't there. If they have the Key value however and I can get it from them as well as maybe some table data on the calls for variant choice, then maybe I can write the code in the xml instead of having to find the source code or de-compile the unity portion and find it myself. That would make this NOT a mod at all. I don't want to do something that requires 50 steps to implement.
0Send private message
0Send private message
9 years ago
Jan 7, 2016, 10:53:57 PM
OK, so after decompiling the Assembly-CSharp.dll I have found some interesting things;



firstly, You have hard coded protected entries for the two seasons allowed. This is from the Season file in the Root Namespace



[CODE]

public static readonly StaticString ReadOnlySummer = new StaticString("Summer");

public static readonly StaticString ReadOnlyWinter = new StaticString("Winter");

protected int startTurn;

[/CODE]



This makes it pretty damn hard to allow for calls of other seasons in the Registry.xml file and makes my idea of just calling the selected season from the drop down impossible..... Or does it?



The second thing I found is in the SeasonManager file shows a few things,



1[CODE]

public class SeasonManager : GameAncillary, IXmlSerializable, IService, ISeasonService

{

protected Season[] seasons;

protected bool initialBroadcastDone;

protected int currentSeasonIndex;

protected Game game;

protected IDatabase simulationDescriptorDatabase;

protected List openListOfWinterSeasonEffects;

protected List closedListOfPastWintersSeasonEffects;

protected string startingSeasonName;

protected string infiniteSeasonDefinitionName;

protected int infiniteSeasonStartingTurn;

protected IEventService eventService;

private float gameSpeedMultiplier;

private int numberOfPastWinters;

private System.EventHandler SeasonChange;

[/CODE]



You can see here that the season issues are all protected instances and cannot be altered without re-compiling the entire game. Why did you guys lock out the season stuff?



2[CODE]

protected Season GetStartingSeason()

{

// ISSUE: method pointer

return Enumerable.FirstOrDefault((IEnumerable) this.seasons, new Func((object) this, __methodptr(\u003CGetStartingSeason\u003Em__2A5)));

}



protected void SendSeasonChangeEvent(Season oldSeason, Season newSeason)

{

if (this.SeasonChange != null)

this.SeasonChange((object) this, new SeasonChangeEventArgs(oldSeason, newSeason));

if (this.eventService == null)

return;

IPlayerControllerRepositoryService service = this.Game.Services.GetService();

if (service == null || service.ActivePlayerController == null || service.ActivePlayerController.Empire == null)

return;

bool isSeasonInitialization = oldSeason == null;

this.eventService.Notify((Amplitude.Unity.Event.Event) new EventSeasonChange(newSeason, isSeasonInitialization, service.ActivePlayerController.Empire as Empire));

}

[/CODE]



The GetStartingSeason string is using a pointer to a file that we cant update and load as a mod. This makes it a bit hard to make a season selection mod.



The SendSeasonChangeEvent string is protected and will only accept strings that are listed in the host structure.





Are you guys going to look at adding what I'm asking about at all or is this a pipe dream bc it's kind of a big thing that you guys said you were looking at A YEAR AGO! All the information is here to compile and make a working module for selectable seasons, why has noone done it yet?
0Send private message
9 years ago
Jan 11, 2016, 12:23:18 AM
Ok so back at it, after a few days off I'm looking into a method to change the value of "Summer" to "%GameOptionSeason". If we can find the XML derivative of this C# code then we can probably have our seasons working correct.



[CODE]

public void SetValue(

StartingSeason summer,

%GameOptionSeason

)

[/CODE]





I am not too familiar with XML, can anyone help me out here?
0Send private message
9 years ago
Jan 27, 2016, 4:20:48 PM
Hello,



The info is in the registry.xml in the following line:

Summer



Then the winter difficulty has an effect on the lenght of the seasons.



As you know with the last blog entry, a new faction is coming to Endless Legend, the Allayi, along with features linked to winter.

We've made some general changes at this level and I hope you will appreciate them as soon as the DLC is launched.
0Send private message
9 years ago
Jan 27, 2016, 11:31:49 PM
Pikou wrote:
Hello,



The info is in the registry.xml in the following line:

Summer



Then the winter difficulty has an effect on the lenght of the seasons.




The main issue with that is there is no way to change the starting season dynamically, it can ONLY read either "Summer" or "Winter", otherwise it throws an error and defaults back to "Summer"



He'd like to be able to change it to %GameOptions which would otherwise work, but since it can only read either of those values it won't work. I believe he is looking for some elegant work around that would allow his mod to work.



I suggested some automated console command that is run at the start of the game based on the drop down, but neither of us know if that is possible, or the verbage for it in XML.
0Send private message
9 years ago
Jan 29, 2016, 3:42:58 PM
Thanks a lot for the clarification Alanim.

I did not understand it was supposed to be dynamic.

Unfortunately after talking with the dev the code is not supposed to do that and tweaking datas (through xml) won't change that :/

And the code is not available for changes.

We will continue to discuss this in order to if something else might be possible but I don't promise anything unfortunately.
0Send private message
8 years ago
Oct 4, 2016, 7:07:49 PM

Did you guys chop my code and put it in the game?  I got the DLC and it looks identical to what WAS here, but now my code public is missing and you are using my written code in game.  Is there a way I can get my 'Dev' title and maybe a free copy of the new game?  Would be much appreciated.

0Send private message
?

Click here to login

Reply
Comment