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

The Vault Dev. Canteen (General Discussion)

Discussion in 'Civ4 Fallout: Tame The Waste (FTTW)' started by Lib.Spi't, Jan 22, 2015.

  1. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    I love it when you are involved Archid! :D

    It took me weeks just to figure out how to stop it crashing, and you just appear and fix it! :D

    My comment about the ichange/ipercentchange was in relation to the not negative points problem, that perhaps it works with ipercentchange, but something is wrong with ichange in connection to bisnegative. It was just a thought.

    Yes, my change to the Dll was in relation to fixing the issue with improvements that can spawn units.

    Just incase you missed what I said, it is about the Civic activation tag not working for spawning improvements and also that improvements that spawn units are automatically destroyed when a unit roles over them, meaning you destroy your own improvements. Also you cannot get pillage rewards from Spawning improvements.

    There is also some Xml stuff to be updated to SF, from the latest version I think.
     
  2. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    I wrote the buggy code in the first place so don't thank me too much :)

    I have fixed the issue with the reduction not happening, it was only a problem in some scenarios, but should be good now for all cases.
     
  3. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    Looking at the XML for the dens you have pillaging configured to provide culture from <PillageCommerces> and food from <PillageYields>

    PHP:
    <ImprovementInfo> <!--Rad Spider Den -->
        <
    Type>IMPROVEMENT_PANTHER_DEN</Type>
        <
    Description>TXT_KEY_IMPROVEMENT_PANTHER_DEN</Description>
        <
    Civilopedia>TXT_KEY_IMPROVEMENT_PANTHER_DEN_PEDIA</Civilopedia>
        <
    ArtDefineTag>ART_DEF_IMPROVEMENT_LION_DEN</ArtDefineTag>
        <
    bOutsideBorders>1</bOutsideBorders>
        <
    PillageCommerces>
            <
    iCommerce>0</iCommerce>
            <
    iCommerce>0</iCommerce>
            <
    iCommerce>500</iCommerce>
            <
    iCommerce>0</iCommerce>
        </
    PillageCommerces>
        <
    PillageYields>
            <
    iYield>300</iYield>
        </
    PillageYields>
        <
    BonusTypeStructs>
            <
    BonusTypeStruct>
                <
    BonusType>BONUS_PIG</BonusType>
                <
    bBonusMakesValid>1</bBonusMakesValid>
            </
    BonusTypeStruct>
        </
    BonusTypeStructs>
        <
    iAppearanceProbability>100</iAppearanceProbability>
        <
    SpawnUnitType>UNIT_PANTHER</SpawnUnitType>
        <
    bSpawnBarbarian>1</bSpawnBarbarian>
    </
    ImprovementInfo>
    In order to get gold you should use the <iPillageGold> tag, or you could use the first commerce type which represents gold, but the iPillageGold tag is easier when you are looking back at the XML.
     
  4. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    In relation to spawning and civics you need to build your own improvement to replace the original den to start spawning unit for yourself.

    If you look at the Rad Spider Den improvement above you can see that the last tag is <bSpawnBarbarian>1</bSpawnBarbarian>. This is what is used to determine whether this improvement can spawn units for the plot owner or not. The expectation was that the player needed to replace the original improvement (den) with one of their own before it would start spawning units for them. The player equivalent improvement would be identical to the original (or not) with <bSpawnBarbarian>0</bSpawnBarbarian>

    In relation to the auto-destroy, you need to define the rules for when a unit will auto-destroy a den. Looking at the current code units from any team apart from the human player will destroy any den if they are at war with the barbarians. The human player shouldn't auto-destroy them.

    One possibility would be players auto-destroy dens of teams they are at war with. The difficulty here is deciding whether it is better to actually leave a barbarian den alone if you expect to 'convert' it later in the game. That's a very difficult calculation to make as is dependent on knowing the civics that you are likely to use later on, which is a decision that the AI continually assesses.
     
  5. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    No, sorry the problem came from a different scenario.

    I added a civic spawning effect to farms. (I may or may not have switched off the bSpawnBarbarian tag, it was a while ago and I can't remember, but I am pretty sure I would have at somepoint.)

    What then happed is my workers would build the farm, it would spawn the chosen unit(whether the civic was active or not) and the farm would also get auto-destroyed by either the spawner or the worker.

    With the barbarian dens, I wanted them to be pillagable so that you can say get food or science from them (as applicable depending on the site) You would not be able to take control of them, if you left it, it would continue to spawn barbs.

    Does that make sense?
     
  6. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    OK, now I get what you are looking for. I can see the commented out stuff for the Farm improvement, it should spawn a single militia.

    Looking at the dll code there is a block that says it requires a civic, but I'll need to step through it to see why it isn't working.
     
  7. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
  8. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Ok, a new CTD has just appeared and I don't know if it has been there all along, or if I have done something to break it recently?!?!

    It happens when the mouse moves around near the minimap, or possibly the flag again, it is hard to tell because there are a couple seconds of delay before it crashes. It definately happens when I move the mouse around the minimap area of the screen. Ok iti s flag related, so maybe it is the same problem that you already fixed now randomly surfacing on the version of the game that never used to crash and that I thought I had fixed?!? How is that for a headache!

    I will try your fixed version soon and see if it goes way again!
     
  9. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    Improvement bug fix commit in S/F

    The civic check was not looping through all the civics (only the first 4) so any civic requirement after these was ignored.

    Added an additional condition to the auto-destroy that it only happens on barbarian spawning improvements
     
  10. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    The problem was with traits that changed the yields such as Chieftain. If you have this trait then it will CTD on the flag mouse-over until you have the fix in place.
     
  11. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Yeah I figured that was the case, I will check it again soon.

    It is weird because I had 3 versions 2 of which I could not get to crash, now it has started crashing on it!? Colour me confused.

    At some point I need to relearn and setup for compiling .dll's again.

    Learning things makes my head hurt.

    Could you upload a new .dll file to SF?
     
  12. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Originally Posted by Archid
    @Night just run your xml indenter pl script and noticed that it doesn't handle comments at the end of lines. I tend to do that so when I fold long XML files, such as buildings or units, in Notepad++ I can see what all the elements are easily.

    Perhaps a bit late, but I fixed this issue. I also updated tagUpdate.pl to automatically add the type as a comment for this usage. The main purpose of this script is to add/remove tags to match the schema file and it saves a lot of time if a tag is moved or rendered obsolete
    I committed this to the CivEffect branch in M:C for those who are interested.

    Also Night left you this message just after you left, in the Group boards
     
  13. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    New dll uploaded to SF

    Thanks for pointing me to the message from Night, good to know that he tweaked it as it is a good tool.
     
  14. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
  15. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Damn...

    The Flag crash is still happening even with the New .dll

    This makes no sense, I can't figure out why it has suddenly started crashing!?!

    To my knowledge I haven't edited anything recently except adding sound files (Which now work Properly)

    It was working fine before that, the flag did not cause the crash once I removed the problematic tags from the traits.

    I just can't figure out why it has suddenly started to crash all the time on the flag, it used to crash only with specific civic traits with specific tags.

    I am thoroughly confused!
     
  16. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    Can you send me the latest config updates you have made and a save file and I will attach a debug dll and see what I can find out.
     
  17. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    It is weird, it started happening after I added new sounds...

    It was fine before that (except for those trait scenarios we already discussed) but now it crashes from the beginning, as soon as you mouse over the flag.. but I changed nothing to do with that it is so strange...

    I don't have a save game, but like I said it hapens straight away.

    There is one other thing in relation to Traits and tags that modify specialists, I may be using the wrong tag but I don't think so.

    The tag that should add a +X Yield adds a +X% Yield instead. (I don't know if this is a visual bug, or if the function itself is broken?)

    You can see it in the first 4 'C' Traits in the pedia (once you start a game and go back to the main menu) Also pillage increases don't show up.

    5.2 latest faff!
     
  18. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    The traits are working as expected. Following the Firaxis naming convention, which they usually stick to, xxxModifier is a +X% change and xxxChange is a +X change. These are described in the HTML help files on SF here

    The entry for TXT_KEY_TRAIT_YIELD_MODIFIERS is incorrect in CIV4GameText_DynamicTraits it is currently:

    PHP:
    <TEXT>
        <
    Tag>TXT_KEY_TRAIT_YIELD_MODIFIERS</Tag>
        <
    English>[NEWLINE][ICON_BULLET]%D1%F2_yield</English>
    </
    TEXT>
    and it should be

    PHP:
    <TEXT>
        <
    Tag>TXT_KEY_TRAIT_YIELD_MODIFIERS</Tag>
        <
    English>[NEWLINE][ICON_BULLET]%D1%% %F2_yield</English> <!-- Added '%% ' in here after  %D1-->
    </
    TEXT>
    The Pillage effects are totally missing from the display so I have fixed that and will push a new dll to SF. You will need to add the following into CIV4GameText_DynamicTraits.xml

    PHP:
    <TEXT>
        <
    Tag>TXT_KEY_TRAIT_PILLAGING</Tag>
        <
    English>[SPACE]from Pillaging</English>
    </
    TEXT>
     
  19. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Excellent, that explains that one then! :D

    This way of working is so much nicer than constantly banging my head against the wall :wallbash:

    I have now updated the text file.

    Have you been able to replicate the flag crash? Even if it is not fixed, if you have it, it means at least something isolated and bizzare is not happening.
     
  20. Archid

    Archid Warlord

    Joined:
    Oct 30, 2009
    Messages:
    287
    Location:
    North Wales, UK
    I'll look into that now, I wanted to get the easy stuff done first
     

Share This Page