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

Mod Component Requests Thread

Discussion in 'Civ4 - Mod Components' started by Thunderfall, Jun 15, 2006.

  1. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    Some AI could be attached, but it sure would not be very intelligent.
    Would probably more result in ships doing loops forward into the ocean and backwards again, but that's not completly sure.
    But good point, haven't thought of this before.
     
  2. Scrooge

    Scrooge Baa Humbug

    Joined:
    Aug 12, 2001
    Messages:
    81
    Location:
    London
    Yes I can (in a way). I'm not a pro but I understand the methodology, xml (xhtml), and interpreted languages like javascript (designer). I am however a complete greenbe to civ4 python coding and thought that what may take me 5 days :blush:, you pros may figure out in 5 mins :king:. All I need is the (few lines of) code and a pointer to where to insert it, like NotSoGood suggested above. Keep it simple.

    Now that is a very constructive point but I'll think about it later (progressive enhancement). Anyway, I usually play civ4 with aggressive AI and raging barbs on a barb mod (for fun and color, currently with Modern Warfare mod), so a break from constant naval/pirate attacks might be welcome! (besides I don't want to kill every boat in the game, most will get through and the AI also may get lucky) ;) It's just a % chance of sink/injury. Besides I'm not that concerned with what the AI does with the boats as I can see no rhyme nor reason to how it plays them anyway. Eg. 2 games ago I had Ragnar have, like, 12+ galleys with (almost) 3 cities (settled late from a barb) and we have not yet entered classical era! These just sailed in circles in an area of 5 squares until I took pity on him. Pathetic.

    ANYONE?!
     
  3. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    Then some hints.
    Most of the gameplay related things are done in Assets\Python\CvEventManager.py and CvGameUtils.py.
    In this case, in the CvEventManager is a function onUnitMove, which is called after an unit is moved, with some arguments (just look at it).
    There you could attach a check for the domain, a check for a tech, and then just let the dices roll, if the ship should be killed.

    The available python commands can be seen in the Python API. It's sorted in classes, and it's logical. The CyUnit class is a unit, and so on.

    I don't know, if you now anything about python, so minimum short instruction:
    - Intendation is important, because there's no begin/end, no {}, etc, instead the hierachy of commands is just determined by the intendation. Is difficult to program without the python console itself, you should install it.
    - No ; at the end of a line
    - at the end of the line of an if-statement, a loop, etc you need a :
    - Assigning values =, comparing values ==

    Another thing: In the BtS .ini you can turn on python exceptions. They are really useful, turn them on.
     
  4. Scrooge

    Scrooge Baa Humbug

    Joined:
    Aug 12, 2001
    Messages:
    81
    Location:
    London
    Thanks for hints. Very valuable.
    But it seems python is so alien to me, as I opened CvEventManager and found onUnitMove, what I saw was a lot of gobbledygook...
    Messed with it for a while, broke a few things and finally gave up...

    Probably I shall ask somewhere else or ask a friend, who's a hardcore programmer... and a CivFanatic!

    Also: Any recommendations as to any good mod/code that lets worker units to plant forests?
     
  5. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    I thought about the boats, i'll maybe try it, but i'll first be able to mod in a week, so it can last some time.

    Planting Forests: Look at this here ;).
     
  6. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Will donate 5€ for the one who can add the techtree to sevopedia (used by BUG mod). Just buttons or buttons+descriptions does not matter.
     
  7. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    I have seen that some mods add Air Unit promotions, and I thought this was a good idea and should have been done in the original game anyway. Xenomorph gave me a link to one of his mods that has it, but I am not entirely sure how to extract only the air promotions. Can anyone help me find them or can anyone help me extract them from his mod?

    I have no idea where the promotions are (well I know where the promotions are, but I am not sure if it requires more files or not as I have never edited Promotions before), but THESE ARE THE FILES. Thanks to anyone who helps me out, as this might be helpful to everyone around here. :goodjob:
     
  8. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    If these promotions have other effects than the standard ones, then it sure requieres minimum python, more likely dll work.

    And whoa, 800 mb, i'll not download it just for looking at it.
     
  9. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    I'm DLing right now. I'll see what I can come up with, I have also e-mailed Xenomorph. If all goes well I'll try to extract whatever I need for the air promotions (I believe he told me there is no SDK work involved) and I can post it.
     
  10. Scrooge

    Scrooge Baa Humbug

    Joined:
    Aug 12, 2001
    Messages:
    81
    Location:
    London
    Thanks a lot.
    Please let me know when you might be able to look at it. I shall sacrifice 50 axemen to The Cause, O Great One The_J. :bowdown:
     
  11. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    I have what I hope is a simple question about XML. I am trying to make two air promotions for Bombing enemy cities and two for Bombing enemy units. I was just wondering if these were the tags I needed to edit in the PromotionInfos xml file:

    Code:
    			<iCollateralDamageChange>0</iCollateralDamageChange>
    			<iBombardRateChange>0</iBombardRateChange>
     
  12. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    iBombardRateChange is for the culture defense, but if you mean that, then yes, probably.
    For the collateral damage, don't forget that the unit itself must have the ability to do collateral damage. If the unit doesn't have it, then the promotion will not have an effect.
     
  13. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    Well, then it looks like that won't do anything because there is no collateral damage set for an air unit. But when you do the airstrike (or whatever it is called) on the units in a stack it does dole out collateral damage. So will this have an effect?
     
  14. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    :confused: no idea.
    I guess not, but i don't know it.
    It depends on how this mechanic is implemented in the SDK :dunno:.
     
  15. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    Alright, well, I'll just have my playtesters figure it out then.
     
  16. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    Okay, i tried my luck with the sinking ships.
    Gave them a base chance of 80% of sinking on ocean, with compass only 20%, with astronomy 5%.
    Unfortunatly the AI loves to travel over ocean. I gave Mansa in a test setting 25 galleys, and he directly moved them into the ocean -> ship mass suicide.
    Tried to attach a small AI, which forces the ship after a step on ocean back to the coast. But this a) does not prevent the sinking on the first movement, and b) the AI completly does not care about it. It will just move the ship in the next round again in the same direction, even when i force the ship to move a plot more into the other direction.
    -> without a dll modification this will never work properly.
    I've attached the test, maybe someone will have a use for it.
     

    Attached Files:

  17. cybrxkhan

    cybrxkhan Asian Xwedodah

    Joined:
    Aug 10, 2006
    Messages:
    9,687
    Location:
    The Universe
    I am not sure whether this is possible through python, or whether it requires SDK...

    Anyhow, I wonder if it's possible to somehow make a "slider" similar to the research slider, or the espionage slider (on the upper left of the screen), except that this "slider" helps improve relations with other civilizations. Let's just call it an "Aid Slider", to represent aid and investment in another civilization. For example, at its simplest, if I put 10% of my money into the "Aid Slider", I would get +2 relations with all civilizations.

    That simple version is a bit too simple and unrealistic, obviously, since nobody would want to help their enemies, so how hard would it be to have a slider for each civilization? For example, have a screen where you can pick how much "aid" to give to a civilization? Is this doable through python, or would it require SDK?

    Thank you very mcuh in advance,

    cybrxkhan
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,967
    Location:
    Germany / Netherlands
    Interesting idea :cool:.
    :think: to get another slider in, it will need some interface modifications. Should not be that hard, because one of the existing ones could be copied. :think: what about the symbol?
    Applying an effect could be done in python or in the SDK.
    In python, the AI would never use it.
    :think: i don't think, i'll look in it.
    Might be to complicated to find the sliders.
     
  19. Ectropy

    Ectropy Chieftain

    Joined:
    Apr 13, 2010
    Messages:
    4
    I've been looking for a simple mod to turn off research sharing amongst team mates. I don't really know how to mod outside of the XMLs and python, and I couldn't seem to find anything related to tech sharing in those files.

    Has this already been done? Is this possible? I've been searching through the forums and on google and all I've found are a few three year old threads which have no further information on this issue.
     
  20. rychan

    rychan CS geek

    Joined:
    Feb 29, 2004
    Messages:
    160
    Location:
    Pittsburgh, PA
    I would love a mod that makes food more share-able between cities. I don't really care what mechanic this is through -- an early game corporation, special trade routes, whatever. It might be fine if food pools for your entire empire they way commerce does.

    I just think this would be more realistic. It's not like New York City, or even all of New England, feeds itself. This would allow more city specialization. You could have farming cities in the interior of a continent and commerce cities on the rivers and coasts, and mining towns in the mountains.

    As to how food is actually distributed to and from cities, I leave that up to anyone who knows of an easy mechanic that might allow this.
     

Share This Page