View Full Version : Can I use Scientific Method to increase Scientist-yields?


Kjotleik
Dec 29, 2011, 12:00 PM
Hello!

I am currently looking into how I can make Scientific Method increase Research, instead of decreasing it as Monasteries become obsolete.

Because I know Improvements can have added yields from Technologies, I looked through CIV4ImprovementInfos.xml. There I found a tag, <TechYieldChanges>. Can this be used in CIV4SpecialistInfos.xml to give the Scientist a +1 Research Point when Scientific Method is discovered?

Anyone having other ideas as to how I can accomplish the task in XML-modding?

Even if the answer should be negative, I'm hoping someone can tell me If it is possible or not to do this. I really would like for either the Scientist (preferably) or a Library (increase research-boost by 35% instead of 25% upon discovering Scientific Method) to counter the fall in research due to the obsolete monasteries.



Yours Sincerely

Kjotleik of Norway:)

The_J
Dec 29, 2011, 05:26 PM
Can't see a good way to make that possible :/.


You can't copy stuff from one XML to another, that doesn't work. You'd have to modify the .dll to make the game understand what it should do with these new values. That's sure possible (especially since it would be a partial copy & paste job), but C++ coding is not really easy for a person who's not familiar with it.

Kjotleik
Dec 30, 2011, 08:05 AM
Can't see a good way to make that possible :/.


You can't copy stuff from one XML to another, that doesn't work. You'd have to modify the .dll to make the game understand what it should do with these new values. That's sure possible (especially since it would be a partial copy & paste job), but C++ coding is not really easy for a person who's not familiar with it.

Thank you for sharing your insight. Then I guess I just have to make Scientific Method give one extra trade route in each city. That should at least give extra commerce to help keeping the research up after the monasteries are gone.



Yours Sincerely

Kjotleik of Norway:)

platyping
Jan 01, 2012, 04:28 AM
I believe can be done with python though alot of work needed. This is what The_J taught me lol

1) XML
A) Create a new set of libraries in Building files, including UBs.
Totally similar bonus, except higher Research or whatever you want.
B) Pythoncallbackdefines, set def cannotConstruct to 1

2) Python:
A) def onTechAccquired
Upon discovery of Scientific Method,
Replace all existing libraries with new libraries.

B) def cannotConstruct
If player doesn't have Tech SM
Cannot build new libraries
If player has Tech SM
Cannot build old libraries

But since Universities require libraries to build, you will have to adjust them as well.
Simpler way, assign the bonus to universities instead?

LyTning94
Jan 01, 2012, 09:30 AM
If you wanted to put the time into learning how to mod the SDK, there's two great tutorials out there that you can use. A simple guide to compiling the DLL (http://forums.civfanatics.com/showthread.php?t=405444) by Asaf explains how to set up the SDK properly and easily, and An Idiot's Guide to Editing the DLL (http://forums.civfanatics.com/showthread.php?t=314201) by xienwolf explains how to add a new XML value and use it in the DLL. These two tutorials should cover everything you need to do here.

Kjotleik
Jan 06, 2012, 02:55 AM
Hello!

A thank you to LyTning94 and platyping for your suggestions.

I may try to look into one of these methods during 2012. But for now (spring 2012) I don't think I have the time. Your suggestions are heartly welcomed anyways, and time permitted I will try to learn how to do one or the other...



Yours Sincerely
Kjotleik of Norway:)

platyping
Jan 06, 2012, 08:08 AM
the python I can do for u if u really need.

The last time I was trying out with new Cathedrals replacing old ones for certain leaders.
They work well, except for a duplicate copy of each Cathedral in the civilopedia, which is... pretty ugly to me.

The same should be doable for libraries, except there are extra issues to take care of: UBs and universities.

The ideal solution would be sdk, because it is definitely cleaner, codewise and Civilopedia.
Also, I believe the more python codes used, the longer loading time

Dancing Hoskuld
Jan 06, 2012, 03:09 PM
They work well, except for a duplicate copy of each Cathedral in the civilopedia, which is... pretty ugly to me.

