[SDK] Advanced Unit Automations

Strange. It's working for me. I'm re-packing it a zip. That should work at any rate.
 
Tested these posters' reports and got this...
 
Okay - perhaps my copy of 7z is f***ed up. I'll use a different utility.
 
Okay, I used winrar instead of 7z to archive it this time. Tell me if it works.
 
Bingo! Worked.
 
Yes, you can assign an unlimited number of units to protect one unit. I didn't change the BestDefender function, so if you decide to protect a tank with a warrior, the tank will fight, not the warrior. I'm not sure I want to change the bestDefender function, because that will mean this mod alter's gameplay - which is not it's goal.

Cool, that was what I was hoping you would say, I wasn't suggesting for you to change bestDefender, I was simply wondering if assigning more than one "protector" would confuse things and make everything get all screwed up (I got a picture in my head of the three stooges all trying to fit though the doorway so they could each be the "protector")
 
I have another suggestion, a serious one this time.

New mission for Great People: Bulb a certain tech
Which means click the mission button, select an unresearched tech that the GP can eventually bulb from a popup menu, then the unit goes to sleep, waiting for the turn when getDiscoveryTech() returns the desired tech to bulb. Then either do pushMission(MISSION_DISCOVER) automatically or just wake up like spies waiting for max fortify turns.

Worth the effort? Idk, you decide.
 
I have another suggestion, a serious one this time.

New mission for Great People: Bulb a certain tech
Which means click the mission button, select an unresearched tech that the GP can eventually bulb from a popup menu, then the unit goes to sleep, waiting for the turn when getDiscoveryTech() returns the desired tech to bulb. Then either do pushMission(MISSION_DISCOVER) automatically or just wake up like spies waiting for max fortify turns.

Worth the effort? Idk, you decide.

Yeah! I always hate when I'm stuck with unwanted bulbed research. So if my GPs can be given a pop-up of its researchable techs, then I will definitely use that option and let GP sleep until my own determined usefulness of that specific GP time come up, then it will bulb, yay! Also, help people who forget that they have a GP sitting in a certain city in one of many many cities :lol:.
 
I have another suggestion, a serious one this time.

New mission for Great People: Bulb a certain tech
Which means click the mission button, select an unresearched tech that the GP can eventually bulb from a popup menu, then the unit goes to sleep, waiting for the turn when getDiscoveryTech() returns the desired tech to bulb. Then either do pushMission(MISSION_DISCOVER) automatically or just wake up like spies waiting for max fortify turns.

Worth the effort? Idk, you decide.

^this
 
Say would one of you codesmiths, aspiring or otherwise, take a look at my cvgamecore.dll

I'm trying to upgrade versions to the latest and getting compile error

Spoiler :

