Python / C++

Olleus

Deity
Joined
Oct 30, 2005
Messages
6,478
Location
Beyond the Veil
This is a list of Everything that needs to be programed into the game for our mod. I have decided to restart everything from scratch as the previous code I had written is rather poor. Rather than coppying everything I have already done I have decided to start a new list of what needs to be done.

If you have something which you want done in either python or C++ post it here, and I will update the 'To-do list' below. Please only post below if you are absolutely sure that this should be included in the game, and also add as much detail as possible.

This is not a thread to discuss ideas, but a place to make them reality.
 
To do list

  • Add XML taggs allowing buildings to speed up specific UNITCOMBATs [on hold]

  • Add magic spell system [ 70% complete ]

  • Add magic item system [need more info on what this should do]

  • Add psychology (see thread entitled 'Panic!') [not started]

  • Change golden ages for chaos so that it gets +20% strengh to all units and is more aggressive [not started]

  • Give Orcs & Goblins peaceweariness [not started]

  • Add code for spawning Characters/Heroes. [not started]

  • Add 'support fire' for archers. [DONE - Thanks Gerikes]

  • Add civ specific improvements. [not started]

  • Limit wonder production to certain groups of civ. [not started]
 
I request the thing I did before in the old thread:

make it possible for buildings to give production bonuses to different UnitCombatTypes rather than only the Domains.

Coukld be used for Siegeworkshop, a new Archeryrange, Stables etc. etc.
 
Alright, here is the link to the merged mods Ploep asked me to do this morning for the WH mod: http://www.aracnet.com/~opus/Civiv/WarhammerMod.zip

It contains the:
- Merc Mod
- Great General Amped Mod
- Flying Mod
- Enhanced Tech Conquest
-Animals on Water mod
- Pirates Mod and
- Unique Babarian Mod
 
Thx Lopez.

@Olleus
You just need to merge those files refering to python and C++ with your scripts for the mod and send me the files afterwards.
I will wait for the others to finish their xml and copy and paste the refering xmllines in then.(and maybe work on the textfiles).
Puh that'll be much work. But better concentrate that last step before release than scatter those files again. That means though I need the python and SDK stuff you've done so far(and merged with these) by next Friday otherwise it won't get into the next release. I want to try to upload a running version after the weekend and the playtesting bughunt can begin:)
 
I have only just started redoing all of the python so merging it with Lopez's code should be easy. I will do everything I can to meet the deadline, and will tell you in advance if I can't.
 
Lord Olleus said:
I have only just started redoing all of the python so merging it with Lopez's code should be easy. I will do everything I can to meet the deadline, and will tell you in advance if I can't.
Good. If your work involves any xml you can use the vanilla files like lopez and mark the changed entries for me.

So just hope to get response from seZ and Agent about the unitstuff soon! the rest seems to be going good so far:)
 
I have started on point 2 as it seems that it is the most important. Lopez, you can start on point 1 if you have the time.
 
I was thinking about JPs old concept of upgradeable citizenworkers and indeed I think this will be quite a good option for most of the more civilized races.
I'm planning to use JPs techtree of the reduxe as a base to work on. Workers will autoupgrade to citizen workers with the tech civil service.
We need an SDK tweak that will prevent the AI from upgrading all available citizenworkers to military units afterwards otherwise it won't have workers available. Can you put that on the list? Maybe ask Kael about that for hints. He had a similar problem with his apprentices in FFH1. Or maybe you know an easy workaround?
For the less civilized races like orcs we will include bridge techs to get around this feature if necessary and making advanced units for them available. (instead of civil service they get slavery in example)

Edit: Keal mentioned it would be possibly maybe to put a control in place so that the AI would only be able to upgrade in emergencies.


Edit 2: post 27-30 of theLopez' thread contains the details for the traits: Friendsofthewood, Barbarian_Raiders and scorched earth(this one is for chaosspawn barbarians, the old chaospawn idea should be implemented too but this has time-you can put it on the list as last). For the trait Hidden sadly we'll have to wait until it's done in FFH.
 
The way to do this seems to be to be to add a new UNIT_AI. This should be easy. Make it behave like a normal worker, but have it upgrade if an enemy unit is within 2 or 3 squares.
 
This is all of the code so far.

It includes all of TheLopez's code as well as an early version of the spell system. The spell system works like this.

A unit can cast 1 spell per UNITCOMBAT_SPELL_BOOK it carries. If it carries 3 books it can cast 3 different spells.

When a spell is cast CvSpellsInterface.onCastSpell() (in python/entrypoints) is run. Instructions on how to modify that file are included. The only XML changes I have made are in Units/MissionInfo.xml, feel free to change anything there apart from the order of the missions and their name. And in XML/BasicInfo/CvBasicInfo.xml. You can change the name of UNITCOMBAT_SPELL_BOOK, but whatever unitcombat spell books have, it MUST be at the top of the list.

