SDK request: Tech Yield & Commerce modifiers

ArbitraryGuy

Rusty Shackleford?
Joined
Jul 11, 2003
Messages
1,076
Here's a request for all you SDK geniuses. I couldn't figure out how in python. I'd like the following for the 19th cnetury mod, but I think other people would want it to:

It'd be nice if that technologies could offer yield and commerce modifiers like the civics are able to. For example, then a refrigeration tech could give +10% food yields once discovered or scientific method could give a +20% science commerce modifier once discovered.

If anybody could do this, they'd have my thanks, awe, goodwill, etc :goodjob:.

EDIT: The effect should be cumulative such that if Techs A, B, and C all give a 5% commerce bonus, then if I have all of them, I get at 15% commerce yield bonus in all cities.
 
That would be quite easy to do, I'm suprized its not already included. I'll put it on my TODO list. In the meantime you can do a "simulated" effect by using the CCP and my <FreeWithTech> tag for buildings, just give the Building +X% Commerce or Yield, put the desired Tech in the Tag and make the cost -1 which makes it unbuildable. When a Civ learns the Tech they get the Building Free just like a Wonder had given it, many folk do something similar in Python but now you can do it with just XML.
 
Has anyone looked or considered this in the past few months? I could still really use it, as I'm sure others could. Thanks to anyone who would like to do this, I really appreciate it :goodjob:.

If nobody has time to do this, is it possible to do in python? Thanks.
 
Yes, I know I could really use it as well ... hopefully someone has started this and could post it for us :)
 
I have to say that, with the experience I have gained recently, I would feel rather confident about doing this myself. The question is how soon do you need it? I will be taking some time off of my civics mod after Saturday, so should be able to make a start on it by Saturday evening. Unfortunately, unlike the robotic TheLopez, I can't promise to have it to you within a few hours ;). I will stick with it until I finish it though, if that helps?

Aussie_Lurker.

Oh and, btw, before you 'thank' me-I am offering to do this for selfish reasons (1) I could probably make use of this functionality myself and (2) It is all good practice for me.
 
Aussie_Lurker said:
I have to say that, with the experience I have gained recently, I would feel rather confident about doing this myself. The question is how soon do you need it? I will be taking some time off of my civics mod after Saturday, so should be able to make a start on it by Saturday evening. Unfortunately, unlike the robotic TheLopez, I can't promise to have it to you within a few hours ;). I will stick with it until I finish it though, if that helps?

Aussie_Lurker.

Oh and, btw, before you 'thank' me-I am offering to do this for selfish reasons (1) I could probably make use of this functionality myself and (2) It is all good practice for me.

There's no pressingly urgent hurry for this (at least on my end), as the 19th century mod is slowly making progress. The next few months would be fine. Would you do it for "Vanilla" or Warlords (or both?)?

Selfish motives are good... as long as you share ;). Thanks, Aussie_Lurker!
 
Sorry about totaly forgetting them mod Arbitrary guy, if you want to do this one Aussie its all yours, just remember Tech processing is handled at the Team level.
 
Impaler[WrG] said:
Sorry about totaly forgetting them mod Arbitrary guy, if you want to do this one Aussie its all yours, just remember Tech processing is handled at the Team level.

No problemo... I forgot about this until recently, too :lol:.
 
Thanks for warning me, Impaler, 'cause I probably would have blundered along blindly and tried to set things up as individual player. So I take it that I need to look at CvInfos first, then tackle CvTeam, then CvCity again (oh boy, CvCity is my favourite .cpp file :p )

As far as I can see, you would probably need to add a couple of new lines to CvCity::BaseYieldRateModifier to make this work. Changing Commerce modifiers will-from experience-be even easier-now that I know where the modifier is calculated ;).
Wish me luck! Actually, in spite of the errors I have made, I am really beginning to enjoy SDK modding!

Aussie_Lurker.
 
It looks to me that their is a Player level YieldRate modifier that could be used, its already called by CvCity::getBaseYieldRate(eYield) and Buildings already have a tag that modify it that you can copy off of. When you process the Tech in the CvTeam::ProcessTech fucntion just loop through the Players and push them each the modifier.
 
Well, didn't take long to run into problems. In CvInfos-at the CvTechInfo step-I tried to add the very simple line:

Code:
m_piCommerceRateModifier(NULL),
and when I tried to compile it I got
Code:
Illegal Member initialization: m_piCommerceRateModifier is not a base or member.

First time I have ever seen this kind of error. Can anyone explain what I might need to alter first in order to make pi_CommerceRate work. Its probably a case of once I get that one error dealt with, everything else will just flow from there.

Aussie_Lurker.
 
Scratch my last question. I have a pretty good idea why its not working. It needs to be defined under CvCommerceInfo. If I am proven wrong, then you will see me back here again ;).

Aussie_Lurker.
 
Yep, I certainly did. I am going to give it another shot and see what happens. MY efforts last night came to nought, so if anyone could see an actual reason for this problem, I would still appreciate it.

Aussie_Lurker.
 
Make sure you spelled it correctly in both cases... I've had times when adding new tags that I spelled "Modifier" as "Modfiier" or "Modiifer" in one spot and it screwed up the whole process.

Otherwise, I can't imagine what it could be... and I've done and compiled a lot of CvInfos XML tag channges at this point.
 
You know, DPII, I think you may have been right. When am I gonna learn NOT to try modding stuff at 1:30 in the morning! :mischief: I must repeat the following mantra "I am not TheLopez. I cannot function properly without 7-8 hours of sleep" :p.

Aussie_Lurker.
 
Its not that I so much found the problem. Just started from scratch and it went fine. I have now get CommerceModifier and YieldModifier in CvTechInfo. Now I just have to alter GameTxtMgr and CyInfoInterface, and I should have something to show you guys.

Aussie_Lurker.
 
Back
Top Bottom