Code:
1> "C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/bin/link.exe" /dll /nologo  /LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ /LIBPATH:"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK/Lib" /out:Final_Release\CvGameCoreDLL.dll  boost_python-vc71-mt-1_32.lib winmm.lib user32.lib  Final_Release/_precompile.obj Final_Release/BetterBTSAI.obj Final_Release/CvArea.obj Final_Release/CvArtFileMgr.obj Final_Release/CvBugOptions.obj Final_Release/CvCity.obj Final_Release/CvCityAI.obj Final_Release/CvDLLButtonPopup.obj Final_Release/CvDLLEntity.obj Final_Release/CvDLLPython.obj Final_Release/CvDLLWidgetData.obj Final_Release/CvDeal.obj Final_Release/CvDiploParameters.obj Final_Release/CvDllPythonEvents.obj Final_Release/CvDllTranslator.obj Final_Release/CvEventReporter.obj Final_Release/CvFractal.obj Final_Release/CvGame.obj Final_Release/CvGameAI.obj Final_Release/CvGameCoreDLL.obj Final_Release/CvGameCoreUtils.obj Final_Release/CvGameInterface.obj Final_Release/CvGameTextMgr.obj Final_Release/CvGlobals.obj Final_Release/CvHallOfFameInfo.obj Final_Release/CvInfoWater.obj Final_Release/CvInfos.obj Final_Release/CvInitCore.obj Final_Release/CvMap.obj Final_Release/CvMapGenerator.obj Final_Release/CvMessageControl.obj Final_Release/CvMessageData.obj Final_Release/CvPlayer.obj Final_Release/CvPlayerAI.obj Final_Release/CvPlot.obj Final_Release/CvPlotGroup.obj Final_Release/CvPopupInfo.obj Final_Release/CvPopupReturn.obj Final_Release/CvRandom.obj Final_Release/CvReplayInfo.obj Final_Release/CvReplayMessage.obj Final_Release/CvSelectionGroup.obj Final_Release/CvSelectionGroupAI.obj Final_Release/CvStatistics.obj Final_Release/CvStructs.obj Final_Release/CvTalkingHeadMessage.obj Final_Release/CvTeam.obj Final_Release/CvTeamAI.obj Final_Release/CvUnit.obj Final_Release/CvUnitAI.obj Final_Release/CvXMLLoadUtility.obj Final_Release/CvXMLLoadUtilityGet.obj Final_Release/CvXMLLoadUtilityInit.obj Final_Release/CvXMLLoadUtilitySet.obj Final_Release/CyArea.obj Final_Release/CyAreaInterface.obj Final_Release/CyArgsList.obj Final_Release/CyArtFileMgr.obj Final_Release/CyArtFileMgrInterface.obj Final_Release/CyCity.obj Final_Release/CyCityInterface1.obj Final_Release/CyCityInterface2.obj Final_Release/CyDeal.obj Final_Release/CyEnumsInterface.obj Final_Release/CyGame.obj Final_Release/CyGameCoreUtils.obj Final_Release/CyGameCoreUtilsInterface.obj Final_Release/CyGameInterface.obj Final_Release/CyGameTextMgr.obj Final_Release/CyGameTextMgrInterface.obj Final_Release/CyGlobalContext.obj Final_Release/CyGlobalContextInterface1.obj Final_Release/CyGlobalContextInterface2.obj Final_Release/CyGlobalContextInterface3.obj Final_Release/CyGlobalContextInterface4.obj Final_Release/CyHallOfFameInfo.obj Final_Release/CyHallOfFameInterface.obj Final_Release/CyInfoInterface1.obj Final_Release/CyInfoInterface2.obj Final_Release/CyInfoInterface3.obj Final_Release/CyMap.obj Final_Release/CyMapGenerator.obj Final_Release/CyMapGeneratorInterface.obj Final_Release/CyMapInterface.obj Final_Release/CyMessageControl.obj Final_Release/CyMessageControlInterface.obj Final_Release/CyPlayer.obj Final_Release/CyPlayerInterface1.obj Final_Release/CyPlayerInterface2.obj Final_Release/CyPlot.obj Final_Release/CyPlotInterface1.obj Final_Release/CyRandomInterface.obj Final_Release/CyReplayInfo.obj Final_Release/CySelectionGroup.obj Final_Release/CySelectionGroupInterface.obj Final_Release/CyStructsInterface1.obj Final_Release/CyTeam.obj Final_Release/CyTeamInterface.obj Final_Release/CyUnit.obj Final_Release/CyUnitInterface1.obj Final_Release/CvXMLLoadUtilityModTools.obj Final_Release/CvXMLLoadUtilitySetMod.obj Final_Release/FAssert.obj Final_Release/FDialogTemplate.obj   /debug /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF 
1>   Creating library Final_Release\CvGameCoreDLL.lib and object Final_Release\CvGameCoreDLL.exp
[B]1>CvUnitAI.obj : error LNK2019: unresolved external symbol "protected: void __thiscall CvUnitAI::AI_shadowMove(void)" (?AI_shadowMove@CvUnitAI@@IAEXXZ) referenced in function "public: virtual bool __thiscall CvUnitAI::AI_update(void)" (?AI_update@CvUnitAI@@UAE_NXZ)
1>Final_Release\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
[/B]
 

