Requesting following features

The thing with the XML is that I would not know what to do with it... Do I make a command that I can give to the advanced swordsman etc that doesn't do anything and wait for somebody to hook that up with a SDK/python code? But I will chat with sabiot and see about those animations etc and make a button until specified what I need to do in the XML :D

here is the code you need
 

Attachments

  • Commandeering.zip
    9.2 KB · Views: 37
The thing is that some one person should be in charge of any work done on CvEventManager.py and CvGameUtils.py - otherwise you will have an inevitable mess on your hands. That person could be me or it could be The_J - or you.

With this said, it makes no sense at all to merge my work-in-progress with something that someone else (The_J) is currently working on. Because things will have to be updated and if several people are editing the same files... Its just not practical or very wise.

So I propose you treat these our respective code as separate entities for the time being. Once someone is "done", then I'll be glad to merge everything. (It should only take a few minutes, plus some testing.) But if you feel like taking command of everything done with the Event Manager at this point and going forward then I can merge everything right away and leave all future updating of that module to your capable hands. (Unless The_J feels like being in charge of all Python.)

Just say the word...
 
The j is editing the entry points not event infos btw.... I probs will not need merging... autough I want the file I sent merged in and it also has the carthaginian power inside it which you will need to delete...(should be at the bottom, the 'War Prize mod comp is contained about half way) and that IS completed the only thing that isn't is the civil war and the Forest Contruction

taking in his words though it might be better is we could find some new minds on the civil war feature (which splits the roman empire) if anybody needs the current code to review it I have it...

@baldyr: will you still be dealing with the powers and the forest catapult construction? seeing though you have your dynamic byzantium senario you could have a look at the civil war code and see if you can see anything that could cause my bug...Might be the issue with me not having 3.19 at the time...
 
The j is editing the entry points not event infos btw.... I probs will not need merging... autough I want the file I sent merged in and it also has the carthaginian power inside it which you will need to delete...(should be at the bottom, the 'War Prize mod comp is contained about half way) and that IS completed the only thing that isn't is the civil war and the Forest Contruction
Aha, then I'll do that. You'll have it all merged in together with the Rebels code once I'm done with that. It would be helpful if you could supply a BtS 3.19 game in progress for me to test on. Otherwise I have to build a game in World Builder to test, which is time consuming. And then the cities wouldn't be founded by anyone, which kinda breaks my code. (Since its supposed to look for the original owner of cities.)

taking in his words though it might be better is we could find some new minds on the civil war feature (which splits the roman empire) if anybody needs the current code to review it I have it...
It can be a bit tough to get oriented on something you guys have been beating on for awhile. Just saying...

@baldyr: will you still be dealing with the powers and the forest catapult construction? seeing though you have your dynamic byzantium senario you could have a look at the civil war code and see if you can see anything that could cause my bug...Might be the issue with me not having 3.19 at the time...
I'm working on the powers until you feel that my work is done. The catapult construction might be beyond anything I can achieve (with all the custom unit actions and buttons and whatnot), but if you get the interface side of things taken care of I could check into spawning some catapults. (This would happen once the "work" is done. Somehow.)

Right now I'm working on Rebels.

The dynamic Byzantium is done with a completely different setup and changes the Civilization type of the Celtic player to Byzantium in mid-game. (This also works on a custom DLL.) But since its all Python in the end I might be able to help. What seems to be the problem? (And yeah, test it again with v3.19. :rolleyes:) I already have work on my plate while you test.

Have you been able to test and confirm that my powers code works yet? Because that would be good.
 
I will quickly test gaul (see if I can see it today :lol:) and test the different languages... all others work (I'm not sure about the revolt chance for briton I would not know where it would come up...
 
also do you like my button for the forest construction?
 

Attachments

  • button.zip
    3.3 KB · Views: 37
What I mean is that the powers code needs to be tested. Like in a game. I already "checked" them all, so the code fires. You need to make sure it always fires. Because its really hard to predict every possible event that could take place in a game. This is why play-testing is both important and something you need to do yourself. Take the time. Make the time.

When they develop computer games commercially they hire test players, after all. Otherwise all games would be worse off than all Civ games put together on release. They basically wouldn't work because nobody tested them throughly.

And I don't know how to view .dds files. :dunno:
 
use GIMP (free downloadable software)

anyway I tested the gallic power out and the languages and it all works perfectly!

sometime I will play a half game playthough (I plan to do otherstuff today :D) and will get back to you. In the meantime we need to do the remaining 3 pwers (just so everything is python) and work on the rebels stuff
 
Now that sounds like a plan. :D

I'll get the Rebels in order first. Then add the rest of the powers. Since I'm also doing other stuff you should have ample time for play-testing.
 
etc... I found a thing in the buildinfos.xml

Code:
		<BuildInfo>
			<Type>BUILD_PLANTATION</Type>
			<Description>TXT_KEY_BUILD_PLANTATION</Description>
			<Help/>
			<PrereqTech>TECH_CALENDAR</PrereqTech>
			<iTime>500</iTime>
			<iCost>0</iCost>
			<bKill>0</bKill>
			<ImprovementType>IMPROVEMENT_PLANTATION</ImprovementType>
			<RouteType>NONE</RouteType>
[B]			<EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>[/B]			<FeatureStructs>
				<FeatureStruct>
					<FeatureType>FEATURE_JUNGLE</FeatureType>
					<PrereqTech>TECH_IRON_WORKING</PrereqTech>
					<iTime>400</iTime>
					<iProduction>0</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST</FeatureType>
					<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
					<iTime>300</iTime>
					<iProduction>30</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
			</FeatureStructs>
			<HotKey>KB_P</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>1</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>1</iHotKeyPriority>
			<Button>,Art/Interface/Buttons/Builds/BuildPlantation.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,1,9</Button>
		</BuildInfo>


I guess it is used to say what animation to use for this build... could be useful.... I will look into this futher with the community


as far as I have worked out this defines the command for it and I looked into the improvement infos and found that I will need a improvement that does nothing just to say that it can only be done in a forest.... Is there anyway that python could make it so that you can only activate the build_catapult command on a forest? other wise I will need a improvement info that says that forests make it valid (like lumbermills) and it does not make anything.... :crazyeye: very confusing at the moment...
 
Progress report: I'm done with the code for the Powers (sans Egypt - I'm awaiting a verdict from Asaf before making a whole module out of it) and the Rebels. Next I'll get to merging the code you posted.

edit: I sent you the code, now its up to you to test everything. The commandeering code is included, but I might move that into a CustomFeatures module if we end up doing Python work on the forest catapult thing. The Roman and Germanic powers aren't easy to test however, but I trust that Asaf didn't mess anything up at his end, and at least my code isn't causing any exceptions. The same goes for the Rebels code - I haven't been able to test the feature in actual play environment since the event itself is so rare. This is something you need to look at while play-testing. I added code to the Gallic power, by the way. Now all preset hills cities are also given the defensive bonus.

What's up next? I basically have the code ready for the Egyptians, but it might not be needed anyway. Nothing to worry about in any event.
 
About the Egyptians... Isn't the power really limited to a limited number of map tiles along the Nile river? (edit: I looked it up; its actually only 8 tiles. :eek2:) Should the Egyptians really get extra yields from controlling the Euphrates or Tigris rivers also?

Because it would be easy enough to just add tile yields to those tiles adjacent to the Nile, but that would be permanent then. Any other Civ working those same Nile tiles would get the same bonus, but that really only makes sense.

Maybe add two separate features, then? One where the Nile has extra yields and something else that only affects the Egyptians?

Asaf already did Python methods for changing the terrain type and plot type yields for a given player. What if the Nile yields extra food, while all desert tiles controlled by the Egyptians yield extra production/commerce? Or deserts yield commerce and all land plots yield production. Or whatever combination you'd prefer.
 
(sans Egypt - I'm awaiting a verdict from Asaf before making a whole module out of it)
Do you mean the riverside yield changes? I believe I can add a special method for this.
Any generic way you can think of or do we need to actually do 'setExtraRiverSideYield'?

edit: I sent you the code, now its up to you to test everything. The commandeering code is included, but I might move that into a CustomFeatures module if we end up doing Python work on the forest catapult thing. The Roman and Germanic powers aren't easy to test however, but I trust that Asaf didn't mess anything up at his end, and at least my code isn't causing any exceptions.

The roman maintenance code - I only exposed existing internal methods which are used when civics are changed, so assuming the methods are called and no exceptions are thrown, it should work.

The same goes for the war weariness German power - just exposed a method which was used when civic was changed and wonders were built.

Regarding the 'catapults in forest' - I believe I can add a tag to build infos which instead of creating an improvement will create a unit when the build is over. I think this should be enough for you (j_mie6) to implement this. More updates on this later.

BTW, what's "The commandeering code"?

EDIT: This is what happens when you leave the thread opened for a long time. You don't see the new posts.
Let me know if riverside is still relevant.
 
Do you mean the riverside yield changes? I believe I can add a special method for this.
Any generic way you can think of or do we need to actually do 'setExtraRiverSideYield'?
It depends on what J_mie6 needs. See my previous post.

BTW, what's "The commandeering code"?
Spoiler :
Code:
	def onCombatResult(self, argsList):
		'Combat Result'
		pWinner,pLoser = argsList
		
		playerX = PyPlayer(pWinner.getOwner())
		unitX = PyInfo.UnitInfo(pWinner.getUnitType())
		playerY = PyPlayer(pLoser.getOwner())
		unitY = PyInfo.UnitInfo(pLoser.getUnitType())

## mechaerik War Prize ModComp START##
		pPlayer = gc.getPlayer(pWinner.getOwner())
		if not (gc.getPlayer(pWinner.getOwner()).isBarbarian()):
			if (unitX.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_QUINTRIREME")):
				if (unitY.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_NAVAL")):
					if not (unitY.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_PRIVATEER")):
						if not (unitY.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_PRIVATEER")):
							if CyGame().getSorenRandNum(100, "Bob") <= 30:
								iUnit = pLoser.getUnitType()
								newUnit = pPlayer.initUnit(pLoser.getUnitType(), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
								newUnit.finishMoves()
								newUnit.setDamage(50, pWinner.getOwner())
## War Prize Modcomp END##
 
ok I have looked over this and.... @asaf: using a new xml tag for Unit construction would be great! It would allow me to do alot more of the work...

@baldyr: your nile idea is great, and the egyptians should get a bonus from desert tiles, possibly +1 :food:. The nile should give +1:commerce:, :hammers: and :food:

Baldyr your job at the moment is to make sure everything works... merge in the commandeering, powers and rebels and complete the final power. Once this is done send me everything! (I know you sent one already but I would like it all together! :rolleyes:)

after that we need to think about the civil war stuff....
 
As you might have guessed, I already did most of the code while waiting for your reply. I'll have to finish and test everything, of course. Expect results... soon.
 
I'm reading the instructions like we'll be adding extra tile yields to the Nile tiles only. Then add a Egyptian terrain food yield. So I guess not. :)
 
Regarding the catapult/forest:
1. The AI won't know how to use it properly.
2. I assume it requires both Bronze working and Construction.
3. Do you intend certain units to do so? because adding it to a promotion requires some more infrastructure work (I'm not aware of an existing promotion-build connection).
 
Top Bottom