Need help about vicinity bonus

Po2i

Chieftain
Joined
Oct 9, 2014
Messages
3
Hello,

I'm kind of new to modding, and am still testing some things in order to do a simple mod (at least simpler than C2C :p ), and I found the vicinity bonus a great find and a really interesting mechanics, and i'm trying to put it into my own mod. But i've failed to locate it in the C2C mod, so i've come here to seek some help.

So if anyone could explain me roughly how to locate the vicinity bonus in C2C and how to transfer it to another mod, that would be awesome.

Thank you anyway =)
 
Sorry to bring this up again but back then I kinda gave up on this, but now i've leaned a bit more and I want to acheive vicinity bonus once more, and I'm a bit lost in the DLL file. Should I just take the dll and put it in my mod or extract vicinity bonus from it? I've tried a lot of thing, isolation vicinity bonus-related stuff in the C++, but none of it worked.
 
Using the whole dll file will probably have a lot of negative consequences elsewhere in the xml of a simpler mod. I doubt you would get away with it without numerous huge issues.

I could at some point look to see if I can isolate the vicinity bonus stuff perhaps but it may be more complicated than it sounds.
 
Yeah I really seemed to be huge and hard to transfer. Right now i'm trying to get similar effect from other mods but it seems nearly as hard as in C2C. Maybe I'll have to recode it from scratch?
 
Might be easier. C2C has the vast potential of having any one element of its modding dramatically woven into one or more other elements of its modding to the point that it becomes very hard to extract.
 
How to find the code that does something in the DLL in most cases:
Follow the path from where the data for it is loaded to where it is used.

To find the vicinity bonus related parts of the DLL, start by looking where it loads the building info object from the XML. It reads the vicinity bonuses (both the VicinityBonus standalone tag and the version which is inside the PrereqVicinityBonuses tag) from the XML and puts the data, if present, somewhere in the building info object - find the relevant variable name or names. Then search the source code for everywhere those variables are used. That will either lead you directly to the code where the functionality is implemented, or lead you to some functions involved with checking vicinity bonuses which are then called in various places to actually do what it does.
 
Top Bottom