Dale's MOD Code Factory

Dale said:
That could be done. I'll get it done soon.

Thanx, that would be good.
 
Dale said:
--------------------------------------------------------------------------------------------------------
The missile ability causes units to explode on contact with the enemy. This explosion is done during combat. One combat round will be processed (so a chance the missile itself could be hit for anti-air units you create [see below in notes]) and then the missile will explode. The nuke range ability has been enabled for non-special nuke units when they have the missile tag. This means your missile can be nuclear as well to create tactical nukes.



NOTE: If you give a missile unit nuke abilities by change nuke range to: <iNukeRange>1</iNukeRange> the unit will become a nuclear missile. In this way by defining the air range and air bomb abilities for the unit you just click on air bomb mission and select the target in range. Your unit is now a tactical nuclear missile. :)

NOTE2: Since one combat round is processed before the missile explodes, you could create your missile unit, then the anti-missile unit with a combat bonus against the missile unit. By testing and getting the correct values the anti-missile unit has the chance to destroy the missile before impact. Example: You could have a ballistic missile and a SDI unit with a combat bonus against the missile. The SDI unit has a chance to destroy the missile before the ballistic missile explodes.

Fantastic ideas and work.
A question for you, since I have not tried implementing this.

Can you load the cruise missile type on subs, or ships?

Also, is there a way to have the suicide missile attack occur in the same turn they are launched?

I fully understand and agee with the concept of allowing the chance of knocking down long and medium range missile attacks, but I am wondering about something like a sub-launched cruise missile, say a Cold War Russian Oscar II sub targeting a carrier from a point blank range, where there would be virtually no chance of destroying the missile.

And as an editorial, it is great to see talented coders implementing things that should have been done with the base game.
 
MAD Code 1.2 released!

This version of the MAD code fixes a number of reported bugs, as well as adding some interface feedback and python utilities for modders.

As usual, anything found in this version please let me know.

Dale
 
I_batman said:
Fantastic ideas and work.
A question for you, since I have not tried implementing this.

Can you load the cruise missile type on subs, or ships?

Yes, with the correct XML changes in Civ4UnitInfos.xml (see the tutorial forums on XML modifications).

Also, is there a way to have the suicide missile attack occur in the same turn they are launched?

It already does. The missile "launch" as you call it is the act of combat.

I fully understand and agee with the concept of allowing the chance of knocking down long and medium range missile attacks, but I am wondering about something like a sub-launched cruise missile, say a Cold War Russian Oscar II sub targeting a carrier from a point blank range, where there would be virtually no chance of destroying the missile.

The SDK provides no easy way to implement this. It would literally be something done from scratch, which unfortunately I do not have time for at the present time.

And as an editorial, it is great to see talented coders implementing things that should have been done with the base game.

Everything is done for a reason, and I'm sure Firaxis had some good ones for not having them in the game. :)

Dale
 
so i have to add all of the python in "Note 5" of the MAD 1.2 to properly use MAD? just put each of those lines in there with no define or anything or what? im lost i thought i just compile the file and play? o and when do u think the suicide missiles will be fixed (without me declaring war on myself)?
 
well the MAD nukes 1.2 crashed on me as soon as i manually launched a nuke at my enemy...
 
blacksam:

The python is only there if you want to access those features through your own python scripts. In your case you can ignore the python stuff. :)

Dale
 
blacksam said:
well the MAD nukes 1.2 crashed on me as soon as i manually launched a nuke at my enemy...

If you could tell me the specific steps to recreate this, I'd appreciate it. Also if it's a custom unit, please try it with the stock standard Civ4 ICBM unit as well.

I'm unable to recreate this in tests.

Dale
 
ok well i used it with the stock standard ICBM, and this is what happened:

#1 i started a new game and through worldbuilder gave myself a few cities and machine gunners and then 4 ICBMs as well as gave another civ the same cities/units next to me.

In peacetime, i pretargeted my nukes to their cities (one nuke for each city) and then declared war on them. I used one ICBM to bomb one of their cities to piss them off and the next turn (when they would have launched their missiles at me setting my own pretargeted ones off) the game crashed to desktop.
 
Dale,

Are we supposed to get the "X incoming/ Y outgoing" message every turn? I see in the code you use EVENT_MESSAGE_TIME and I have that set to 10 in my GlobalDefines.xml but I get the message every turn. Any ideas?

Roger Bacon

Code:
// Dale - MAD: output incoming and outgoing target message
	CvWString szBuffer;
	if(isHuman() && DCMMad)
	{
		szBuffer = gDLL->getText("MAD Targets: %d1 incoming / %d2 outgoing", getDCMIncoming(), getDCMOutgoing());
		gDLL->getInterfaceIFace()->addMessage(getID(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, "AS2D_NUKE_EXPLODES", MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_WHITE"), NULL, NULL, true, true);
	}
 
RE: Missile Mod
I'm trying to merge this with other SDK mods (specifically, the flying mod) so I'm picking out your changes one by one. Everything is nicely commented so far, but one of the files, CvUnit.h, does not seem to have any changes in it. I'm a little paranoid about the SDK, so I just wanted to check in to make sure that there is or isn't something changed in CvUnit.h...

Thanks, Dale!!!
 
Padmewan said:
RE: Missile Mod
I'm trying to merge this with other SDK mods (specifically, the flying mod) ...

Let me save you the trouble and tell you that I've already done that and I plan to release the next version of the flying mod this weekend. It will include Dale's stuff, as well as some more things that I'm sure you will like.

Dale, that's ok with you, right?

Roger Bacon
 
wait so its only me thats having this problem with the MAD nukes? if so i must be compiling wrong. Are u supposed to replace the old files that make up the dll with the new files of MAD 1.2? is there another way or something? i dunno it would be so much easier if somebody just PMed me the dll already compiled...
 
RogerBacon said:
Let me save you the trouble and tell you that I've already done that and I plan to release the next version of the flying mod this weekend. It will include Dale's stuff, as well as some more things that I'm sure you will like.
well you've save me and my RSI some pain (literally)
 
blacksam said:
wait so its only me thats having this problem with the MAD nukes? if so i must be compiling wrong. Are u supposed to replace the old files that make up the dll with the new files of MAD 1.2? is there another way or something? i dunno it would be so much easier if somebody just PMed me the dll already compiled...

I haven't actually launched a nuke yet so I can't say that it is working for sure. I've just targeted the nukes and that part works fine. I do get that message every turn though (see a couple of posts above).

Roger Bacon
 
Apparently there is still a bug in the mad code. So don't stress just yet. :)

RogerBacon:
Probably best to just comment out that line and use the python getDCMIncoming() getDCMOutgoing() functions to create your own interface elements.

Padmewan:
Yes, there are changes to CvUnit.h. Have a look at the top of the class just under the constructor/deconstructor is where I've been placing the new variables/function declarations.
 
MAD version 1.3 released!

Fixes all current reported bugs.

See second post in this thread for it.

Dale
 
Top Bottom