Linkman226
#anarchy
- Joined
- Sep 14, 2007
- Messages
- 2,493
Sounds like the system in the Total War series, except let's hope the AI's actually competent in your modcomp. And a great idea, btw
The Diplomat Mod
Announcing the release of the Diplomat Mod - Beta 1.0
See first page for link to download.
Enjoy!
Great news, i have been wanting this since Tom(tsentom1) had his made in his mod Also i am the 1st to d/l Yeah!
Also a plus, you stayed away from that dreaded CvEventManager.py file.
Did you select the OGI_Smartmap Map option? The mod will crash if you don't use this option.
I wasn't having much luck figuring out/ finding on the forum what "OGI_Smartmap" is.
I have been able to play sometimes, although it involves hitting escape, saving and reloading the save on the first turn to get the interface to load.
Could you please walk me through the steps for properly beginning a new game ?
1) Load BTS
2) Load Grand Inquisitions.
3) Then what's the menu "Pathway"?
Thanks!
Short answer Thanks a lot, it works fine now. It's an exciting map!
The menu came up as you said when I tried to start a new game of GI, and I've been playing ever since.
I like the way you think, I would have modded many of the same things if I had the skill
def AI_unitUpdate(self,argsList):
pUnit = argsList[0]
### BREAK ICE AI - START - 16/10/11 - ARIAN
pUnitType = pUnit.getUnitType()
pWorkboat = gc.getInfoTypeForString("UNIT_WORKBOAT")
iUnitOwner = pUnit.getOwner()
pPlayer = gc.getPlayer(iUnitOwner)
# unit must be workboat
if pUnitType == pWorkboat:
iX = pUnit.getX( )
iY = pUnit.getY( )
pPlot = CyMap( ).plot(iX, iY)
iPlotOwner = pPlot.getOwner()
# plot must be owned by player or by nobody
if iPlotOwner == iUnitOwner or iPlotOwner == -1:
# plot must have ice
iFeatureIce = gc.getInfoTypeForString("FEATURE_ICE")
if pPlot.getFeatureType() == iFeatureIce:
# check if ice can be removed
iBreakIce = gc.getInfoTypeForString("BUILD_BREAK_ICE")
if pUnit.canBuild(pUnit.plot(), iBreakIce, false) == true:
# break the ice ??
pUnit.getGroup().pushMission(MissionTypes.MISSION_BUILD, iX, iY, 0, False, False, MissionAITypes.MISSIONAI_BUILD, pUnit.plot(), pUnit)
return true
### BREAK ICE AI - END - 16/10/11 - ARIAN
return false
Hello OV,
About the ice breakers not breaking ice for the AI. I'm sure you are aware of this.
I have attempted to fix this with my rudimentary Python-skills.
In CvGameUtils.py I added this code:
Spoiler :
PHP:def AI_unitUpdate(self,argsList): pUnit = argsList[0] ### BREAK ICE AI - START - 16/10/11 - ARIAN pUnitType = pUnit.getUnitType() pWorkboat = gc.getInfoTypeForString("UNIT_WORKBOAT") iUnitOwner = pUnit.getOwner() pPlayer = gc.getPlayer(iUnitOwner) # unit must be workboat if pUnitType == pWorkboat: iX = pUnit.getX( ) iY = pUnit.getY( ) pPlot = CyMap( ).plot(iX, iY) iPlotOwner = pPlot.getOwner() # plot must be owned by player or by nobody if iPlotOwner == iUnitOwner or iPlotOwner == -1: # plot must have ice iFeatureIce = gc.getInfoTypeForString("FEATURE_ICE") if pPlot.getFeatureType() == iFeatureIce: # check if ice can be removed iBreakIce = gc.getInfoTypeForString("BUILD_BREAK_ICE") if pUnit.canBuild(pUnit.plot(), iBreakIce, false) == true: # break the ice ?? pUnit.getGroup().pushMission(MissionTypes.MISSION_BUILD, iX, iY, 0, False, False, MissionAITypes.MISSIONAI_BUILD, pUnit.plot(), pUnit) return true ### BREAK ICE AI - END - 16/10/11 - ARIAN return false
I wonder if the pushMission will work.
Also workboats do not actively search for ice to break.
What do you think of the code? Will it work?
Maybe it needs some finetuning
A couple of notes:
1. OGI has an Ice Breaker unit called "UNITCLASS_ICE_BREAKER", and does not use the workboat for breaking ice.
2. You might want to specify when the workboat receives the capability to break ice by identifying a prerequisite tech.
I believe the mission should work. However, you need to make the work boat go to a specified plot with ice to execute the mission. I will play with it and if successful, I will update OGI with the new capability.
Making workboats (or icebreakers in OGI) seek out ice is not implemented, but would be great!
Yes. The core issue is always getting the AI to use the new capability. I'm sure I can force the Icebreaker to seek out ice plots. The trick is seeking out the correct plots to remove ice and limiting the missions to only those key plots necessary to allow other ships to pass through.
I'm really enjoying this mod,
...it seems like there's always something to build.
It seems to me that the first spy tech wasn't appearing on the pop-up menu after completing research for a tech, I had to open the tech tree and look for it, because there were no spies to build. Minor, really, once you know to check the tree.
What seems odd to me was that the only coal-powered ship I could find was the BTS Ironclad. Everything else from ironclad frigates to Pre-Dreadnaught Battleships required oil. The game switches navies abruptly from sails to oil. I'm pretty sure that oil shouldn't be a requirement before the destroyer/Dreadnaught era. What does your historian say about this?
Having workboats/icebreakers seek out ice plots would be better than nothing. My code only allows breaking ice on plots owned by the player or plots owned by nobody. Near the end of the game all the ice would be gone
Status update for ver 255D
1. Added Diplomat Mod
2. Added the Cyber Terrorist unit
3. Added National Wonder - Information Protection Center
4. Added National Wonder - Cyber Terrorism Center
5. Coal is now a prerequisite for 5 Ships instead of oil:
Ironclad Frigate
Ironclad Battleship
Early Destroyer
Early Cruiser
PreDreadnought
6. Lots of Python changes and tweaks.
7. Working on Missions for Cyber Terrorist
8. Working on getting the AI to use the Icebreaker unit.
def AI_unitUpdate(self,argsList):
pUnit = argsList[0]
### BREAK ICE AI - START - 16/10/11 - ARIAN
pUnitType = pUnit.getUnitType()
pIceBreaker = gc.getInfoTypeForString("UNIT_ICEBREAKER")
iUnitOwner = pUnit.getOwner()
pPlayer = gc.getPlayer(iUnitOwner)
# unit must be icebreaker
if pUnitType == pIceBreaker:
iX = pUnit.getX( )
iY = pUnit.getY( )
pPlot = CyMap( ).plot(iX, iY)
iPlotOwner = pPlot.getOwner()
# plot must be owned by player or by nobody
if iPlotOwner == iUnitOwner or iPlotOwner == -1:
# plot must have ice
iFeatureIce = gc.getInfoTypeForString("FEATURE_ICE")
if pPlot.getFeatureType() == iFeatureIce:
# check if ice can be removed
iBreakIce = gc.getInfoTypeForString("BUILD_BREAK_ICE")
if pUnit.canBuild(pUnit.plot(), iBreakIce, false) == true:
# break the ice ??
pUnit.getGroup().pushMission(MissionTypes.MISSION_BUILD, iX, iY, 0, False, False, MissionAITypes.MISSIONAI_BUILD, pUnit.plot(), pUnit)
return true
else:
# check adjacent plot
for iXLoop in range(iX - 1, iX + 1, 1):
for iYLoop in range(iY - 1, iY + 1, 1):
checkPlot = CyMap().plot(iXLoop, iYLoop)
icheckPlotOwner = checkPlot.getOwner()
# check if plot is owned by player or plot not owned by anybody and plot has ice
if (iPlotOwner == iUnitOwner or iPlotOwner == -1) and checkPlot.getFeatureType() == iFeatureIce:
pUnit.getGroup().pushMission(MissionTypes.MISSION_MOVE_TO, iXLoop, iYLoop, 0, False, False, MissionAITypes.NO_MISSIONAI, pUnit.plot(), pUnit)
return true
### BREAK ICE AI - END - 16/10/11 - ARIAN
return false
Here's a piece of code that checks for ice on tiles adjacent to the icebreaker. If there's ice and plot is owned or plot is nobody's then move to that plot. Next turn the icebreaker should start breaking the ice until done and then start all over again.
Spoiler :
PHP:def AI_unitUpdate(self,argsList): pUnit = argsList[0] ### BREAK ICE AI - START - 16/10/11 - ARIAN pUnitType = pUnit.getUnitType() pIceBreaker = gc.getInfoTypeForString("UNIT_ICEBREAKER") iUnitOwner = pUnit.getOwner() pPlayer = gc.getPlayer(iUnitOwner) # unit must be icebreaker if pUnitType == pIceBreaker: iX = pUnit.getX( ) iY = pUnit.getY( ) pPlot = CyMap( ).plot(iX, iY) iPlotOwner = pPlot.getOwner() # plot must be owned by player or by nobody if iPlotOwner == iUnitOwner or iPlotOwner == -1: # plot must have ice iFeatureIce = gc.getInfoTypeForString("FEATURE_ICE") if pPlot.getFeatureType() == iFeatureIce: # check if ice can be removed iBreakIce = gc.getInfoTypeForString("BUILD_BREAK_ICE") if pUnit.canBuild(pUnit.plot(), iBreakIce, false) == true: # break the ice ?? pUnit.getGroup().pushMission(MissionTypes.MISSION_BUILD, iX, iY, 0, False, False, MissionAITypes.MISSIONAI_BUILD, pUnit.plot(), pUnit) return true else: # check adjacent plot for iXLoop in range(iX - 1, iX + 1, 1): for iYLoop in range(iY - 1, iY + 1, 1): checkPlot = CyMap().plot(iXLoop, iYLoop) icheckPlotOwner = checkPlot.getOwner() # check if plot is owned by player or plot not owned by anybody and plot has ice if (iPlotOwner == iUnitOwner or iPlotOwner == -1) and checkPlot.getFeatureType() == iFeatureIce: pUnit.getGroup().pushMission(MissionTypes.MISSION_MOVE_TO, iXLoop, iYLoop, 0, False, False, MissionAITypes.NO_MISSIONAI, pUnit.plot(), pUnit) return true ### BREAK ICE AI - END - 16/10/11 - ARIAN return false
Notes:
1. Workboats are no longer able to break ice.
2. Create a seperate ice breaker unit.
3. Make sure icebreakers become available with COMBUSTION.
4. No messing with workboat AI, preventing possible issues.
5. Make sure the AI builds at least one icebreaker.
Code has probably some issues as I didn't test it. What do you think?