View Full Version : Snaitf's Great General
Snaitf Dec 03, 2005, 03:08 AM I've seen a few posts asking for a new great person in various threads, so here you go:
It adds a new great person to the game, Great General. He works much like the other great people. He can join a city and become a super specialist, giving +3 gold, and +3 production. He can also build a unique building, one per city, called the Military Academy. It gives new units +3 exp. and +50% military production bonus. And like all the other great people he can help research, but a military based tech, as well as contribute to a golden age.
It also includes a new specialist to help spawn the Great General: the soldier. He gives +2 gold, and +2 production.
Some buildings/wonders have been tweaked to allow the soldier to be used, and to influence the generation of the Great General.
This doesn't remove any units/specialists from the game, just adds in new ones.
To install, unzip and place the root folder in your Mods directory, then launch the game, choose advanced, load a mod, then Snaitf's Great General.
Feel free to alter it however you see fit, and redistribute, post on other sites, combine with your own mods, or whatever...
I welcome all input, the good and the bad. Let me know what you think!
*EDIT* Just fixed a prob, accidently edited Scientist stats too, changed 'em back, re-posted file...
*EDIT* Due to requests, I've changed the bonuses to make this less powerful:
Soldier now gives +1prod/+1gold/+3GPP
Super Specialist now gives +2prod/+2gold
Military Academy now requires a barracks be present in the city
Re-posting...
Honor Dec 03, 2005, 05:20 AM Thanks for this mod, I'm sure the community will make use of this :)
The bonus (+3 gold AND +3 prod) sounds a tad too much in my opinion, though.
Zuul Dec 03, 2005, 05:22 AM Maybe +2 gold, +2 production and +1 exp (for all units created in this city). And +2 exp for Military Academy.
HourlyDaily Dec 03, 2005, 05:39 AM Well done for your work. I will try tweaking this around to suit my own games.
Congratulations on solving the UI problem.
White Elk Dec 03, 2005, 06:08 AM Very cool Snaitf!!
How about changing the name of the new specialist from Soldier to something like Sergeant Major, Drill Instructer, Drill Sergeant, etc.
The bonuses seem a bit high to me. Perhaps just a production bonus might balance better? But I think it'd be even better if the bonuses were exp based like Zuul suggested. Something low like +1exp for City Specialists and +2exp for Super Specialists. As well as a small increase towards Military Production. In this way the bonus only effects units rather than all city production.
CyberChrist Dec 03, 2005, 06:19 AM Unless you also boosted the other specialists (incl. supers) then this is too powerfull.
Regular Engineer (2 hammers)
vs
Your regular General (2 hammers AND 2 gold)
Super Engineer (3 hammers)
vs
Your super General (3 hammers AND 3 gold)
Do you see the problem? :)
EDIT: oops, I must have been tired when I posted this, since I forgot about the +3 science bonus of Great Engineers :blush:
Colonel Kraken Dec 03, 2005, 08:30 AM Wow! Great work, Snaitf.
Mylon Dec 03, 2005, 08:31 AM I like the idea here. I may adopt this for my own mod in some form or another. Soldiers could be +1 hammer, +1 exp, great generals +2 hammers, +2 exp. I'm already using the name "Military Academy" for a building, so I'd need to rename that.
korn469 Dec 03, 2005, 08:56 AM Snaitf
I have a couple of questions for you. First, is it possible for soldiers to produce 1 hammer for building settlers, workers, buildings or wonders, and 3 or 4 hammers for building military units? Does the python exist to do that? Also can a great general super specialist grant +1 experience in addition to hammers, gold, and culture? My final question is it possible for great generals to transform into a number of military units instead of a building. For example, you hit create army which makes the great general disappear, but ten units appear in its place. I'd love to find out the answer to those questions. Also great work on the mod! I'm going to download it and try it out soon.
Zurai Dec 03, 2005, 11:56 AM I don't think you can make specialists add experience to units.
JohnSearle Dec 03, 2005, 12:46 PM I don't think you can make specialists add experience to units.
Not sure it's a great idea anyway... If I was looking to exploit something like that I would turn the specialists on whenever I was about to produce a unit for the xp bonus... Then just switch back to something more useful. Making it a part of a super specialist is the only easy solution to remedy such a problem (if thats even possible).
korn469 Dec 03, 2005, 02:02 PM yeah only the super specialist should give any experience
Snaitf Dec 03, 2005, 02:17 PM lots of good ideas here: as far as specialists granting exp, that would have to be done with py editing instead of just xml editing and could be exploited. If I do that, it would only be the super specialist. Having the general give new units would be difficult as well, would have to write new py script, not just alter what's already there. I don't think it's really all that powerful, great prophet super specialist gives +5 gold and +2 prod, so +3/+3 isn't really unbalanced there, as far as the soldier the engineer gives +2 prod AND +3 great people rate, soldier gives +2 prod and +2 gold. You just need to decide, you want more gold, or great people? Barracks gives +4 exp, military academy gives +3 exp and bonus to military production in that one city, but there is a wonder that gives same bonus to military production to every city. I actually think it's pretty well balanced. But what does everyone think? If more people start saying it's unbalanced I guess I'll tune it down a bit. Let me know, and feel free to change it if you like...
Also I just noticed that I accidently changed the stats for the Scientist too, just changed 'em back, re-posting...
Artanis Dec 03, 2005, 02:35 PM lots of good ideas here: as far as specialists granting exp, that would have to be done with py editing instead of just xml editing and could be exploited. If I do that, it would only be the super specialist. Having the general give new units would be difficult as well, would have to write new py script, not just alter what's already there. I don't think it's really all that powerful, great prophet super specialist gives +5 gold and +2 prod, so +3/+3 isn't really unbalanced there, as far as the soldier the engineer gives +2 prod AND +3 great people rate, soldier gives +2 prod and +2 gold. You just need to decide, you want more gold, or great people? Barracks gives +4 exp, military academy gives +3 exp and bonus to military production in that one city, but there is a wonder that gives same bonus to military production to every city. I actually think it's pretty well balanced. But what does everyone think? If more people start saying it's unbalanced I guess I'll tune it down a bit. Let me know, and feel free to change it if you like...
Also I just noticed that I accidently changed the stats for the Scientist too, just changed 'em back, re-posting...
Uh...how are you going to get Great Generals without anything providing Great General points? :confused:
Zurai Dec 03, 2005, 02:49 PM Uh...how are you going to get Great Generals without anything providing Great General points? :confused:
It also includes a new specialist to help spawn the Great General: the soldier. He gives +2 gold, and +2 production.
Some buildings/wonders have been tweaked to allow the soldier to be used, and to influence the generation of the Great General.
Your question was already answered before you asked it.
Artanis Dec 03, 2005, 02:56 PM Your question was already answered before you asked it.
as far as the soldier the engineer gives +2 prod AND +3 great people rate, soldier gives +2 prod and +2 gold. You just need to decide, you want more gold, or great people?
He says right there that the Soldier doesn't give GPP.
Snaitf Dec 04, 2005, 12:59 AM *EDIT* Nevermind, I was speaking nonsense...
Aussie_Lurker Dec 04, 2005, 01:25 AM Hiya Snaitf. First up, fantastic work overall. Just a few quick questions though:
a) Is there any way of making the 'Super Specialist' grant a bonus to building units only-rather than a general production bonus?
b) Instead of having the super specialist grant gold, could he instead grant +3 XP to all units built in that city?
c) As with the 'Super Specialist', is there any way to make Soldier specialists grant a production bonus to the construction of units and military buildings only?
Anyway, keep up the fantastic work-I didn't think it would be long before someone would bring us this ;)!
Yours,
Aussie_Lurker.
Snaitf Dec 04, 2005, 01:34 AM Hiya Snaitf. First up, fantastic work overall. Just a few quick questions though:
a) Is there any way of making the 'Super Specialist' grant a bonus to building units only-rather than a general production bonus?
b) Instead of having the super specialist grant gold, could he instead grant +3 XP to all units built in that city?
c) As with the 'Super Specialist', is there any way to make Soldier specialists grant a production bonus to the construction of units and military buildings only?
Anyway, keep up the fantastic work-I didn't think it would be long before someone would bring us this ;)!
Yours,
Aussie_Lurker.
Those are definately good ideas, ones I would like to have implemented from the begining, but unfortunatley would be a lot of work, if it's even possible without the SDK. Specialists have predefined what-they-can-give bonuses in the XML, and only granting military production, or giving exp isn't one of them so I would have to write new PY scripts for it, and I'm not that talented or industrious.
If I'm wrong and someone knows of a way easier than I am thinking, point me in the right direction and I'll try to hammer it out...
Snaitf Dec 04, 2005, 04:54 AM Ok, I changed the bonuses due to many requests, read 1st post for changes, re-posted...
LittleRedPoint Dec 04, 2005, 06:51 AM I want to make slave unit who you can draft if you have slavery. I want to add him options:
- sacrifice +30 culture
- hurry building +30 production
- join city 2 or 3 hammers & +1 unhapiness
- build slave market 1 unhapiness, 25% production, 1 unhealthiness (one per city) gets obsoleted with emancipation
LittleRedPoint Dec 04, 2005, 06:52 AM Ok, I changed the bonuses due to many requests, read 1st post for changes, re-posted...
Snaitf can you post guide how you mod phyton CvMainInterface.py ?
I want to make slave unit who you can draft if you have slavery. I want to add him options:
- sacrifice +30 culture
- hurry building +30 production
- join city 2 or 3 hammers & +1 unhapiness (phyton info is need for this)
- build slave market 1 unhapiness, 25% production, 1 unhealthiness (one per city) gets obsoleted with emancipation
hIdDeN_eViL Dec 04, 2005, 07:07 AM great work.. just some questions.
most importantly... DOES THE AI UNDERSTAND THE CONECPT?!
secondly. you mentioned that buildings are rebalanced. could you post an updated civlopedia to reflect changes (inlcuding adding info about the great general). that would be great
great mod!
Snaitf Dec 04, 2005, 08:39 AM Snaitf can you post guide how you mod phyton CvMainInterface.py ?
I want to make slave unit who you can draft if you have slavery. I want to add him options:
- sacrifice +30 culture
- hurry building +30 production
- join city 2 or 3 hammers & +1 unhapiness (phyton info is need for this)
- build slave market 1 unhapiness, 25% production, 1 unhealthiness (one per city) gets obsoleted with emancipation
I'm no guide writer, but if you download my mod and look at the files, ALL the changes are within comment blocks either:
<!-- Start Modification Block -->
for the XML files
or
## Start Modification Block ##
for the PY file
Snaitf Dec 04, 2005, 08:43 AM great work.. just some questions.
most importantly... DOES THE AI UNDERSTAND THE CONECPT?!
secondly. you mentioned that buildings are rebalanced. could you post an updated civlopedia to reflect changes (inlcuding adding info about the great general). that would be great
great mod!
I'm pretty sure the AI understands it, I think the AI picks the specialist that would benefit them most at the time, this makes another one available. And since I have seen the AI using Great Generals while play-testing, me-thinks it's ok...
As far as the civlopedia, it's at the very bottom of my to-do list since you can get all the info you need by mouse-overing the buttons. and the stats that display in the pedia are drawn from the game, not hard coded, it's mostly there, just not the verbose paragraph descriptions...
hIdDeN_eViL Dec 04, 2005, 08:46 AM I'm pretty sure the AI understands it, I think the AI picks the specialist that would benefit them most at the time, this makes another one available. And since I have seen the AI using Great Generals while play-testing, me-thinks it's ok...
As far as the civlopedia, it's at the very bottom of my to-do list since you can get all the info you need by mouse-overing the buttons. and the stats that display in the pedia are drawn from the game, not hard coded, it's mostly there, just not the verbose paragraph descriptions...
righteo . thats cool. this mods goin into my customassets. thx
White Elk Dec 04, 2005, 09:41 AM ...as far as specialists granting exp, that would have to be done with py editing instead of just xml editing and could be exploited. If I do that, it would only be the super specialist.I see the unbalance now. Theres nothing to prevent a player from assigning a ton of Soldier Specialists and cranking out mega-elite units. I agree that limiting the exp bonus to the Super Specialist is best.
Keep up the good works Snaitf
DeathCyclops Dec 04, 2005, 10:01 AM I'm pretty sure the AI understands it, I think the AI picks the specialist that would benefit them most at the time, this makes another one available. And since I have seen the AI using Great Generals while play-testing, me-thinks it's ok...
As far as the civlopedia, it's at the very bottom of my to-do list since you can get all the info you need by mouse-overing the buttons. and the stats that display in the pedia are drawn from the game, not hard coded, it's mostly there, just not the verbose paragraph descriptions...
So, does that mean when you have an automated city, it can/will(when it thinks its necessary) select soldier as a specialist?
White Elk Dec 04, 2005, 10:06 AM I think it would if the automation was set to maximize production ~ because of the production bonus.
JohnSearle Dec 06, 2005, 12:15 AM Just finished playing a few hours with your mod... and I must say, great work!
Aussie_Lurker Dec 06, 2005, 12:19 AM Thats why it would work soooo much better if it simply reduced the time of unit builds-as it should!!! Shame that it does not seem possible yet!
Yours,
Aussie_Lurker.
Stuporstar Dec 06, 2005, 01:37 AM There is something I would love to add to the soldier specialist, but haven't yet been able figure out how. I want each soldier to give a %defence bonus to the city, say 5% per soldier. Maybe to balance this out I'd take away the commerce bonus and just have them give 1 hammer + 5% defence.
I think this idea would be great for realism, as it would represent your citizens taking up arms in defense of their own city in an emergency. The downside being, over a long siege if you had to keep it up, the enemy could potentially starve out cities. I wonder if the AI would use it though.
Also, I'd love to figure out how to make the great generals give a temporary promotion to every unit in a stack. I've been looking at Bhruic's Realfort mod (http://forums.civfanatics.com/showthread.php?t=140957) to see how he created a python script that allows the fort to give a bonus to units only while the unit is sitting in the fort, or attacking from it. I'm not too familiar with python yet though and am not having much luck.
Snaitf Dec 06, 2005, 01:49 AM Just finished playing a few hours with your mod... and I must say, great work!
THANKS! :D
There is something I would love to add to the soldier specialist, but haven't yet been able figure out how. I want each soldier to give a %defence bonus to the city, say 5% per soldier. Maybe to balance this out I'd take away the commerce bonus and just have them give 1 hammer + 5% defence.
I think this idea would be great for realism, as it would represent your citizens taking up arms in defense of their own city in an emergency. The downside being, over a long siege if you had to keep it up, the enemy could potentially starve out cities. I wonder if the AI would use it though.
Also, I'd love to figure out how to make the great generals give a temporary promotion to every unit in a stack. I've been looking at Bhruic's Realfort mod (http://forums.civfanatics.com/showthread.php?t=140957) to see how he created a python script that allows the fort to give a bonus to units only while the unit is sitting in the fort, or attacking from it. I'm not too familiar with python yet though and am not having much luck.
I unfortunately haven't been able to figure these out either :confused: Guess we'll just have t wait for the SDK :sad:
dh_epic Dec 06, 2005, 09:54 PM As another suggestion to give the great general its own flavor...
... perhaps the super specialist should add +20% defence to a city, like walls, or culture?
MeteorPunch Dec 06, 2005, 10:20 PM Now if he could just form an army we'd be set. :)
Stuporstar Dec 06, 2005, 10:31 PM As another suggestion to give the great general its own flavor...
... perhaps the super specialist should add +20% defence to a city, like walls, or culture?
If I can figure out how to add the 5% defense bonus to a soldier, I'll definitely add a larger percent bonus to the super specialist. I'm not sure what would be a good balance though, anywhere from 10%-25%. What do other people think about this?
Aussie_Lurker Dec 06, 2005, 10:45 PM Nah, in my opinion, MeteorPunch, Armies truly sucked @$$-even if the AI made use of them, they still would have sucked @$$. IMO, having an MGL produce a Military Academy, or getting you a military technology or granting you a bonus to unit XP and unit build times are far better abilities to possess-it merely remains to be seen if it can be done.
Perhaps a python script saying something along the lines of
'if Specialist=<Soldier>; unittypeA, unittypeB.... build rate=Y*0.9' Not truly knowing the python code, though, I am not sure how it would really read.
Yours,
Aussie_Lurker.
Stuporstar Dec 07, 2005, 06:31 PM I unfortunately haven't been able to figure these out either :confused: Guess we'll just have t wait for the SDK :sad:
I think it's entirely possible to do using XML and Python and I'm determined to figure out how. The defense bonus for soldier specialists *should* be the easiest, since the same bonus already exists for buildings. I just have to figure out where in the XML schema I need to add the element <idefensebonus> (or whatever the tag it was), and then figure out how to get the python to recognize it. I'm not sure if I can get the python script for the defense bonus tag to cross over from one XML shema to another, or if I need to redirect it or just copy it into the python script that reads the particular schema I need. I'm still just learning python so it's probably going to take me a while to figure this all out.
As for the unit stack promotions for a Great General in the field, I'm sure I can convert Bhruic's absolutely brilliant fort mod to be able to do this...once I figure out how he did it. :crazyeye:
KaNeaGE Dec 08, 2005, 01:34 PM Hi im new to the boards and this Great General idea really caught my eye. I have a few ideas to throw out there that may or may not be good.
1. Why do soldiers and great generals give +gold bonus? If anything they should take away money. I like the idea of giving +1 XP to units but i also see how it can be misused. one way i can see to fix this is to simply take away all other bonuses, meaning no +gold or +prod. if people want to mass the soldiers they would then have to cut their military production. That still leaves the problem of nearly completing a unit then making soldiers however. Maybe let barrack have a soldier allowance of 2, castle of 1. i would also think about giving a +culture to encourage getting soldiers after a take over.
2. I like the military academy but isnt the academy something unique to the G scientist. A few other ideas i have are
a. +4-5 XP all across the board to every unit you control
b. Create 1 free unit the "Draft" command would create for each barracks you control. or a set ammount of units (5?)that start with 10XP
c. Military Reform: upg 2 units in each city free of charge, or cut
upg cost by 1/2 for X turns
3. The super specialist isnt bad as it is but my previous Q about +gold still appliies. maybe let the specialist give something like +2hammer +2XP +6culture. Its not stepping on any of the other super specialists toes and it gives him a flavor of his own, and hes not bad either.
4. I think barracks should give +1GPP for the general up until Gunpowder or Nationalism. reasoning is the definition of a great general changed with the invention of the firearm. warfare became based on better teamwork than individual effort so soldiers had less opportunity to stand out. there most definatly are exceptions (Napoleon first to come to mind) but generally this happened. I also think Castle, Heroic Epic, National Epic(maybe?), Scotland Yard, Westpoint, and Pentagon should give +GPP
Unfortunatly i have no XML or Python skills so i dont know if this stuff can be done but i thought id at least share it. :)
The Great Apple Dec 08, 2005, 07:27 PM Also, I'd love to figure out how to make the great generals give a temporary promotion to every unit in a stack. I've been looking at Bhruic's Realfort mod to see how he created a python script that allows the fort to give a bonus to units only while the unit is sitting in the fort, or attacking from it. I'm not too familiar with python yet though and am not having much luck.
I unfortunately haven't been able to figure these out either :confused: Guess we'll just have t wait for the SDK :sad:
This shouldn't be too hard to do should it?
I'm going to go have a go! (Although the AI won't be able to handle it, that much I can tell you already)
I won't be able to test it myself (not at home), but I can post up the code, and one of you guys can do it for me!
EDIT: Ok! Done!
The way I've done it is quite crude, but it was the simplest and most effecive I could think of at this time of night. It SHOULD all work. I read it through 3 times for errors.
Basically, if you shove this into the same folder as the main mod, it will give a "General" promotion to any unit on the same square as the general. Default for the promotion gives +25% combat, and uses the Combat I icon.
If you like, I can make a similar script to add a small amount to units around the general.
Optimizer Dec 08, 2005, 09:35 PM Let's call this specialist guy "Officer" and the great person "Great Officer". That would be more neutral.
How many Officers/Soldiers/Drill Sergeants are allowed per city? Do Barracks, Castles and such buildings provide slots?
Snaitf Dec 08, 2005, 11:50 PM This shouldn't be too hard to do should it?
I'm going to go have a go! (Although the AI won't be able to handle it, that much I can tell you already)
I won't be able to test it myself (not at home), but I can post up the code, and one of you guys can do it for me!
EDIT: Ok! Done!
The way I've done it is quite crude, but it was the simplest and most effecive I could think of at this time of night. It SHOULD all work. I read it through 3 times for errors.
Basically, if you shove this into the same folder as the main mod, it will give a "General" promotion to any unit on the same square as the general. Default for the promotion gives +25% combat, and uses the Combat I icon.
If you like, I can make a similar script to add a small amount to units around the general.
never really thought of doing it that way, every time a unit moves, check to see if there is a GG in the stack, if so give a promotion, if not, take it away... seems so simple now... :suicide:
Impaler[WrG] Dec 09, 2005, 09:36 AM I have an idea concerning "Officers" (thats the name I prefer). As others have mentioned it would be very cool yet very easily exploited if each Officer in a City gave experience to units produced in that City much like a barraks. People would just crank out the max officers the turn the unit is being completed and remove them all a turn later.
An alternative solution is to have Officers add experience very slowly to units after they are built. I think a base rate of about 1/20 a point per turn would be a good start, as the player adds more advanced training facilites the rate of XP gain incresses. Now I dont belive it is possible to actualy give less then 1 experience because experience is stored as an Integer so instead we should simply left shift the decimal point of all the games current experience bonuses and levels by 2. So Barracks would give 400 experience rather then 4, the first promotion would be at 200 rather then 2 ect ect. Everything would remain functionaly identical but with the equivilent of 2 extra decimal places.
Experience would be handed out each turn by a simple python script firing at the end of turn, each city is checked for officers and the bonusus that affect officers. Then any units that are in the city get their exp incressed.
One other note I think the bonus that the Great General provides should be called "Leader ship" and we should find some Graphics people to make a nice Icon for it perhaps a picture of some Medals or a guy saluting. I would apply the bonus equaly to all units in the Generals plot or adjacent to it.
The Great Apple Dec 10, 2005, 10:05 AM I've just realised I botched up the "General Promotion" in the addon I posted. I accidently made it so any unit could get it if they leveled up... I've updated the attachment.
Exel Dec 11, 2005, 03:36 AM Is it possible to have the soldier specialists increase the hammer output for military units only? Some civ traits do this, like Organized increases +50% production for Lighthouse and Courthouse.
One Officer specialist could for example increase the production of military units by 10%, while a General super specialist would increase the production by 50%.
Aussie_Lurker Dec 11, 2005, 04:05 AM Not directly, Exel, but we hope-and pray-that there might be a workaround using Python Scripting.
Yours,
Aussie_Lurker.
hIdDeN_eViL Dec 11, 2005, 05:20 AM @ the great apple
i think a bonus for a nine square area is better, as a general is expected to command overall strategy. maybe, 25% for units in the stack, and 10% for those around.
i see a prob with this bit of mod... AI will definately not understand how to use the general to boost combat =(
CyberChrist Dec 11, 2005, 06:40 AM Hmm, if the AI could be made to make use of the same strategies it applies to units with the Medic promotion then maybe it would make a General unit follow other units around also.
hIdDeN_eViL Dec 11, 2005, 08:30 AM i would definately implement the addon, if AI could use it, but lacking that, i'll stick with snaitf's original.
Dusty4prez Dec 11, 2005, 09:17 PM ummm is there anyway to combine some o these mods together for use?
Quantum7 Dec 12, 2005, 02:17 AM The idea of a great general really makes sense.
However, some remarks:
- What he can do sounds pretty decent already, I'm missing his effect on troops though. A general should probably have a minor effect on every unit within 1 square adjacent of his unit. This would simulate perfectly that a general 'commands' an army. Possibly: One extra promotion while a unit is in range of a general.
- I'd rather see a great general unit without any specialists. It doesn't seem to make much sense that you'd create them by using specialists.
- A more logical way would be the Civ III way in which only units with a certain amount of experience would give a chance to generate them. Possibly only after you've built the Heroic Epic.
Draax Dec 12, 2005, 04:51 PM Does the AI build military academies? I played with this mod and I love the idea, but I conquered France and none of the cities had a MA. And I know Napoleon had a few GGs.
Has anyone else conquered a city and found a MA in it? If not I think I'm going to drop the mod since it's such a hugely powerful building.
Aussie_Lurker Dec 12, 2005, 11:09 PM Hey Snaitf. I am trying to repay the favour of all the help you have given me, and came up with this possibility for making Great Generals do what they ought to do. Perhaps you have already tried it but, otherwise, it might be worth a shot:
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
player = gc.getActivePlayer()
if (player.isSpecialist(gc.getInfoTypeForString("SPECIALIST_GREAT_GENERAL "))):
for i in range(player.getNumCities()):
player.getCity(i).getFreeExperience(2)
else:
for i in range(player.getNumCities()):
player.getCity(i).getFreeExperience(0)
What do you think, could this work?
Yours,
Aussie_Lurker.
Aussie_Lurker Dec 12, 2005, 11:16 PM While I am at it, it may be worth looking at THIS string for Python:
getMilitaryProductionModifier()
and this
getDefenseModifier()
or maybe even this? getCityDefensePercent()
Hope this helps.
Mylon Dec 12, 2005, 11:36 PM I think you mean:
## in onUnitBuilt ##
if gc.getUnitInfo(iUnit).getSpecialUnitType == -1: #Make sure this unit can use exp
GeneralExperience = pCity.getSpecialistCount(gc.getInfoTypeForString("SPECIALIST_GREAT_GENERAL"))
gc.getUnitInfo(iUnit).changeExperience(GeneralExpe rience, 100) #The second number might work with -1 instead. I don't feel like testing this.
Aussie_Lurker Dec 13, 2005, 12:13 AM Ahhh, yes, I see what you are getting at Mylon. My script is looking at the start of the turn wheras-as you rightly point out, it should be looking at when a unit is built. I don't see much wrong with my script beyond this. Either way, its the final string which I feel is important-the one which may, or may not, cause these specialists to add experience to units. I am considering testing both tonight-just to give me a break from my 'Slave Market' headaches ;)! I will report back later on!
Yours,
Aussie_Lurker.
Snaitf Dec 13, 2005, 02:09 AM Does the AI build military academies? I played with this mod and I love the idea, but I conquered France and none of the cities had a MA. And I know Napoleon had a few GGs.
Has anyone else conquered a city and found a MA in it? If not I think I'm going to drop the mod since it's such a hugely powerful building.
Almost all buildings are destroyed when you take over a city...
Aussie_Lurker Dec 13, 2005, 06:30 AM @Snaitf. I have tried your mod in the context of my Slavery/Serfdom mod, and it seems to be behaving VERY oddly. Although the icon for the soldier is there, I simply can't use it-even after building a barracks. In fact, mousing over the icon gives me NO info on it. It also seems to be having a negative impact on the operation of my original slavery mod. I think I might try building the whole thing from the ground up, using this mod as inspiration-if you don't mind :)!
Anyway, I checked that script out that I mentioned above and-though I personally haven't had a chance to see if it works, I DID find out that isSpecialist does NOT work. However, after looking up the Python tute, I have come up with a possibility for making soldiers work-perhaps you can try it out for me? I would, but won't get another chance to work on the game for another 48 hours. Anyway, try this script in your mod and see what happens!
class CvCustomEventManager(CvEventManager.CvEventManager ):
def __init__(self):
# initialize base class
self.parent = CvEventManager.CvEventManager
self.parent.__init__(self)
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
player = gc.getActivePlayer()
if (player.isSpecialistValid(gc.getInfoTypeForString("SPECIALIST_SOLDIER"))):
for i in range(player.getNumCities()):
player.getCity(i).getCityDefensePercent(5)
else:
for i in range(player.getNumCities()):
player.getCity(i).getCityDefensePercent(0)
player = gc.getActivePlayer()
if (player.isSpecialistValid(gc.getInfoTypeForString("SPECIALIST_SOLDIER"))):
for i in range(player.getNumCities()):
player.getCity(i).getMilitaryProductionModifier(5)
else:
for i in range(player.getNumCities()):
player.getCity(i).getMilitaryProductionModifier(0)
One thing I can say about the above code is that it produces NO error in the PythonErr logs.
Good luck and I look forward to hearing if it works.
Yours,
Aussie_Lurker.
The Great Apple Dec 13, 2005, 06:59 AM class CvCustomEventManager(CvEventManager.CvEventManager ):
def __init__(self):
# initialize base class
self.parent = CvEventManager.CvEventManager
self.parent.__init__(self)
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
player = gc.getActivePlayer()
if (player.isSpecialistValid(gc.getInfoTypeForString("SPECIALIST_SOLDIER"))):
for i in range(player.getNumCities()):
player.getCity(i).getCityDefensePercent(5)
else:
for i in range(player.getNumCities()):
player.getCity(i).getCityDefensePercent(0)
player = gc.getActivePlayer()
if (player.isSpecialistValid(gc.getInfoTypeForString("SPECIALIST_SOLDIER"))):
for i in range(player.getNumCities()):
player.getCity(i).getMilitaryProductionModifier(5)
else:
for i in range(player.getNumCities()):
player.getCity(i).getMilitaryProductionModifier(0)
Without actually having tested this (away from home - don't have game), I'm pretty certain it won't work.
As a general rule with python commands used in Civ, anything with a "get" prefix returns whatever the value currently is, and anything with a "set" prefix changes the value.
If you look at the API, you can see that getMilitaryProductionModifier() returns an integer value, which this code doesn't do anything with.
Also, isSpecialistValid() doesn't seem to be a valid function for a player - once again, checking the API. Thinking about it, it doesn't make sence either - players don't have specialists, cities do.
Looking at the API I can see no clear way of changing the defence modifier of a city, though I may be wrong.
Aussie_Lurker Dec 13, 2005, 02:17 PM I can assure you that I got isSpecialistValid from the API-after looking for an appropriate string in Locutus' reference. I agree though that it should be pCity and NOT pPlayer and-equally-that it should be set and not get. Again I wasn't thinking (please remember that I am a total novice when it comes to python, but I THINK I am beginning to the get the hang of it).
Yours,
Aussie_Lurker.
Lord Olleus Dec 13, 2005, 02:42 PM the GG looks a bit over powerfull. The academy is a hugely powerfull building. I think that a better thing to do would be too make him better:
1) Make him upgrade into the most powerfull unit of the age BUT with a promotion that gives him a +100% bonus in combat.
or
2)make him upgrade into a unit that gives +50% to all units in the stack and +25% to all units in a adjacent square. In both of these cases the unit should die after a certain amount of time (20 turns?) to stop it being over powerfull.
I dont think that a basic GG should give combat bonuses before it is upgraded as it would give him to much flexibility.
Also i dont like th MA building because it is too close to west point. If you dont think that it will make it better i would greatly appreciate it if someone told me how to do it.
OzzyKP Dec 13, 2005, 09:04 PM Well if the great engineer can finish production of a building, then couldn't a great general finish production of a unit? That seems like that'd be possible to do without too complicated editing.
Tricky though would be giving that unit special characteristics (like an extra 20XP or 100% attack bonus. I don't like the stack bonus, that could be too powerful. And having the person expire after a time would be too weird. Unless it could be implemented like a golden age somehow, that the GG disappears and you get a 10-20% bonus for ALL units for 20 turns.
Or the GG could build one special unit (or several, one for each age) that has some good characteristics.
LittleRedPoint Dec 18, 2005, 08:39 AM You should make fix great general - because he forces building thare is no need of barrack in city. Put this entri to between Buildings tag. Then if city has barrack you may be able to build Military Academy.
Lord Olleus Dec 19, 2005, 12:34 PM added this to B Dive's mod. Thank you so much for adding comment blocks telling us where you edit things. It makes my life so much simpler.
Snaitf Dec 19, 2005, 01:46 PM You should make fix great general - because he forces building thare is no need of barrack in city. Put this entri to between Buildings tag. Then if city has barrack you may be able to build Military Academy.
The Military Academy bonus will stack with the barracks bonus, giving you both...
Snaitf Dec 19, 2005, 01:47 PM added this to B Dive's mod. Thank you so much for adding comment blocks telling us where you edit things. It makes my life so much simpler.
Not only makes your life easier, but if I have to change something makes it easier for me too :p
Exavier Dec 19, 2005, 01:55 PM Hey I just figured i'd let you know I had to make some changes to your Great Generals Mod that I included in my Composite mod... Might be something to think about.
I had to remove the Soldier specialist from the palace and the barracks. The reason for this is because GGs started overwhelming all the other great people. Even with a citys specialist automation turned off it still liked to constantly make Soldier specialists at the beginning of the game. So you have about a 100% change of getting a great general as your first 3-4 GPs.
By removing the specialist from Barracks and palace the Great Generals can't start spawning untill about the time you can set specialists for other GPs. Makes it easier to control what GPs you get by specializing citys. That and having 3 Military Academys before i even had Calander researched was rather interesting (Note: I play on a modifyed Epic Speed in my mod)
Lord Olleus Dec 19, 2005, 03:55 PM i have modded the effect of the MA as i found it to close to west point/hero epic. I have made it so all units build in the city with an MA get a free promotion called 'Elite' this gives it a +15% combat bonus. The only other way to get the 'elite' promotion is too be a level 3 city raider and level3 city defender - so its impossible. btw i have also made grenadiers upgrade to marine and both of them count as melee unit and not gunpowder. To make the game balanced i have tweeked who can get what promotions.
ostar Dec 19, 2005, 11:28 PM This is a great mod, and I am working on an add-on to the Great Person mod for this. Is it all right to include this mod in the add-on? I will have to modify the General's list some, since there are some duplicates with other Great People. Also, putting a picture and quote for some listed Generals may cause legal problems in some countries and unnecessary controversy in others. And I would like to make sure that at least one General is used from each of the 18 original Civs.
LittleRedPoint Dec 20, 2005, 04:46 AM Well i mod your GG mod a bit. I made general to appear in battle, 5% chance and i replaced the Soldier specialist with Noble specialis who produces culture but consumes 1 commerce. GG birth rate is +3.
MA needs barrack in city.
Optimizer Dec 31, 2005, 10:07 AM I think that Great Generals are best implemented without specialists. Barracks, Castles and possibly some other buildings would generate Great Officer points.
The Great Officer would not be able to settle in a city as a "super specialist". But he would be useful in the battlefield. Suggestions:
* A mediocre combat strength (Let's say 5, with bonuses against guns, mounted units and armor so he doesn't get obsolete). A Great Officer with an enormous combat strength would be able to crush an enemy civilization by himself, which would feel inapropriate.
* Siege ability.
* Sentry, Medic, March and possibly other kinds of bonuses that would make him a useful explorer and support unit.
* Spy abilities.
Maybe we should start thinking of Great Admirals, too?
Banira Jan 02, 2006, 11:32 PM The Great General shouldn't found military technology. It is science that enables military advancement. There is no military person in history that has invented or could conceivably have invented a science technology. Military schools in the past have not focused on science and inventing, but military organization, battlefield tactics and logistics.
Instead the Great General could have an ability to "train" all current units with new "military tactics" that instantly grants +2-4 experience each. Or, elevate 1-3 units to maximum experience. These would be the elite units directly under command of the Great General.
I also am inclined to agree with others about removing the specialists and tend to think the military production facility is overpowered. An idea for the building is to train new units, i.e. Give all new units +4 experience. This reflects the ability of the General to theorize on warfare and pass on the new insights/tactics.
Kirghiz Jan 03, 2006, 12:55 AM I am having a problem with the mod I think, I'm not sure. I can't for the life of me get a Great General to appear, and I am not seeing the new specialist in the cities either. Is there anything special you have to build or tech to discover that unlocks the new specialist?
jollyroger3 Jan 03, 2006, 01:36 AM Your mod sounds really cool, I'm really glad seeing it included in Mylons mod :)
I'm really glad you changed the bonuses, they were exagerrated IMHO :goodjob:
Kieran Jan 07, 2006, 08:01 PM Is this mod v1.52 compatible?
I can't rename my units when I load this mod.
RogerBacon Jan 07, 2006, 08:52 PM Is this mod v1.52 compatible?
I can't rename my units when I load this mod.
I don't think so. I used a program to compare the CvMainInterface.py with the stock v1.52 one and I saw differences outside of his "Start modification block" and "End modification block".
What do the changes in the CvMainInterface.py do in this mod? I'm pretty sure I can navigate all of the other files' changes and get this mod installed but I wouldn't want to try and merge the python file since it looks like it's not v1.52 compatible.
Roger Bacon
Kieran Jan 08, 2006, 11:55 PM I *think* the changes place the new specialist in the city screen
Exavier Jan 08, 2006, 11:59 PM Actually you can copy the stuff he changed (inside his comments) into that exact place in the v1.52 file and it will work just fine. I have been running it in my Composite Mod from day one.
All the other stuff is thing that the v1.52 patch changed.
puglover Jan 10, 2006, 12:14 PM Well done. I had great fun with this mod. :goodjob:
RogerBacon Jan 10, 2006, 01:35 PM Actually you can copy the stuff he changed (inside his comments) into that exact place in the v1.52 file and it will work just fine. I have been running it in my Composite Mod from day one.
All the other stuff is thing that the v1.52 patch changed.
Yeah, I assumed the stuff OUTSIDE of the modification blocks was patch-related changes but I couldn't be sure EVERYTHING inside the modification blocks was his change and not patch-related. Anyway, I'll give it a try this weekend.
Roger Bacon
·Imhotep· Jan 17, 2006, 02:26 PM Has anyone contacted Firaxis on this topic ? It might be worth a shot for the upcoming expansion pack, and maybe they will gladly take any code or ideas which makes it easier for them to implement it. Always wondered why there was no military GP in the game out of the box...
Regards,
Lord Timon
Officer Reene Jan 21, 2006, 06:07 PM Finally a mod that incorporates more militart aspect of Civ
(I think CIV4 is great but it glossed over the combat/military aspect)
This mod seems to rectify this problem...
One question...
is there anyway to name the great generals/soldiers/specialists...
like they do with the great persons...
the reason I ask is that before I knew about this mod...
I decided to rename all the great persons to military soldiers/famous people/fictional characters for my own amusement...
now with this mod.. the names would mean something as opposed to cosmetic changes...
I just thought when a great general/soldier is born... you could see something like
"General George S. Patton Jr was born..." (or the like) flash on the screen and brought up...
any suggestions?
thanks
KGrevstad Jan 21, 2006, 06:22 PM is there anyway to name the great generals/soldiers/specialists...
In Assets/XML/Units/CIV4UnitInfos.xml, you will note this has already been done for this mod.
--Kristine
Officer Reene Jan 21, 2006, 07:05 PM thx again Kristine...
I was searching though those files but I was looking for the the original format (the one in greatpeople) and missed the unique format listing all the name...
that was my bad I should have look more carefully...
*rolls up sleeves*
guess I'm gonna have to edit all those names again...
since the original great people will be replaced by this mod...(right? I saw this file also list the original great people too...)
thanks again for the help
Officer Reene Jan 22, 2006, 02:17 AM Is it possible to add more names to the Great general's list? (following the format)
or are you limited to the amount already listed?
I dont worry about utilizing all the names or not since I usually play w/o time limit
Currently I am playing to conquer the WORLD vs 17 other IA (only 5 are left)
and the year is 3126 (or around that year)
Great Peeps are still being "born" so I have no problem having a long list of great peeps
My question is... can it be done?
thank for your help
Dusty4prez Jan 24, 2006, 06:00 PM What building allow to make soldiers in cities?
TheLopez Jan 24, 2006, 10:39 PM Is it possible to add more names to the Great general's list? (following the format)
or are you limited to the amount already listed?
I dont worry about utilizing all the names or not since I usually play w/o time limit
Currently I am playing to conquer the WORLD vs 17 other IA (only 5 are left)
and the year is 3126 (or around that year)
Great Peeps are still being "born" so I have no problem having a long list of great peeps
My question is... can it be done?
thank for your help
Officer Reene,
Yes, more names can be added, just reply here and I bet he would be more than happy to add them...
Officer Reene Jan 25, 2006, 01:13 AM Officer Reene,
Yes, more names can be added, just reply here and I bet he would be more than happy to add them...
He doesnt need to go through all that trouble
I can do it myself if it a simple thing as adding names to that file..
(following his format)
but if I got to add code or modify code...(if a certain # determines how many names are allowed, ex like 10 names are allowed... but I want to add another 10 names so I would have to change something to meet the new 20 name list...etc.)
just tell what I need to do...
I would think that I can add more names to the list without hurting the overall list...
I dont want him to do something that would take from his free time, if I can do it myself...
TheLopez Jan 25, 2006, 06:19 AM He doesnt need to go through all that trouble
I can do it myself if it a simple thing as adding names to that file..
(following his format)
but if I got to add code or modify code...(if a certain # determines how many names are allowed, ex like 10 names are allowed... but I want to add another 10 names so I would have to change something to meet the new 20 name list...etc.)
just tell what I need to do...
I would think that I can add more names to the list without hurting the overall list...
I dont want him to do something that would take from his free time, if I can do it myself...
You just need to look at the CIV4UnitInfo.xml file at the bottom of the file. Just do a search for one of the general names in the mod.
Officer Reene Jan 26, 2006, 02:23 AM You just need to look at the CIV4UnitInfo.xml file at the bottom of the file. Just do a search for one of the general names in the mod.
I found them... but my question is whether I can just add names to the list (following the format) and it would work in the mod w/o problems ...
or
I can only modify the names (but not add anymore to the list)
I much rather add names because I usually play with no time limit and therefore want alot of Great General Names...
TheLopez Jan 26, 2006, 05:56 AM I found them... but my question is whether I can just add names to the list (following the format) and it would work in the mod w/o problems ...
or
I can only modify the names (but not add anymore to the list)
I much rather add names because I usually play with no time limit and therefore want alot of Great General Names...
You should be able to do both add names and modify names without any problems.
Officer Reene Jan 26, 2006, 06:35 AM You should be able to do both add names and modify names without any problems.
ok thanks for your help
Patriarch Jan 26, 2006, 03:31 PM This is a cool mod... One thing about the name... a 'soldier' doesn't exactly imply specialist, perhaps the name 'commander' or 'captain' would better suit? I'm not sure if this is implemented since I haven't read through all the pages, but some prerequisites for soldier specialists would be nice, lets say you make a barracks and that allows one soldier, you make the Heroic Epic, which would allow two.
I know this is a far-off idea, but it would be cool if you could send out Great Generals out into the field and have them give bonuses to adjacent/stacked units, much like auras in Warcraft III/WoW. I don't know much about coding but the effect would be similar to a Medic II promotion affecting nearby units. Maybe give it a 10%-20% strength bonus. This would only apply to earlier ages of warfare though where generals would inspire their troops by being present on the battlefield, nowdays generals sit in air-conditioned offices. This 'aura' effect could be made obsolete by Assembly Line, where Infantry start popping up.
TheLopez Jan 26, 2006, 03:48 PM This is a cool mod... One thing about the name... a 'soldier' doesn't exactly imply specialist, perhaps the name 'commander' or 'captain' would better suit? I'm not sure if this is implemented since I haven't read through all the pages, but some prerequisites for soldier specialists would be nice, lets say you make a barracks and that allows one soldier, you make the Heroic Epic, which would allow two.
I know this is a far-off idea, but it would be cool if you could send out Great Generals out into the field and have them give bonuses to adjacent/stacked units, much like auras in Warcraft III/WoW. I don't know much about coding but the effect would be similar to a Medic II promotion affecting nearby units. Maybe give it a 10%-20% strength bonus. This would only apply to earlier ages of warfare though where generals would inspire their troops by being present on the battlefield, nowdays generals sit in air-conditioned offices. This 'aura' effect could be made obsolete by Assembly Line, where Infantry start popping up.
Patriarch, I am going to show my hand a bit and tell you that I have been working on this enhancement on Snait's Great General mod for about a week now. I am almost ready to release it as a new mod called Great General Amped. It does almost exactly what you are talking about but a bit differently. It includes 3 new "promotions" called Morale... well i'm getting ahead of myself.
Please look for the Great General Amped mod tomorrow in the "Civ4 - Completed Modpacks" forum.
Aussie_Lurker Jan 26, 2006, 04:13 PM Actually, Patriarch, I think 'Soldier' is completely valid. What it represents is a professional soldier class within society, rather than just a hodgepodge collection of ordinary folk pulled together and trained at a moments notice. If you want an example, look at modern countries with National Service or even Ancient Sparta. This is why ultimately it would be good to see Soldier Specialists provide a reduction in the build time of military units and/or XP bonuses, as it is easier to put a well-disciplined force together if you have been specifically training a section of your population for that purpose.
Yours,
Aussie_Lurker.
RogerBacon Jan 26, 2006, 08:13 PM This is a cool mod... One thing about the name... a 'soldier' doesn't exactly imply specialist, perhaps the name 'commander' or 'captain' would better suit?
I think I would use the term "Officer". It's generic but sounds a little more significant that just "soldier".
Roger Bacon
casey1966 Apr 15, 2006, 07:25 PM Yeah, I assumed the stuff OUTSIDE of the modification blocks was patch-related changes but I couldn't be sure EVERYTHING inside the modification blocks was his change and not patch-related. Anyway, I'll give it a try this weekend.
Roger Bacon
If anyone would help me get the new 1.61 CvMainInterface file to work with Great Generals,that would be great.....1.52 works fine.
I just wanted the new combat system available.......I tried myself,did'nt get any errors upon load....but the city screen would'nt show everything when opened up..:lol: The new combat system was working though...
That was my 1st attempt at Python....or if someone would tell me what files were added from the diff versions of CvMainInterface I'll just try it myself.
Thanks
TheLopez Apr 15, 2006, 08:00 PM If anyone would help me get the new 1.61 CvMainInterface file to work with Great Generals,that would be great.....1.52 works fine.
I just wanted the new combat system available.......I tried myself,did'nt get any errors upon load....but the city screen would'nt show everything when opened up..:lol: The new combat system was working though...
That was my 1st attempt at Python....or if someone would tell me what files were added from the diff versions of CvMainInterface I'll just try it myself.
Thanks
Considering that I haven't seen Snaitf here in quite a while, you might want to try my version of his Great General mod, I have a v1.61 compatible version up now.
casey1966 Apr 15, 2006, 08:57 PM Considering that I haven't seen Snaitf here in quite a while, you might want to try my version of his Great General mod, I have a v1.61 compatible version up now.
Hey,Lopez....I was thinking about your mod actually. I've played it quite a bit also. Like it alot but the only thing is as someone mentioned before & I'm concerned about is if the AI has used your Great General.
It's definately great for defending.which I only used it for. Too afraid to leave my borders with this unit as it's very easily to lose units when attacking. It would probably work well with an SOD.
Thanks for the heads up,I'll go download your mod & try it again. If you could fix up that file for me,it would be great. I've done alot of changing to the XML on this mod...See ya!
casey1966 May 09, 2006, 12:24 AM I figured it out myself....just copied his changes from <start modification block> <end modification block> in CvMainInterface.py with Notepad into the latest CvMainInterface.py (version 1.61)
It was pretty simple.:D
casey1966 May 10, 2006, 02:43 PM Here is the update to Great Generals,compatible with the 1.61 patch.Full download.
http://members.cox.net/cas70/Snaitf's%20Great%20General.zip
Edit: Fixed xml if anyone has just uploaded the mod
|
|