Attachments

The error suggests there is no void CvUnitAI::AI_shadowMove() in your CvUnitAI.cpp, and that is indeed how it is. Either you forgot to merge that or Afforess forgot it, in which case you'll have to extract that function directly out of anewdawn's source code.
 
Say would one of you codesmiths, aspiring or otherwise, take a look at my cvgamecore.dll

I'm trying to upgrade versions to the latest and getting compile error

Spoiler :

Code:
1> "C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/bin/link.exe" /dll /nologo  /LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ /LIBPATH:"C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK/Lib" /out:Final_Release\CvGameCoreDLL.dll  boost_python-vc71-mt-1_32.lib winmm.lib user32.lib  Final_Release/_precompile.obj Final_Release/BetterBTSAI.obj Final_Release/CvArea.obj Final_Release/CvArtFileMgr.obj Final_Release/CvBugOptions.obj Final_Release/CvCity.obj Final_Release/CvCityAI.obj Final_Release/CvDLLButtonPopup.obj Final_Release/CvDLLEntity.obj Final_Release/CvDLLPython.obj Final_Release/CvDLLWidgetData.obj Final_Release/CvDeal.obj Final_Release/CvDiploParameters.obj Final_Release/CvDllPythonEvents.obj Final_Release/CvDllTranslator.obj Final_Release/CvEventReporter.obj Final_Release/CvFractal.obj Final_Release/CvGame.obj Final_Release/CvGameAI.obj Final_Release/CvGameCoreDLL.obj Final_Release/CvGameCoreUtils.obj Final_Release/CvGameInterface.obj Final_Release/CvGameTextMgr.obj Final_Release/CvGlobals.obj Final_Release/CvHallOfFameInfo.obj Final_Release/CvInfoWater.obj Final_Release/CvInfos.obj Final_Release/CvInitCore.obj Final_Release/CvMap.obj Final_Release/CvMapGenerator.obj Final_Release/CvMessageControl.obj Final_Release/CvMessageData.obj Final_Release/CvPlayer.obj Final_Release/CvPlayerAI.obj Final_Release/CvPlot.obj Final_Release/CvPlotGroup.obj Final_Release/CvPopupInfo.obj Final_Release/CvPopupReturn.obj Final_Release/CvRandom.obj Final_Release/CvReplayInfo.obj Final_Release/CvReplayMessage.obj Final_Release/CvSelectionGroup.obj Final_Release/CvSelectionGroupAI.obj Final_Release/CvStatistics.obj Final_Release/CvStructs.obj Final_Release/CvTalkingHeadMessage.obj Final_Release/CvTeam.obj Final_Release/CvTeamAI.obj Final_Release/CvUnit.obj Final_Release/CvUnitAI.obj Final_Release/CvXMLLoadUtility.obj Final_Release/CvXMLLoadUtilityGet.obj Final_Release/CvXMLLoadUtilityInit.obj Final_Release/CvXMLLoadUtilitySet.obj Final_Release/CyArea.obj Final_Release/CyAreaInterface.obj Final_Release/CyArgsList.obj Final_Release/CyArtFileMgr.obj Final_Release/CyArtFileMgrInterface.obj Final_Release/CyCity.obj Final_Release/CyCityInterface1.obj Final_Release/CyCityInterface2.obj Final_Release/CyDeal.obj Final_Release/CyEnumsInterface.obj Final_Release/CyGame.obj Final_Release/CyGameCoreUtils.obj Final_Release/CyGameCoreUtilsInterface.obj Final_Release/CyGameInterface.obj Final_Release/CyGameTextMgr.obj Final_Release/CyGameTextMgrInterface.obj Final_Release/CyGlobalContext.obj Final_Release/CyGlobalContextInterface1.obj Final_Release/CyGlobalContextInterface2.obj Final_Release/CyGlobalContextInterface3.obj Final_Release/CyGlobalContextInterface4.obj Final_Release/CyHallOfFameInfo.obj Final_Release/CyHallOfFameInterface.obj Final_Release/CyInfoInterface1.obj Final_Release/CyInfoInterface2.obj Final_Release/CyInfoInterface3.obj Final_Release/CyMap.obj Final_Release/CyMapGenerator.obj Final_Release/CyMapGeneratorInterface.obj Final_Release/CyMapInterface.obj Final_Release/CyMessageControl.obj Final_Release/CyMessageControlInterface.obj Final_Release/CyPlayer.obj Final_Release/CyPlayerInterface1.obj Final_Release/CyPlayerInterface2.obj Final_Release/CyPlot.obj Final_Release/CyPlotInterface1.obj Final_Release/CyRandomInterface.obj Final_Release/CyReplayInfo.obj Final_Release/CySelectionGroup.obj Final_Release/CySelectionGroupInterface.obj Final_Release/CyStructsInterface1.obj Final_Release/CyTeam.obj Final_Release/CyTeamInterface.obj Final_Release/CyUnit.obj Final_Release/CyUnitInterface1.obj Final_Release/CvXMLLoadUtilityModTools.obj Final_Release/CvXMLLoadUtilitySetMod.obj Final_Release/FAssert.obj Final_Release/FDialogTemplate.obj   /debug /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF 
1>   Creating library Final_Release\CvGameCoreDLL.lib and object Final_Release\CvGameCoreDLL.exp
[B]1>CvUnitAI.obj : error LNK2019: unresolved external symbol "protected: void __thiscall CvUnitAI::AI_shadowMove(void)" (?AI_shadowMove@CvUnitAI@@IAEXXZ) referenced in function "public: virtual bool __thiscall CvUnitAI::AI_update(void)" (?AI_update@CvUnitAI@@UAE_NXZ)
1>Final_Release\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
[/B]