My todo list
- Add a way for the player to choose a square for certain spells
- Remove all hard coded limits by XML attributes.


http://www.civfanatics.net/uploads12/New_Warhammer1.zip
 
Lord Olleus said:
My todo list
- Add a way for the player to choose a square for certain spells
You could always just use the sniping ability from the sniper mod and change the name of the unit combat from UNITCOMBAT_SNIPER to UNITCOMBAT_CASTER.
 
Something like that I had in mind when I suggested to implement this. I just didn't think we'll need it that fast.:D Good job guys! Seems P.L.s magic thread will be soon in focus and I should make a couple of magicbook units.

@Olleus
About the castbutton. Take just any button for it now. I'll find a proper one. I just need to now how it should be named and where to put it in.

Btw Lopez the ordinary snipermod could be useful too. The empire could have sniperunits called Hochland Jaegers(ok but that' just for one unit nobody made yet)
 
TheLopez said:
You could always just use the sniping ability from the sniper mod and change the name of the unit combat from UNITCOMBAT_SNIPER to UNITCOMBAT_CASTER.


But does it have a range of bigger than 1 and does the AI understand it?
 
Lord Olleus said:
This is all of the code so far.

It includes all of TheLopez's code as well as an early version of the spell system. The spell system works like this.

A unit can cast 1 spell per UNITCOMBAT_SPELL_BOOK it carries. If it carries 3 books it can cast 3 different spells.

When a spell is cast CvSpellsInterface.onCastSpell() (in python/entrypoints) is run. Instructions on how to modify that file are included. The only XML changes I have made are in Units/MissionInfo.xml, feel free to change anything there apart from the order of the missions and their name. And in XML/BasicInfo/CvBasicInfo.xml. You can change the name of UNITCOMBAT_SPELL_BOOK, but whatever unitcombat spell books have, it MUST be at the top of the list.

My todo list
- Add a way for the player to choose a square for certain spells
- Remove all hard coded limits by XML attributes.


http://www.civfanatics.net/uploads12/New_Warhammer1.zip


LO, there is a bug in the fire method in the MercenaryUtils.py file. Here is what the method should look like (I have bolded the changes):
Code:
	# Tells the mercenary that the player no longer needs their services and performs the 
	# necessary operations to remove the mercenary from the game and make them available to
	# other players
	def fire(self):
		if(self.objUnit == None):
			CvUtil.pyPrint("We should never reach this point, why did the player have access to this mercenary?")
			return

		# if the mercenary is in a group do not allow the player to fire the mercenary independantly,
		# all for one and one for all, in fact, the mercenary manager should not display the individual
		# mercenaries from groups in the hired mercenary list.
		if(self.objMercenaryGroup != None):
			CvUtil.pyPrint("We should never reach this point, mercenary groups are not implemented!!")
			return

		if(g_bDisplayMercenaryMessages and self.iBuilder != -1 and self.iBuilder != self.iOwner):
			strMessage = self.getName() + " is no longer needed by " + gc.getPlayer(self.iOwner).getName()
			# Inform the player that the mercenary has been fired.
			CyInterface().addMessage(self.iBuilder, True, 20, strMessage, "", 0, "", ColorTypes(0), -1, -1, True, True) 
						
		# Set the mercenaries promotion list before removing the mercenary from the game
		self.promotionList = self.getCurrentPromotionList()
		
		# Set the mercenary's hire cost before removing the mercenary from the game
		self.iHireCost = self.getHireCost()
		
		# Set the mercenary's experience level before removing the mercenary from the game
		self.iExperienceLevel = self.getExperienceLevel()
		
		# Set the mercenary's level before removing the mercenary from the game
		self.iLevel = self.getLevel()
		
		# Set the hired flag to false before removing the mercenary from the game
		self.bHired = false
		
		tmpOwner = self.iOwner
		
		# Set the mercenaries owner to -1 before removing the mercenary from the game
		self.iOwner = -1
		
		# Remove the unit from the game
		[B]self.objUnit.kill(true,PlayerTypes.NO_PLAYER)[/B]
	
		# Make sure that we get rid of the reference to the unit
		self.objUnit = None
 
Lord Olleus said:
But does it have a range of bigger than 1 and does the AI understand it?
Yes, the range is variable and yes, the AI understands how to use the sniper feature. Geez, I thought you played all my mod comps LO.
 
I try, I try, but I don't have the time.
 
Sto:
Ok ... I've added this line into onGameStart() (i don't know if it's the better place) but that 's seem to work without problem :

CyVariableSystem().setValueString('CAMERA_MIN_DISTANCE','400')
Here's a line that should trigger the camera to zoom in closer in game. I also found some values in the detailmanager.xml that seems to affect camera distance.
Wouldn't it be cool to have regiments and detailed models at the same time?:D
 
But doesn't that mean that you can see less of the map? I would rather see my surroundings than the actual models.
 
Top Bottom