Merging TechDiffusion.py from Revolution Mod into BUG Mod

Cybah

Emperor
Joined
Jun 22, 2007
Messages
1,481
I actually failed to merge the attached file into BUG mod. I'm getting massive python errors.

My goal is to have BUG Mod merged with Better BTS AI (done) AND TechDiffusion from the Revolution Mod.

Can anyone help me with TechDiffusion.py?

You'll need the attached file and the following code for an ini-file:

PHP:
[TechDiffusion]
Enable = True

; Turn on Debug output
DebugMode = False

; Number of techs behind to begin effects, reach full effect, and start extra bonuses
MinTechsBehind = 5
FullEffectTechsBehind = 8
BonusTechsBehind = 12

; Adjust the strength of diffusion
DiffusionMod = 1.0
 
I've added the file to the BUG Mod Event Manager (same xml modus as better bts ai since it's a single file). But this is not working.
 
Please post the errors your get, even if it's boatloads. If they simply repeat, just paste a few. I think this should be second nature to you by now, Cybah. :rolleyes: :)

How exactly did you add this to BugEventManager? Did you create an XML configuration file? Care to post it?

Looking at the Python file you posted (I should make you reply with your errors, but I've already looked -- last freebie) I see that it takes a config object (probably ConfigObj) as well as the event manager. Converting these to use BUG's options would be quite easy, and I highly recommend it.

However, if you haven't, how did you acquire and pass in the config object? Also, there are two extra imports at the top that aren't in BUG: RevDefs and SdToolKitCustom. Did you add those to your mod?
 
damn. this file was in an folder named "gameready". seems so that I cannot use it without RevDefs and SdToolKitCustom. will add those files to my mod. could you please convert it to use BUG's options, so I can give it a new try? :worship:

and do I need to make any source code changes to create the new game option: TechDiffusion enabled/disabled or is this possible by python/XML only?
 
will add those files to my mod.

Note that BUG already uses SdToolkit, so there may be a conflict there. If you provide a link to SdToolkitCustom, I will see what can be worked out.

could you please convert it to use BUG's options?

Honestly, I'd much rather teach you to fish than go fishing for you. I've spent a lot of time this past week writing up documentation for doing this. I want modders to use it and especially provide feedback, I can improve it for everyone's benefit.

and do I need to make any source code changes to create the new game option: TechDiffusion enabled/disabled or is this possible by python/XML only?

You use XML to create the option, and you'll need to modify the TD Python code to use that new option. It's covered in the docs, and I'll be writing up a front-to-back working example showing everything in context.
 
Top Bottom