Tried to compile your stuff with codeblocks 8.02 but got this error:

CvGameTextMgr.cpp(19922) : error C2065: 'INTERFACEMODE_SHADOW_UNIT' : undeclared identifier
CvGameTextMgr.cpp(19922) : error C2051: case expression not constant
Process terminated with status 2 (2 minutes, 2 seconds)
2 errors, 0 warnings
 
Did you fully merge in CvEnums.h? That's where INTERFACEMODE_SHADOW_UNIT is declared.
 
The error suggests there is no void CvUnitAI::AI_shadowMove() in your CvUnitAI.cpp, and that is indeed how it is. Either you forgot to merge that or Afforess forgot it, in which case you'll have to extract that function directly out of anewdawn's source code.

I didn't forget it - I compiled the AUA source code standalone tons of times now. Did you merge in the changes in CvUnitAI?
 
Cool, that was what I was hoping you would say, I wasn't suggesting for you to change bestDefender, I was simply wondering if assigning more than one "protector" would confuse things and make everything get all screwed up (I got a picture in my head of the three stooges all trying to fit though the doorway so they could each be the "protector")

Lol. Well, if you wanted to be screwy, you could assign unit A to protect unit B, and unit B to protect unit A. ;)

I have another suggestion, a serious one this time.

New mission for Great People: Bulb a certain tech
Which means click the mission button, select an unresearched tech that the GP can eventually bulb from a popup menu, then the unit goes to sleep, waiting for the turn when getDiscoveryTech() returns the desired tech to bulb. Then either do pushMission(MISSION_DISCOVER) automatically or just wake up like spies waiting for max fortify turns.

Worth the effort? Idk, you decide.

Sure - That wouldn't be hard to do at all.
 
Sure - That wouldn't be hard to do at all.
Really? Nice :)
I was worried about the tech selection popup, since I'm not sure if there's any existsting code that can be reused for that. The rest should be fairly simple though, I agree.
 
Back
Top Bottom