Also, I believe the more python codes used, the longer loading time

If I remember correctly there is an XML tag bGraphicalOnly the effect f which is to stop a building, unit or other appearing in the civlopedia. Unfortunately it is not in the default schema files and needs to be added to work.

In general python code cause the greatest slowdown if you use the PythonCallbacks often. This slows turns not loading time, extra XML does that. naturally poor coding can slow anything down.

Kjotleik
Jan 07, 2012, 07:08 AM
the python I can do for u if u really need.


I appreciate the offer very much, thank you! :goodjob:

However, I had in mind trying to learn something myself during the process of making it work. I am in no "need" for it to work as I want it to. What I am in "need" of is to learn to do it myself. I had hoped it would be a simple XML-thing. That I could've learned without too much effort. Python, or SDK, will simply take a lot longer. And I understand my comment on adding a trade route can be taken as a "need" for it to work on my part. However, I'm constantly changing my own mod, so it's really never "good enough." Thus, I need to learn how to mod myself. The time-consumption part is just a result of having things to do in real life in addition to playing around modding CivIV.

But again, a very big thank you for the offer. It shows a real concern for the well-being and needs of other people on these forums. And that is something I always appreciate.


Yours Sincerely
Kjotleik of Norway:)

platyping
Jan 07, 2012, 07:33 AM
Welcome to the python learning club:goodjob:

I just started learning python myself recently to add some unique wonders to my own personal mod.

The way I learnt is largely through Tsentom's python wonders and traits, try and figure out what each line is trying to do, then cut and paste some parts, edit some values and see what happen. The_J also introduced me to the full list of default python commands which is pretty confusing to understand at first as there are no working samples of each code. But after some trials and errors, I managed to get some of my wonders up and working :mischief:

Some things I found out about python:
XML, once u edit, u have to restart the client.
SDK, u need to recompile...
Python editing is the only thing that can be done, while the game is running.
For instance, while playing, I can type a python code to let a great general unit pop up at my capital next turn. Just save the file, and continue playing, and the magic will happen next turn without even reloading the game.

Capuqin
Jan 08, 2012, 04:51 AM
I appreciate the offer very much, thank you! :goodjob:

However, I had in mind trying to learn something myself during the process of making it work. I am in no "need" for it to work as I want it to. What I am in "need" of is to learn to do it myself.
This is 75% of the reason for my fiddling with the game.

But again, a very big thank you for the offer. It shows a real concern for the well-being and needs of other people on these forums. And that is something I always appreciate.

These forums truely are great. :D
Welcome to the python learning club:goodjob:


Can I join too? Or do you already have a member called Homer?


On topic though, There is a clerks' guild or something along those lines in the guilds part of ROM(-AND?), which is like a corporation. This guild lets you build a clerks' office or bureau or whatever which causes scientists to yield an extra commerce (but not beaker specifically).
Maybe you could create a dummy building that comes with scientific method which could cause a similar effect? Or the palace could gain this attribute after discovery of sci method?

Either way, goodluck!

platyping
Jan 08, 2012, 05:14 AM
ROM/AND has alot of extra XML features such as vinicity bonus, extra combat strength with certain Techs, and the one you mentioned.

I believe all these are results of SDK

Welcome to python also lol, trial and error is my style of modding

LyTning94
Jan 08, 2012, 08:02 PM
These forums truely are great. :D

Yes, they really are. :agree:

What I am in "need" of is to learn to do it myself. I had hoped it would be a simple XML-thing. That I could've learned without too much effort. Python, or SDK, will simply take a lot longer. And I understand my comment on adding a trade route can be taken as a "need" for it to work on my part. However, I'm constantly changing my own mod, so it's really never "good enough." Thus, I need to learn how to mod myself. The time-consumption part is just a result of having things to do in real life in addition to playing around modding CivIV.

So, do you want to do this completely through python, or do you also want to delve into the SDK?