Announcement

Collapse
No announcement yet.

Dale's MOD Factory!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dale's MOD Factory!

    Welcome to Dale's MOD Factory!

    I'm going to be placing here code that can be used in an advanced fashion by modders to enhance their own mods. I have supplied both a compiled version of the mod (for v1.61 Civ4) as well as the source code.

    NOTE: The source code items WILL require you to modify and compile a new SDK DLL file! Do not attempt this if you are unsure what you are doing!

    Also note that I will not be providing support for how to compile or use the SDK. Those questions are for different threads in this forum.

    --------------------------------------------------------------------------------------------------------

    Ranged Field Bombardment:
    SDK v1.61 Code: http://users.tpg.com.au/thesdale/civ...ombardCode.zip
    SDK v1.61 Compiled: http://users.tpg.com.au/thesdale/civ...BombardSDK.zip
    Code Version: 1.0

    What it does:

    Units that are given this ability lose the vanilla bombard ability of bombarding adjacent cities, and gain a ranged bombard ability on units, cities and improvements. The bomb range xml setting defines how far away the unit can bombard. Simple click the bombard icon and select the tile you wish to bombard. Allowed squares show in green when mousing over them, similar to the air bomb event.




    How to Implement:

    Note: Replace [ ] braces with < > in the code items below.

    Step 1: Add the new code to the DLL and compile.
    Step 2: Modify the #define value in CvDefines.h to true or false (true turns on the mod) and re-compile.
    Step 3: Add the new interface to CIV4InterfaceModeInfos.xml
    Code:
    		[InterfaceModeInfo]
    			[Type]INTERFACEMODE_BOMBARD[/Type]
    			[Description]Ranged Field Bombard[/Description]
    			[Help]Ranged Field Bombard[/Help]
    			[CursorType]CURSOR_AIRBOMB[/CursorType]
    			[Mission]MISSION_BOMBARD[/Mission]
    			[HotKey]KB_B[/HotKey]
    			[bAltDown]0[/bAltDown]
    			[bShiftDown]0[/bShiftDown]
    			[bCtrlDown]0[/bCtrlDown]
    			[iHotKeyPriority]0[/iHotKeyPriority]
    			[HotKeyAlt/]
    			[bAltDownAlt]0[/bAltDownAlt]
    			[bShiftDownAlt]0[/bShiftDownAlt]
    			[bCtrlDownAlt]0[/bCtrlDownAlt]
    			[iHotKeyPriorityAlt]0[/iHotKeyPriorityAlt]
    			[bVisible]1[/bVisible]
    			[bGotoPlot]0[/bGotoPlot]
    			[bHighlightPlot]1[/bHighlightPlot]
    			[bSelectType]0[/bSelectType]
    			[bSelectAll]0[/bSelectAll]
    			[Button],Art/Interface/Buttons/Actions/Bombard.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,2,1[/Button]
    		[/InterfaceModeInfo]
    Step 4: Modify the MISSION_BOMBARD event in CIV4MissionInfos.xml
    Code:
    		[MissionInfo]
    			[Type]MISSION_BOMBARD[/Type]
    			[Description]TXT_KEY_MISSION_BOMBARD[/Description]
    			[Help]TXT_KEY_MISSION_BOMBARD_HELP[/Help]
    			[Waypoint]NONE[/Waypoint]
    			[EntityEventType]ENTEVENT_BOMBARD[/EntityEventType]
    			[iTime]16[/iTime]
    			[bTarget]0[/bTarget]
    			[bBuild]0[/bBuild]
    			[bSound]1[/bSound]
    			[Button],Art/Interface/Buttons/Actions/Bombard.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,2,1[/Button]
    		[/MissionInfo]
    Step 5: Add the new xml flags to the schema in CIV4UnitSchema.xml
    Code:
    	[ElementType name="bDCMBombard" content="textOnly" dt:type="boolean"/]
    	[ElementType name="iDCMBombRange" content="textOnly" dt:type="int"/]
    AND in the CvUnitInfo element:
    Code:
    		[element type="bDCMBombard" minOccurs="0"/]
    		[element type="iDCMBombRange" minOccurs="0"/]
    Step 6: Modify your units by adding the following code in Civ4UnitInfos.xml
    Code:
    			[bDCMBombard]1[/bDCMBombard]
    			[iDCMBombRange]1[/iDCMBombRange]
    NOTE: The value of iDCMBombRange is the number of tiles the unit can bombard. EG: Artillery with a iDCMBombRange of 2 can bombard 2 tiles away.
    Last edited by Dale; July 19, 2006, 18:29.

  • #2
    Missiles (suicide units):
    SDK v1.61 Code: http://users.tpg.com.au/thesdale/civ...esCode1.1b.zip
    SDK v1.61 Compiled: http://users.tpg.com.au/thesdale/civ...lesSDK1.1b.zip
    Code Version: 1.1b - 26th June 2006

    What it does:

    The missile ability causes units to explode on contact with the enemy. This explosion is done during combat. One combat round will be processed (so a chance the missile itself could be hit for anti-air units you create [see below in notes]) and then the missile will explode. The nuke range ability has been enabled for non-special nuke units when they have the missile tag. This means your missile can be nuclear as well to create tactical nukes.

    How to Implement:

    Note: Replace [ ] braces with < > in the code items below.

    Step 1: Add the new code to the DLL and compile.
    Step 2: Modify the #define value in CvDefines.h to true or false (true turns on the mod) and re-compile.
    Step 3: Add the new xml flags to the schema in CIV4UnitSchema.xml
    Code:
    	[ElementType name="bDCMMissile" content="textOnly" dt:type="boolean"/]
    AND in the CvUnitInfo element:
    Code:
    		[element type="bDCMMissile" minOccurs="0"/]
    Step 4: Modify your units by adding the following code in Civ4UnitInfos.xml (this will make them missile units)
    Code:
    			[bDCMMissile]1[/bDCMMissile]
    NOTE: If you give a missile unit nuke abilities by change nuke range to: [iNukeRange]1[/iNukeRange] the unit will become a nuclear missile. In this way by defining the air range and air bomb abilities for the unit you just click on air bomb mission and select the target in range. Your unit is now a tactical nuclear missile.

    NOTE2: Since one combat round is processed before the missile explodes, you could create your missile unit, then the anti-missile unit with a combat bonus against the missile unit. By testing and getting the correct values the anti-missile unit has the chance to destroy the missile before impact. Example: You could have a ballistic missile and a SDI unit with a combat bonus against the missile. The SDI unit has a chance to destroy the missile before the ballistic missile explodes.

    NOTE3: The missile ability and nuke range change can be made to any unit. You could give just the missile ability to a Japanese fighter in a world war 2 scenario to have kamikazee zeros, or give both abilities to a spearman to have a nuclear suicide spearmen troop. The options are endless.
    Last edited by Dale; July 19, 2006, 18:07.

    Comment


    • #3
      MAD (pre-targetted nukes):
      SDK v1.61 Code: http://users.tpg.com.au/thesdale/civ...adCode1.3b.zip
      SDK v1.61 Compiled: http://users.tpg.com.au/thesdale/civ...MadSDK1.3b.zip
      Code version: 1.3b - 27th June 2006

      What it does:

      This MAD nukes mod differs from TheLopez's MAD nukes mod in that this one allows for pre-targetted nukes. It makes no changes to how nukes destroy like TheLopez's mod. Basically, in peacetime click on the launch button, click on a potential enemies city and that city will be targetted by the nuke. If the owner of that city ever launches a nuke at you your early detection systems will detect the incoming nuke and automatically launch your MAD nukes at that player. In this way, you can ensure his destruction if caught in a nuclear war. But beware! Any MAD nukes of that player and his allies targetted at YOU will launch in retaliation to your retaliatory strike. Thus the 1960's cold war is born, with the assurance that if you get destroyed, you'll take a hellova lot of enemies out with you at the same time.



      How to Implement:

      Step 1: Add the new code to the DLL and compile.
      Step 2: Modify the #define DCMMad value in CvDefines.h to true or false (true turns on the mod).
      Step 3: Modify the #define DCMMadMsgs value in CvDefines.h to true or false (true display messages, false turn messages off) and re-compile.

      NOTE: If you target your nuke (making it a MAD nuke) and then re-target that nuke at the same city, the MAD system will take it as a manual over-ride and allow the nuke to launch. You may however change the target of the nuke safetly without the MAD system launching it.

      NOTE2: The AI will target what it believes are its potential enemies. The AI's agenda may be different to what you actually think it is.

      NOTE3: The MAD system is connected with your team members, this is to ensure the continuance of the alliance, and mutual defense. So if a nuke is launched at you, your allies MAD nukes will launch back at that player and his team members. The actual MAD response to a nuke attack is done just before your turn.

      NOTE4: If you want to cancel a nuke's target simply click the nuke button and then on the nuke itself.

      NOTE5: If a nuke's target city is captured or destroyed (or becomes invalid any method) then the nuke's target will be reset and the nuke will be awoken (if sleeping or fortified). As a human (with DCMMadMsgs set to true) you will get a "target lost" message. Also, when the nuke goes to launch but the target city is invalid the nuke will reset and you'll receive a "target failed" message.

      NOTE6: Available python commands are
      - CyUnit::getDCMMad() returns true if nuke has a target
      - CyUnit::getDCMMadPlot() returns the target plot or NULL
      - CyUnit::getDCMPlotOwner() returns the owner of the target or NO_PLAYER (-1)
      - CyPlayer::getDCMIncoming() returns the number of incoming targets (own cities targetted by enemys)
      - CyPlayer::getDCMOutgoing() returns the number of your nukes with targets
      - CyPlayer::getDCMMadDeter() returns the value of the AI's MAD deterent level
      - CyPlayer::setDCMMadDeter(int value) sets the AI's MAD deterent level
      Last edited by Dale; July 19, 2006, 18:30.

      Comment


      • #4
        Combined Arms Stack Attack:
        SDK v1.61 Code: http://users.tpg.com.au/thesdale/civ...ackCode1.0.zip CODE NOT AVAILABLE AS YET LINK INACTIVE!
        SDK v1.61 Compiled: http://users.tpg.com.au/thesdale/civ...tackSDK1.0.zip
        Code Version: 1.0

        What it does:

        This mod takes the stack attack element of Civ4 to a completely new level. This mod will simulate a combined arms stack attack against the enemy. Air units will scramble during a battle to intercept enemy planes and strike at enemy ground units (even fighters on carriers and in cities). Siege and ranged units will now fire on the enemy's units while being protected by their own frontline. Flanking units will attempt to go around the enemy frontline to harass the enemy's siege and ranged units. The graphic simulation will now correctly show the battle between the two stacks. For those who have played Call to Power 2 this will seem familiar. But the design of the combat resolution has been increased to better simulate a battle between two armies. I have included an example unit schema file and unit xml file in the compiled zip file. These are set for vanilla civ units.







        How to Implement:

        Note: Replace [ ] braces with < > in the code items below.

        Step 1: Add the new code to the DLL and compile.
        Step 2: Modify the #define value in CvDefines.h to true or false (true turns on the mod) and re-compile.
        Step 3: Add the new xml flags to the schema in CIV4UnitSchema.xml
        Code:
        	[ElementType name="bDCMFlanker" content="textOnly" dt:type="boolean"/]
        	[ElementType name="bDCMRanged" content="textOnly" dt:type="boolean"/]
        	[ElementType name="bDCMBombard" content="textOnly" dt:type="boolean"/]
        AND in the CvUnitInfo element:
        Code:
        		[element type="bDCMFlanker" minOccurs="0"/]
        		[element type="bDCMRanged" minOccurs="0"/]
        		[element type="bDCMBombard" minOccurs="0"/]
        Step 4: Modify your units by adding ONLY ONE of the following code elements to a unit in Civ4UnitInfos.xml
        Code:
        			[bDCMFlanker]1[/bDCMFlanker]
        			[bDCMRanged]1[/bDCMRanged]
        			[bDCMBombard]1[/bDCMBombard]
        NOTE: Combat is resolved via the following process:
        - Attackers sorted into 4 lines (15 units max including cargo)
        - Defenders sorted into 4 lines (15 units max including cargo)
        - Defender air units will attempt an air strike against the attacking stack with risk of interception
        - Defender siege units will process one round of combat to simulate a bombardment
        - Defender ranged units will process one round of combat to simulate an arrow storm
        - Attacker air units will attempt an air strike against the defending stack with risk of interception
        - Attacker siege units will process one round of combat to simulate a bombardment
        - Attacker ranged units will process one round of combat to simulate an arrow storm
        - Attacker melee and flanking units will attack the enemy melee and flanking units (if no enemy unit stands in front of them there is a breakthrough into the enemy ranged and siege lines)

        NOTE2: Stacks are limited to 10 units. However those units can have cargo. Only 15 units will participate in a battle though.

        NOTE3: Interception rates during a stack attack are at an increased value to vanilla Civ4. Beware of that.

        NOTE4: I know the outcome of the battles appear slowely in the message area. I am working on speeding that up.

        NOTE5: Fighters on carriers will now auto-scramble in defense and attack for the stack.
        Last edited by Dale; July 19, 2006, 18:34.

        Comment


        • #5
          Reserved for future.....

          Comment


          • #6
            Reserved for future.....

            Comment

            Working...
            X