• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

Adding new mission with key + button

Pep

King
Joined
May 28, 2002
Messages
688
Location
Spain
Hi. I intend to add a modified mission type: a sentry mission that works only if a unit of the same type is the vission range. That means that a sentried ship would only awake when an enemy ship were at sight.

The entry in CIV4MissionInfos.xml for the standard sentry mission is:

<MissionInfo>
<Type>MISSION_SENTRY</Type>
<Description>TXT_KEY_MISSION_SENTRY</Description>
<Help>TXT_KEY_MISSION_SENTRY_HELP</Help>
<Waypoint>NONE</Waypoint>
<EntityEventType>ENTITY_EVENT_SENTRY</EntityEventType>
<iTime>0</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>
<iOrderPriority>12</iOrderPriority>
<bVisible>1</bVisible>
<Button>,Art/Interface/Buttons/Actions/Sentry.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,4,4</Button>
</MissionInfo>

My question is: can I add the modified sentry mission in this file without having to specify a new button? I don't know if it is possible allowing "Shift + Sentry button" to be the new interface of the new mission. I know then I'll have to modify CvEnums.h and other C++ files to make a new CvGameCoreDLL.dll, adding the new behaviour of the new sentry mission.
 
Not sure if, by button, you mean HotKey or Button tag.

The Button tag is a graphic link, if you specify the same graphic in another entry then you'll see the same graphic twice(which gets confusing to humans).

But if you mean HotKey, you can have it the same key and a valid action with the highest iHotKeyPriority will take priority. Setting bShiftDown will make the hotkey(in your example) 'shift'+S

btw, questions should probably be posted in the main creation/customization forum
 
Not sure if, by button, you mean HotKey or Button tag.

The Button tag is a graphic link, if you specify the same graphic in another entry then you'll see the same graphic twice(which gets confusing to humans).

But if you mean HotKey, you can have it the same key and a valid action with the highest iHotKeyPriority will take priority. Setting bShiftDown will make the hotkey(in your example) 'shift'+S

btw, questions should probably be posted in the main creation/customization forum

I mean a combination with a Button tag + key, not a Hotkey. For example, clicking on upgrade button upgrades only the selected units while clicking on upgrade button while pressing Alt key, upgrades ALL the units of the selected types (if you have enough mony, of course).

My question really is: can I modify CIV4MissionInfos.xml to have two entries:
- MISSION_SENTRY, active by button tag.
- MISSION_SENTRY_ESP, active by the same button tag as mission_sentry if you press Shift while clicking on the button.

I don't want two different buttons. I want to mod the behaviour of the button when a key is pressed or not. I don't know if this is possible with Civ4 SDK...
 
Back
Top Bottom