Announcement

Collapse
No announcement yet.

Adding unit actions

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

  • Adding unit actions

    Has anyone been able to figure out how to add new unit actions (so when you select that unit your custom button appears to activate their new action?)

    It's looking like we need the SDK as far as I can see...

  • #2
    Did you try Civ4MissionInfos.xml in the units xml folder?

    Comment


    • #3
      Yeah I did but it doesn't look like I can do anything with it until I have access to the SDK, since on the top it says:

      "Changes must be reflected in CvEnums.h"

      which of course is a C++ header file

      And if you look into the UnitInfos xml it looks like the only way to specify what missions are available to units is by setting hardcoded boolean flags like bSabotage or bPillage. If I made a new mission how could I specify which units can use it?

      I thought it would've been something like, for each unit:

      <MissionTypes>
      <Type>MISSION_SLEEP</Type>
      <Type>MISSION_FORTIFY</Type>
      </MissionTypes>

      instead of those hard coded boolean tags
      Last edited by TheDarkside; November 6, 2005, 20:10.

      Comment


      • #4
        Bringing back a year old thread...

        So I'm trying to add poison capabilities for spies. I've finished my coding in the SDK but I'm having trouble with CIV4MissionInfos.xml. Any time I try to add the MissionInfoType element it causes the game to crash immediately after hitting Continue when the game begins(after the map is generated and Play Game is clicked). This happens with my modified DLL and also the original 1.61 dll. Here is my add to the MissionInfoType XML file:

        [MissionInfo]
        [Type]MISSION_POISON[/Type]
        [Description]TXT_KEY_MISSION_POISON[/Description]
        [Help]TXT_KEY_MISSION_POISON_HELP[/Help]
        [Waypoint]NONE[/Waypoint]
        [EntityEventType]ENTEVENT_SABOTAGE[/EntityEventType]
        [iTime]20[/iTime]
        [bTarget]0[/bTarget]
        [bBuild]0[/bBuild]
        [bSound]1[/bSound]
        [HotKey]KB_S[/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]
        [Button],Art/Interface/Buttons/Actions/Sabotage.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,8 ,4[/Button]
        [/MissionInfo]


        I have basically mimicked everything identical to the sabotage mission with the exception of the actual poison code in CvUnit.cpp.

        Here is a list of the files changed.


        * CyEnumsInterface.cpp
        * CyUnit.h
        * CyUnit.cpp
        * CyUnitInterface1.cpp
        * CyInfoInterface1.cpp

        * CvDefines.h
        * CvEnums.h
        * CvInfos.h
        * CvInfos.cpp
        * CvUnit.h
        * CvUnit.cpp
        * CvUnitAI.h
        * CvUnitAI.cpp
        * CvSelectionGroup.cpp

        * CIV4GlobalTypesSchema.xml
        * CIV4GlobalTypes.xml
        * GlobalDefines.xml

        CIV4MissionInfos.xml
        * CIV4UnitClassInfos.xml
        * CIV4UnitInfos.xml
        * CIV4UnitSchema.xml

        * CIV4InterfaceModeInfos.xml

        * CIV4CivilizationInfos.xml
        * CIV4LeaderHeadInfos.xml

        * CIV4GameText_Help.xml
        * CIV4GameTextInfos.xml

        Everything with a star next to it allows the game to run fine. CIV4MissionInfos.xml is the only one giving me a problem. I'm obviously missing something. Possibly some python changes? I've poked around but haven't found anything that seems related. Any ideas?
        Last edited by zafzo; August 20, 2006, 13:26.

        Comment


        • #5
          It'll be crashing because you have two missions that are exatly the same... Does it perform Sabotage, or does it perform Sabotage. One of them does poison, the other doesn't, but which?
          Ceeforee v0.1 - The Unofficial Civ 4 Editor -= Something no Civ Modder should ever be without =- Last Updated: 27/03/2009
          "Just because I'm paranoid doesn't mean there's no conspiracy"

          Comment


          • #6
            Sorry. That was a cut and paste error. :-) Fixed. The only identical entries to the sabotage mission are the entity event and the art.

            Comment


            • #7
              Fixed it. Evidently it doesn't like having new missions inserted into the middle of the xml even if it's in the same position other places. I put it at the end and it worked like a charm. Figures that it would be something stupid and easy.

              Comment

              Working...
              X