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

C2C - Event Ideas

Discussion in 'Civ4 - Caveman 2 Cosmos' started by Hydromancerx, Sep 20, 2011.

  1. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    I can do a lot in python - but gold value in the xml code is limited to a fixed gold value or a random range (or a combination of the two), unless absolutely necessary I'd stick to xml though since the AI actually is aware of those values when choosing an option while it is utterly unaware of anything I do in python.

    I did not disable the archers thing - it was discussed that it might need changing to different promotions at some point though.

    You are welcome to the workboat event ;)
     
  2. Faustmouse

    Faustmouse Deity

    Joined:
    Jan 31, 2012
    Messages:
    3,523
    I am not a programmer, but is it possible that the python calculate the value and give it out in xml so the AI understands it?
     
  3. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    not in the current setup, would very likely need changes in the underlying c code.
     
  4. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,421
    There is the option to make the gold value and maybe some other values in the event XML an expression tag, so you can do some calculations in there (and the AI would be aware of the result when it makes a choice).
     
  5. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    thanks, will need to look that up time permitting...
    Maybe some things are possible then. Although I still don't see me rebalancing each of the events :eek:
     
  6. Faustmouse

    Faustmouse Deity

    Joined:
    Jan 31, 2012
    Messages:
    3,523
    If it's an easy but boring task... Give me an example then and I will TRY to edit them. But I have VERY low programming skills, if any :( But maybe just "copying" your example should be ok.
     
  7. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,421
    Just to make sure it is not misunderstood: Currently it is not an expression tag and it would require some small code changes by me to make it one but I am happy doing that if it will be used.
     
  8. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    So what kind of calculations could be feasibly done with that?
    Just to get an idea whether it would be worth doing.
     
  9. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,421
    This explains the boolean expressions, but the integer expressions are somewhat similar:
    http://forums.civfanatics.com/showpost.php?p=11598257&postcount=27

    You can add, subtract, multiply and divide depending on values of attributes or properties and also count stuff like the number of cities with a certain building or religion.
    I can also expose more information to it if some is needed.

    An example that counts all forests in your cultural territory and then multiplies it by 2 (if it is evaluated on the player):
    Code:
    			<Mult>
    			    <IntegrateCount>
    			      <RelationType>RELATION_ASSOCIATED</RelationType>
    			      <GameObjectType>GAMEOBJECT_PLOT</GameObjectType>
    			      <Has>
    			        <GOMType>GOM_FEATURE</GOMType>
    			        <ID>FEATURE_FOREST</ID>
    			      </Has>
    			    </IntegrateCount>
    			    <Constant>2</Constant>
    			</Mult>
    
     
  10. Il Principe

    Il Principe Prince

    Joined:
    Nov 11, 2005
    Messages:
    491
    Location:
    Hanau, Germany
    A few rev idnex dependent ideas:
    Military coup attempt: High national rev index could cause it. A group of military hardliners try to grap the power.
    Possible outcomes: Give in. automatic war with a civ that is cautious towards you.
    Supress: vairous levels, costing differently.
    a) all means neccesary. big cost, loose 5 random military buildings somewhere in your nation.
    b) stop them: medium cost, loose 5 random military buildings, 10 units go rogue ( babarians)
    c) at least minimize the damage: low cost. 10 buildings lost 15 units go babarian.

    Another high rev index event ( for democaracies or similar):
    Votes not in your favour.
    outcomes:
    a) form a coalition: lowers national rev index ( one time), maintenance costs increased by..hmm 10%?
    b)It´s their turn : lowers national rev index more, one random civic chance without anarchy in religious,education, garbage category ( or the last one.. forgot name right now... like the opposition was a feminist party and suddenly you get matriarchy)
    c) Count the votes again: costs gold, 3 :mad: for 15 turns in all cities.
     
  11. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    @strategyonly

    Since your making new events are you going to try to make some from this thread too?
     
  12. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,599
    Gender:
    Male
    Location:
    MN
    Dang how many THREADs are there for Events:eek:
     
  13. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
  14. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,073
    Location:
    America
    :lol: I'll bet there are similar numbers for every other main discussion topic, old threads get buried and such. I'm fine with new threads if the old one is dead and isn't a core thread (like the Modders Docs or something).
     
  15. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    Thanks for compiling those links - I'll actually now have a reading assignment :mischief:

    I'll try to at least add a few events every now and then going forward.
     
  16. DRJ

    DRJ Hedonist

    Joined:
    Dec 1, 2005
    Messages:
    1,514
    Location:
    Hamburg, Germany
    Ok since Koshling brought it up, I am a bit thinking about including an event to GEM that makes a landbridge on a certain tile vanish at a certain turn.

    The mechanism I thought of to copy paste with (as I am a total code noob) was the Volcano one.

    I knew That when after a volcano becomes extinct in civ, it finally erodes. My plan was to to alter the volcano event cycle so the landbridge on specified tile X;Y would become a volcano in specified turn X, become extinct in specified turn Y and finally erode in specified turn Z

    and leave the eroded tile instead of BARREN the terrain type SEA.

    Also the description of the volcano event would eventually change to something like this

    Code:
    <EventInfo>
    			<Type>EVENT_SEALEVELRISE_1</Type>
    			<Description>TXT_KEY_EVENT_SEALEVELRISE_1</Description>
    ...
    <EventInfo>
    Not sure about how to combine <iWeight> and (if they exist - or anything similar) <iTurn> and <iLocation>?
    in the deviated event though.

    Also

    <EventArt>Art/Afforess/Event_Images/VolcanoEvent.dds</EventArt> would have to be exchanged with the "hurricane/Tornado event dds"?

    And

    when in the volcano event the "volcano" graphic (improvement or terrain?) would be triggered, in the modified file it would be exchanged with "storm" (rain) graphic (which would also be displayed during the "eruption" turn and the following, "extinct" turn, before then "eroding" into sea).


    So my plan was to open the phyton, change something here, change something there and happily present a mechanism.

    Turns out it's not that easy if you are someone who is getting kinda seasick looking at a lot of code. :yuck:


    So I found out that there is maybe an easier way to "compose" this Sealevelrise Event as I discovered this piece of code

    Code:
    <ElementType name="TerrainType" content="textOnly"/>
    	<ElementType name="iTerrainChange" content="textOnly" dt:type="int"/>
    	<ElementType name="ImprovementsRequired" content="eltOnly">
    		<element type="ImprovementType" minOccurs="0" maxOccurs="*"/>
    	</ElementType>
    in the C2C_Civ4EventSchema.XML

    So my question is how could I tie such a terrain change to a certain turn at a certain location with 100% iWeight?

    Thx for your help and sorry I am so bad at coding.


    EDIT: ok I thought about something else: what also could be done would be to manipulate the "global warming" event to happen at a specific place at a specific time (turn) with the specific outcome to change terrain to sea?

    Btw. The new event would have to trigger only at GEM map, is a tag like

    <iMaptypeToTrigger>PRECOLUMBIAN_GEM<iMaptypeToTrigger>

    possible?

    As I said code is like a black box for me but I very much want the cat inside to be alive^^
     
  17. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,421
    You can't without Python or DLL coding. And if you do it that way then likely it won't be in effect only when you use the GEM but also when you use some random map in which it won't fit at all.

    The good way, which is quite a lot of effort though, would be to add the capability to trigger a terrain/feature/improvement change at a certain turn to the worldbuilder map format itself. Then you could add such changes specifically to certain maps where they fit.
     
  18. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Also there is a known bug that can often lead to crashes if any terrain change joins or splits landmasses (this is why fusion nuke detonations sometimes cause a crash). Since it's not an easy bug to resolve it has not yet been fixed, but it really prevents such an event for now.
     
  19. Baradar67

    Baradar67 Chieftain

    Joined:
    Jun 5, 2011
    Messages:
    25
    Would it be easier to create a sea terrain or feature like a tunnel that is passable by land units and then disappears at some point?
     
  20. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    You would have to teach the AI how to use it, so while it would circumvent one set of problems, it adds other work. Better to figure out how to fix the bugs in the terrain changes in the first place I would say.
     

Share This Page