Python for dummies?

doronron

King
Joined
Nov 16, 2003
Messages
906
Location
Home or Work...
I'm starting to get a bit of a better handle on SDK and compiling. The next bit of code I'd like to try and merge into the 3.02 BtS DLL is TheLopez's MAD Nukes modcomp, especially considering how nuke happy the new AI is.

However, Python scares me.

Barring a failure to compile the merged C++ sources, I'm not certain what I need to do to implement the Python code that seems integral to the rest of the component. Anyone have a suggestion on where to start when you have no prior experience?

Yay! Must learn to read stickies!
 
I don't remember off hand what files overlap, but I know there are a few. Just take those files and move the differences like you would combining two C files.

After you do that I would just use the new python files the mod adds as is. they "should" work, fingers crossed.

If they don't post up and let me know and I'll take a look at it for ya, I know MAD Nukes pretty well, its how I learned to add new screens. :)
 
Thanks, Jeckel. It'll likely be one of the first things I mess with tonight after work. Don't be surprised if you see a PM from me tomorrow. :lol:

...

There is one thing nagging me. How does the AI look at tactical nukes? Are they a new class of weapon, or the same as ICBMs with shorter range? I don't have the XML in front of me, so I'll have to look at it at home. If they're a new class, would their damage type trigger MAD or not? Can they target as an ICBM would under TheLopez's changes? Would the Strategic Air Command national wonder show Tac Nukes on Subs and Missile Boats out at sea?
 
If I remember right, the mod doesn't add any new tags so it prob just grabs any unit that is taged as a nuke, so tactical nukes or any other new nuke unit will work like icbms. May have to change the code a bit if you don't want tacts to act like icbms.

No, the MAD nuke managment screen won't show ships carring nukes, though the nukes being carried will be displayed. Don't worry about the screens, any changes that will need to be made will be small and screens are my speciality.

I'm around off and on so yea, don't be afraid to throw a pm my way. :)
 
Alright. According to the CivUnitInfos XML file for BtS, the Tactical Nuke has its own unit class. I've dug around in the MAD Nukes DLL source before, but I really don't grasp much of the code content. Am I right in assuming MAD nukes applies its functions only to the UNITCLASS_ICBM unit class?

At this point in time, I've organised the necessary C++ code to merge for this, but I might not be able to attempt a build tonight. I might also need to hold off until I can figure out how to get UNITCLASS_TACTICAL NUKE recognised by the MAD code.

The ideal for Tac Nukes is to have preset launch capacity like an ICBM, but not be visible in the NORAD screen. Don't know if that's possible, though.

EDIT: I'll merge the SDK and Python files where appropriate, anyway. I just need to know if the MAD Nukes component will recognise Tac Nukes, or get them to if necessary.
 
I am 99% sure that TheLopez's code doesn't check unitclasses. For what I can remember it checks <iNukeRange>1</iNukeRange> tag. So yes, Tacts should be reconized as nukes by the mod.

Let me know if there are any problems. After you get it up and running I will point you in the right direction to make whatever changes are neccessary to the nuke manager screen. :)
 
Top Bottom