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

Python Performance and Interface Overhaul

Discussion in 'C2C mod mods' started by Toffer90, Jul 7, 2017.

  1. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    4,876
    Location:
    Poland
    Easier for him I guess - he has most of modules.
    Other modders just kept one for themselves.
    They of course are useful if you keep changing stuff constantly, and they were really useful back before SVN was used.
    I wouldn't need anything in modules as I have PPIO and some tools in Notepad++
    I think only extraterrestrial stuff could stay modular forever.

    Of course there could be multiple building or unit files just like wonders, special and regular buildings are separated from each other in core.
     
    Last edited: Feb 23, 2019
  2. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    is there any reason why The_J mod is turned off?? i went to see if in use and it comes up "blank" ???

    was wondering why i could not get my unit after building a farm?? it isnt working now??
     

    Attached Files:

  3. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    4,876
    Location:
    Poland
    A lot of Python stuff were concentrated into fewer python files.
    @Toffer90 knows where he moved stuff from this file.
     
  4. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,299
    Location:
    Norway
    I temporarily removed the code for getting militia units from farms, I forgot about it , so temporary has been a long time now.
    I didn't like the feature as it was and figured I'd just remove it until I could think of a better militia feature for that civic, haven't thought of a better feature, so maybe it's time to add it back in. ^^
    I think that's the only gameplay mechanic that I rudely removed in that manner.
     
    raxo2222 and Thunderbrd like this.
  5. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    but where is the rest of the python located at also??
     
  6. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,299
    Location:
    Norway
    The rest of The_J mod is located in CvEventManager.py.
    A lot of python has been centralized there.
     
  7. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    yeah, i figured that out .. thx . .
     
  8. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,905
    Gender:
    Male
    Location:
    Canberra, Australia
    Not necessarily. It depends on the objects involved, here they are Units. In which case they should be in the New_Cultures. Sometimes you need to have the Transaction elements in a separate file to module Master records. I have no idea why and in this case the Transaction file needs to be loaded later than the Master even if the transactions have nothing to do with anything in the Master. This is why there are a lot of zDepend files around.

    This happens a lot in modules. It should be fine as it is all done with old "Master - Update" technology. The Master in this case is the main unit file. The above are Update transactions to the Unit Master file that add in those Builds. Note checking of the resultant unit XML is done after all the transactions are done. It is slightly more complicated than that in that if there is no Master record one will be created the first time an Update transaction is found. This allows for cases where the object is created only out of Transactions.

    In the above example, if all the units are in core then this code is good if it is in the Natural Wonders module in the zDepend unit file. If you want to do it in a way that is totally safe it would be better to have AndDepenedency tags for everything not defined in the module. This means
    Spoiler Full dependency list for when the unit and builds are both in modules :
    Code:
    <UnitInfo>
                <Type>UNIT_NEANDERTHAL_WORKBOAT</Type>
               <AndDependencyTypes>
                           <DependencyType>UNIT_NEANDERTHAL_WORKBOAT</DependencyType>
                           <DependencyType>BUILD_BEACON_GREAT_BARRIER</DependencyType>
                           <DependencyType>BUILD_LIGHTHOUSE_GREAT_BARRIER</DependencyType>
                 </AndDependencyTypes>
                <Builds>
                    <Build>
                        <BuildType>BUILD_BEACON_GREAT_BARRIER</BuildType>
                        <bBuild>1</bBuild>
                    </Build>
                    <Build>
                        <BuildType>BUILD_LIGHTHOUSE_GREAT_BARRIER</BuildType>
                        <bBuild>1</bBuild>
                    </Build>
                </Builds>
            </UnitInfo>


    Spoiler If the unit is in core :
    Code:
    <UnitInfo>
                <Type>UNIT_NEANDERTHAL_WORKBOAT</Type>
               <AndDependencyTypes>
                           <DependencyType>BUILD_BEACON_GREAT_BARRIER</DependencyType>
                           <DependencyType>BUILD_LIGHTHOUSE_GREAT_BARRIER</DependencyType>
                 </AndDependencyTypes>
                <Builds>
                    <Build>
                        <BuildType>BUILD_BEACON_GREAT_BARRIER</BuildType>
                        <bBuild>1</bBuild>
                    </Build>
                    <Build>
                        <BuildType>BUILD_LIGHTHOUSE_GREAT_BARRIER</BuildType>
                        <bBuild>1</bBuild>
                    </Build>
                </Builds>
            </UnitInfo>

    And what is there would be fine if everything was in core.

    Why would I be involved at all? Natural Wonders has been a core option for a very long time. If you are making changes to a module it is your responsibility to find out how to make the bits play together nicely.

    You only have one object in a module. One bonus or one building etc. No module has more than one object and all its relationships to other modules is well defined.
     
    strategyonly likes this.
  9. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    4,876
    Location:
    Poland
    Changes done to Natural Wonders.
    Now New Cultures can be safely disabled.

    Also I think it was one of rare commits, where I touched something interacting between two modules.
    You can now run xml validator to check if everything else is done correctly as it should be.
     
    strategyonly likes this.
  10. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    if u dont want to add it NOW, can u inform me how to do it NOW, so "I" can add it, thx .. .this is one feature i added back in 2009,, thx. .then DH changed it better to conform to C2C . .
     
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,858
    Gender:
    Male
    Location:
    Las Vegas
    Are you suggesting there should be a few thousand modules?
     
    raxo2222 likes this.
  12. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,299
    Location:
    Norway
    It's easier to just do it than to explain it, so I did it for you.
    Install the attached modmodmod after PPIO is installed.
    I haven't tested it, but I think it works.
     

    Attached Files:

    Last edited: Feb 25, 2019
  13. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    4,876
    Location:
    Poland
    Closer to several thousands ;)
    Now I really think, that he doesn't know how to use notepad++ search effectively.
     
  14. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,905
    Gender:
    Male
    Location:
    Canberra, Australia
    Yes. Currently it is next to impossible to find the weird bug stuff with our XML because of all the comments in it. Having everything in modules or getting rid of those comments would take hours off finding those bugs.
    I use a professional XML tool. A hold over from before I retired. It does a lot more on the fly validation (but not schema based).
     
  15. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    4,876
    Location:
    Poland
    Well mod would load much longer because of all those files - its way faster to load one single file than a lot of files when they take same amount of space.

    TBH modules could be eradicated completely (maybe except for Pepper's extraterrestrial stuff and those currently disabled), just keep major categories of buildings and units in separate files.

    You can try PPIO
     
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,858
    Gender:
    Male
    Location:
    Las Vegas
    Is this tool the reason that note lines are causing you problems? Maybe you need a better tool...

    I'm sorry but I find this suggestion insane on the face of it. Do you have any idea how many added lines of XML would be necessary to build out all the dependencies this would require?
     
    raxo2222 likes this.
  17. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,905
    Gender:
    Male
    Location:
    Canberra, Australia
    No it is comments. The brute force way to find problems is to comment out half of the XML. If you still have the problem then it is in the half you didn't comment out. You can't do9 that with all the comments in. You have to delete half. This is a problem when you have narrowed down the problem to somewhere in the 17th 32nd of the file.
     
  18. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,858
    Gender:
    Male
    Location:
    Las Vegas
    How is it that you cannot still do that with the way things are now? Are you saying that if you start a comment out such as "<!--", anywhere where there is an endcomment such as --> will end that effort, even if there is another startcomment in there? If that's the case, that's interesting.

    I wouldn't think that would work with a lot of Civ game objects anyhow would it? Aren't there too many dependencies and interactions between objects for that? AKA, by commenting out half of the units, for example, you're bound to create problems where those commented out units are called for elsewhere right?

    You can always cut half the XML and paste it into a holding document until you want to later cut and paste it back into place. Arguably, this is even easier. Certainly would be about the same degree of difficulty.
     
  19. tmv

    tmv Chieftain

    Joined:
    Nov 24, 2015
    Messages:
    1,139
    Gender:
    Male
    Location:
    Germany
    I think that's always the case, because the additional startcomment is commented out. Although it would be really nice if comments could stack, I don't think I have seen that anywhere, unless you have different tags you can use (and most languages don't give you options - in fact, Perl doesn't even give you a single option that isn't a hack).
     
  20. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,291
    Gender:
    Male
    Location:
    MN
    how do i change the size to what a person would want, meaning ie: right now i have it set to 1152X862,, but as u can see in the pic the second line/btns are not above the the bottom there and i need it to just be there above it to look normal, so i am asking, thx . . see pic

    dang thats what i forgot about the init file, geez, its been a long time since i did that stuff, thx .. SO and yes it works just fine ..
     

    Attached Files:

    Last edited: Feb 26, 2019

Share This Page