1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Really Advanced Setup

Discussion in 'Civ5 - Modpacks' started by General Tso, Jan 20, 2013.

  1. klngarthur

    klngarthur Chieftain

    Joined:
    Sep 27, 2010
    Messages:
    13
    It appears that the game is now either caching the playable/aiplayable values, or is ignoring them. I fixed the issue locally by modifying SlotData:SetPreGameValues() in GTAS_SlotManager.lua so that it randomly picks Civs itself before the game starts:

    Code:
    function SlotData:SetPreGameValues()
    	PreGame.ResetSlots();
    
    	local activeCivs = {}
    
    	for civType,isActive in pairs(MapData.activeCivs) do 
    		if isActive and civType ~= SlotData:GetSlot(0).civType then
    			table.insert(activeCivs,GameInfo.Civilizations[civType])
    		end
    	end
    
    	math.randomseed(os.time())
    
    	for i = #activeCivs, 2, -1 do
    		local j = math.random(i)
    		activeCivs[i], activeCivs[j] = activeCivs[j], activeCivs[i]
    	end
    
    	local randomCivIndex = 1
    
    	for i = 0, GameDefines.MAX_MAJOR_CIVS - 1, 1 do
    		slot = SlotData:GetSlot(i);
    		
    		if slot == nil then
    			PreGame.SetSlotStatus(i, SlotStatus.SS_OPEN);
    			PreGame.SetCivilization(i, -1);
    			PreGame.SetTeam(i, i)
    		else
    			if i > 0 then
    				PreGame.SetSlotStatus(i, SlotStatus.SS_COMPUTER);
    			end
    
    			local civID = -1;		
    			local civ = GameInfo.Civilizations[slot.civType] 
    
    			if civ ~= nil then
    				civID = civ.ID;
    			else
    				civ = activeCivs[((randomCivIndex-1) % #activeCivs) + 1];
    
    				if civ ~= nil then
    					randomCivIndex = randomCivIndex + 1
    
    					civID = civ.ID
    
    					local civ_leader = GameInfo.Civilization_Leaders("CivilizationType = '" .. civ.Type .. "'")();
    					
    					if civ_leader ~= nil then
    						local leader = GameInfo.Leaders[civ_leader.LeaderheadType];
    						slot.leaderName = Locale.ConvertTextKey(leader.Description)
    					end
    					
    					slot.civDescription = Locale.ConvertTextKey(civ.Description)
    					slot.civShortDescription = Locale.ConvertTextKey(civ.ShortDescription)
    					slot.civAdjective = Locale.ConvertTextKey(civ.Description)
    				end
    			end
    
    			PreGame.SetCivilization(i, civID);
    			PreGame.SetTeam(i, slot.team);
    			
    			PreGame.SetLeaderName(i, slot.leaderName);
    			PreGame.SetCivilizationDescription(i, slot.civDescription);
    			PreGame.SetCivilizationShortDescription(i, slot.civShortDescription);
    			PreGame.SetCivilizationAdjective(i, slot.civAdjective);
    		end
    	end
    end
    
     
  2. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    Sorry about the delay in replying...

    Thanks for the feedback. I just started working on something like that - I'll use your code as inspiration.
     
  3. hellagrant

    hellagrant Chieftain

    Joined:
    Mar 28, 2010
    Messages:
    51
    Crazy cool mod. I can't believe some crazy stuff modders come up with in their spare time.

    Anyone know if it is possible to increase the starting gold range? Right now it is at 0-5,000. I want to do something like 10 or 15k.
     
  4. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    Thanks for the positive feedback. I've had several people ask me to increase the gold range (and some of the other start bonuses). I'll look into doing that for the next update. I'm not sure if it will make it into the mod - but I'll try. The problem is caused by the sliders - if I make the max value to big they act kind of funny. They still work but the values between each step in the slider is to big so the user can't set the exact value that they want.
     
  5. mitsho

    mitsho Deity

    Joined:
    Nov 3, 2003
    Messages:
    7,310
    Location:
    Europe, more or less
    Yeah, that might be a problem. Especially for quick games f.e. you do not want too big a minimum amount...

    Can you duplicate the gold slider though so that it adds Gold twice? Then make one slider go from 0 to 1'000 and another one from 1'000 to 10'000? Probably not, but I thought I'd share the idea :)
     
  6. Kennan

    Kennan Chieftain

    Joined:
    Jul 14, 2011
    Messages:
    65
    Location:
    Sweden
    Thank you for a great mod!

    A suggestion for an addition to the Map Panel:
    -Set number of Natural Wonders
     
  7. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    Natural Wonders are near the top of my list of things to do but I'm not sure if modding them as an option is possible. If it is I'll add them. I'm hoping to do something similar to the way resources are done.

    For those asking about increasing starting bonuses: I just started working on the mod again. One of the first things I've been working on is increasing the maximum value of some of the starting bonuses. I increased max starting gold to 20000. I also changed the maximum experience value for starting units from 150 to 500. I think that might be a little bit of overkill, but oh well... It could lead to some interesting possibilities.
     
  8. Zimdictive

    Zimdictive Chieftain

    Joined:
    Mar 18, 2013
    Messages:
    47
    Location:
    Cambridge, UK
    How's the fix for excluding civs from the random pool coming? Venice as AI ruins games... :(
     
  9. Autumnides

    Autumnides Chieftain

    Joined:
    Sep 10, 2013
    Messages:
    1
    Where's the option for the starting bias? I have spent 10 minutes looking for it all over but I just can't find it.
     
  10. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    It's located in the Edit Player panel. It's currently only available for the human player.
     
  11. bladex

    bladex Emperor

    Joined:
    Oct 29, 2010
    Messages:
    1,358
    is this for single players? i can't ever remove the other human player?
     
  12. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    It is single player only.
     
  13. Zimdictive

    Zimdictive Chieftain

    Joined:
    Mar 18, 2013
    Messages:
    47
    Location:
    Cambridge, UK
    Any word on this?
     
  14. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
    Sorry about the delay. I've been meaning to work on an update for awhile but have only completed a very small part of it. I'll try to get a small update with at least this fix (plus a few other odds and ends) sometime in the near future. Probably a couple of weeks or less.
     
  15. Zimdictive

    Zimdictive Chieftain

    Joined:
    Mar 18, 2013
    Messages:
    47
    Location:
    Cambridge, UK
    Thanks! I'm looking forward to it.
     
  16. Jerrybadger

    Jerrybadger Chieftain

    Joined:
    Oct 10, 2013
    Messages:
    4
    Hello! Just got civ 5 on a steam sale and have been trying to get your mod to work but so far my noob attempts have failed! I downloaded through the steam workshop and activate the mod then start a game and although I'm told the mod is active when I click the advanced set up button there is no change? Do I need to adjust any code anywhere to ensure compatibility? I have managed to get a couple of other mods working separately whilst testing so any help would be appreciated!
     
  17. General Tso

    General Tso Panzer General

    Joined:
    Oct 12, 2007
    Messages:
    1,546
    Location:
    U. S. of A.
  18. Jerrybadger

    Jerrybadger Chieftain

    Joined:
    Oct 10, 2013
    Messages:
    4
    Thanks muchly - I was pressing all the correct buttons but found a thread concerning another mod that suggested redoing the system cache on steam properties and it worked! Managed to start a hand and spent an hour testing all the new advanced settings lol! Really good so far so thanks!
     
  19. Entw1ne

    Entw1ne Chieftain

    Joined:
    Oct 28, 2013
    Messages:
    14
    Location:
    Louisiana
    Awesome! This fixed it for me. That was the only issue I was having with this mod post-BNW. Hope you or General_Tso don't mind me using it.

    And if he & you don't mind, Tso, you should considering releasing a quick update with just that fix. That seems to be the main problem many people are having, the Civ-selection not working. I've seen several posts in the Steam Workshop mod page with people having this exact issue.

    Thanks again for the mod, works fine for me now! Appreciate the quick-fix, klngarthur! Take care.
     
  20. TheLastDays

    TheLastDays Warlord

    Joined:
    Jul 30, 2011
    Messages:
    184
    Location:
    Vienna, Austria
    Anyone having problems with this after the fall patch concerning trade routes and espionage?
     

Share This Page