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

[WIP]Randomized Unique Components, and Traits

Discussion in 'Civ5 - Creation & Customization' started by Divine Yuri, Nov 8, 2015.

  1. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    Oops seems I accidentally cut the folder instead of copying it on my machine. It's back up now, sorry about that.
     
  2. mikeburnfire

    mikeburnfire Warlord

    Joined:
    Oct 4, 2014
    Messages:
    156
    I made it to step 5, but I'm stuck.

    When trying to Save the Mod Folder Directory, I'm getting "IOException error on Gui.actionperformed", followed by "Cannot find error.log!"
     
  3. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    IOException means it can't find the file.
    Do you have the Defines folder in the same directory as the jar file? (Defines is in the [BNW]Randomized Game folder.)
    Directory.txt is what I write to. If that isn't there it'll just create it, but if Defines isn't there it'll throw an error.

    I should really have it just quit with a message if it can't find the Defines folder in the first place, or change the message to "Can't find the Defines folder. It should be in the same directory as the .jar file. " (well or make the original quit message that.).
     
  4. mikeburnfire

    mikeburnfire Warlord

    Joined:
    Oct 4, 2014
    Messages:
    156
    Here is a video of the problem that I've been experiencing.
     
  5. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    Well had an idea about the fact defines was the wrong case, but that worked on my end.

    Made a slight debug version it's labeled v03.23 in the dropbox folder.
    https://www.dropbox.com/sh/rgvb5ojumhvtvdj/AAAWkL4FzGe0Ijn3Z_GBNMRBa?dl=0

    Send me what it says. It'll have more information for me to work with to help with this problem. Just put it in the same folder as before.

    Sorry about the problems. I'm getting pretty confused on what it could be, but also one more thing :

    When you start the program. Does the mods folder directory say : "Please enter your Civilization 5 Mods folder location.", or is it empty?
     
  6. mikeburnfire

    mikeburnfire Warlord

    Joined:
    Oct 4, 2014
    Messages:
    156
    You fixed it, sorta. Running the new JAR file successfully created a mod. However, it didn't actually randomize anything.

    Checking the DATABASE file, I saw an error that mentioned the word "ADD". I opened your SQL file up with the SDK and deleted the first line:

    ALTER TABLE ADD COLUMN 'PrereqPolicy' TEXT DEFAULT NULL;

    that successfully randomized things, but not everybody has the same amount of components if I try to randomize the 3UC and 4UC.

    hope it helps

    Edit: Have you updated the code since version 7 of 3UC and 4UC. The Ottoman Siege Foundry was replaced, and the Mayan Obsidian Warrior is now a Swordsman UU instead of a Spearman UU. Those two things might be causing the current issue.
     
  7. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    "ALTER TABLE ADD COLUMN 'PrereqPolicy' TEXT DEFAULT NULL;"
    Don't even remember why I had that in the first place. It's completely broken.

    Yep realized what happened with the components. I forgot to make the changes to both my mods folder, and Dropbox. I guess I didn't cut-paste that, but rather just deleted it.

    I made a fix for both problems.
    The SQL Fix .jar has the broken SQL removed.
    For the components fix it's a change to the Defines folder so redownload that.
     
  8. mikeburnfire

    mikeburnfire Warlord

    Joined:
    Oct 4, 2014
    Messages:
    156
    Works great now, as far as I can tell.
     
  9. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
  10. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    Huh.
    Try moving the .jar to the [BNW]Randomized Game folder. Which contains the Defines the program needs to function correctly.

    The reason it's doing that must be because what actually defines the size of the window is at the bottom of the code that creates the GUI, and it must be crashing at some point in the code before that.

    I notice something else was working, but didn't have anything in the Mods directory. Which I believe is the SQL fix. If it felt like that one wasn't working it's probably from being in the wrong folder.

    Get back to me if that works.
     
  11. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    I actually got it to work! First I took your advice, but I am not sure if it mattered. But what mattered was as the program started I quickly grabbed it by the topbar and that stopped it from expanding.

    Started my first game, this looks like fun! :p - http://i.imgur.com/0sFN6UM.jpg
     
  12. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,121
    Location:
    The Kingdom of New Zealand
    Here's a question: how do I add support for a civ who's unique building (for instance) is a different building class depending upon what mods are active. For example, if Building A is a Zoo replacement normally, but when the Enlightenment Era mod is active, it becomes a Menagerie replacement (the two - frustratingly - have different building classes).
     
  13. Divine Yuri

    Divine Yuri Never Closes Chrome

    Joined:
    Oct 28, 2014
    Messages:
    89
    Location:
    Brrrr, USA
    Sorry for the late reply. I've been busy with Finals(and playing Stardew Valley :rolleyes:), and now that I'm done I'll be working on making the file system use SQL/XML files rather than my custom file system (that just read line by line).

    I've decided how to handle some of the tables and some are still up in the air, but I have the tables already in place to fix that problem.
    Here's a example using a mod I've made lately that does almost the same thing:
    Code:
    CREATE TABLE IF NOT EXISTS DY_Random_RequiredMod( 
    	Type	text	default null,
    	Table	text	default null,
    	Column 	text	default	null,
    	Check	text	default	null,
    	ID		text	default null
    );
    CREATE TABLE IF NOT EXISTS DY_Random_Component( 
    	Type		text	default null,
    	Class		text	default null,
    	AltMod	text	default null,
    	AltType	text	default null,
    	AltClass 	text	default null
    );
    
    INSERT OR REPLACE INTO DY_Random_RequiredMod
    	(Type,				Table,		Column, 	Check,			ID										)
    VALUES	('MOD_ENLIGHTENMENT',		'Eras',		'Type',		'ERA_ENLIGHTENMENT',	'ce8aa614-7ef7-4a45-a179-5329869e8d6d'	);
    
    INSERT INTO DY_Random_Component
    	(Type, 				Class,			AltMod,			AltType, 				AltClass)
    VALUES	('BUILDING_DY_RABBIT_HOUSE',	'BUILDINGCLASS_GARDEN',	'MOD_ENLIGHTENMENT', 	'BUILDING_DY_RABBIT_HOUSE_ENLIGHTMENT',	'BUILDINGCLASS_EE_MANOR');
    
    If these tables exist anywhere in the mod the Auto-Modder will read them, and add them directly as a print statement for the mod. You won't need to worry about the RequiredMod table. It's mostly there to allow flexibility with mods I didn't think to add to it already.

    In the example above I'm using my Rabbit House Building which is changed from a Garden Replacement to a Manor replacement if using Enlightenment.

    Because of how I handled things with that mod I made a entirely different building instead of just changing the class, but if you don't use the AltType column it'll just ignore that and use the first Type. The same is said for AltClass.

    This is how above will be printed out by the program:
    Code:
    INSERT INTO Civilization_BuildingClassOverrides
    	(	CivilizationType, 		BuildingClassType, 		BuildingType)
    VALUES	(	'CIVILIZATION_ASSYRIA', 		'BUILDINGCLASS_GARDEN',		'BUILDING_DY_RABBIT_HOUSE');
    UPDATE Civilization_BuildingClassOverrides
    SET BuildingClassType = 'BUILDINGCLASS_EE_MANOR', BuildingType = 'BUILDING_DY_RABBIT_HOUSE_ENLIGHTMENT'
    WHERE CivilizationType = 'CIVILIZATION_ASSYRIA'
    AND EXISTS (SELECT * FROM [B]Eras[/B] WHERE [B]Type[/B] = '[B]ERA_ENLIGHTENMENT[/B]' );
    I'll get more in depth later (or more likely link to a dropbox SQL file) when I actually get done with updating the file system as I now have an ample amount of time to work on it.
     
  14. Hurricane55

    Hurricane55 Chieftain

    Joined:
    Jan 12, 2016
    Messages:
    69
    Location:
    NJ, USA
    Is this mod supposed to be compatible with the Community Balance Patch? I tried using these two mods together, and everything seemed fine, except that each time for a handful of specific civs (America, Russia, and a few others) only one unique component was assigned. Other than that, this mod works great!
     

Share This Page