Dale's MOD Code Factory

Missiles version 1.1 released!

Fixes reported bug of declaring war on yourself with a nuclear missile setup under this code.

See first post in this thread for it.

Compiled DLL file uploaded for all components!

Check the section of the component you want for a ready-to-go DLL file of that component. They are individual, so if you want more than one component you'll need to combine the code and compile the DLL yourself. :)

Dale

PS: MaxRiga you'll want the new missiles compiled DLL file.
 
great job Dale, this MAD code 1.3 works well. one bug i found: if you pretarget a nuke to a city and the city is razed, the game crashes when your nuke should have been launched at that city (when the other player launches nukes at you). thats the only bug so far.
also, how would you compile both the Missiles 1.1 and MAD 1.3 codes together? would you have to copy and paste the individual writing in the parts of the cvgamecore.dll from both mods? would just putting the different files in (even though it says that it overwrites) and compiling work? anyway could you post this combination dll? thx
 
Dale said:
...
AND in the CvUnitInfo element:
Code:
		<element type="bDCMBombard" minOccurs="0"/>
		<element type="iDCMBombRange" minOccurs="0"/>
To be more specific, the modder should look for the node that reads
Code:
	<ElementType name="UnitInfo" content="eltOnly">
and insert the additional nodes specified for either the bombard or the missile mod.
 
Dale said:
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.

I've successfully (I think) integrated the Missile mod with our overall SDK changes -- it seems to work great from a scant 5 minutes of testing. I have still not found anything in the CvUnit.h file you uploaded (version 1.1). I searched for both "Dale" and "miss" and found no new variables or function declarations. Considering that CvUnit.cpp has no new functions, is it possible that there are no changes?

Also, is the expected behavior that a "missile" unit would popup the message "A [unit name] has withdrawn from combat!"

Finally, one issue I could see arising with actually using this unit (at least, the AI using it), is that the combat result calculation will be very different, wouldn't it? Assuming the unit is not nuclear, the AI would perceive a 10-power missile unit as far better than a 3-power regular unit and build too many of those, which would probably lead to the downfall of the AI player?
 
Assuming I integrated the Missile Mod correctly, here is what I'm finding:

1. One round of unit combat plays out for longer than I would have thought in the graphics engine.
2. Attempting to use these units as NON-nuclear suicide units, I found that the first round of combat seems to involve miniscule amounts of damage. I lined up 8 2-power defense units against 8 4-power missile units. The 2-power units suffered almost no damage. I then upped the missiles to 10-power. The defenders took 0.5 damage. Upping to 20-power gave the missiles a whopping extra 0.2 damage against the defenders. So "Kamikaze" units doesn't really seem to work this mod as it stands.
3. I'm now going to try to give them the Nuke option. I suppose that was what was intended all along?
 
Dale said:
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. :)

...

NOTE3: The missile ability and nuke range change can be made to any unit. You could give just the missile ability to a Japanese fighter in a world war 2 scenario to have kamikazee zeros, or give both abilities to a spearman to have a nuclear suicide spearmen troop. The options are endless.

Again, I may be missing some piece of SDK code here, but when I make a unit into a Missile (bDCMMissile = 1) and a Nuke (iNukeRange = 1), I do not get a nuclear explosion. In fact, when I only have Missile on, the unit suicides (but does little damage). When I have both Missile and NukeRange set to 1, the unit doesn't even successfully suicide; it just withdraws. I have changed nothing else in the XML other than these two values. Well, I gave 1 first strike to see if that would help the unit influct more damage. Any thoughts? Did I screw up the C++?

(I should clarify that the unit engaging in this activity is attacking by MOVING, not by utilizing a "Nuke mission.")
 
Missiles version 1.1b released!

Fixes withdraw text bug on missile units.

See first post in this thread.

Dale
 
Padmewan:

I just checked, there's nothing new in CvUnit.h. I've just been adding files by date. Just ignore the file. :) (Just now realised I did it for 1.1b as well *sigh*)

I've fixes the withdraw text bug. See v1.1b.

If you give the missile unit different UNITAI_ settings the AI will build the unit for different situations. This way you can limit the AI's use/building of the unit. It's xml based.

Battle simulation: Sorry, there's no SDK control over this. BTW, in an example of inf vs inf, the defender should "lose" one man then combat over. That's if the missile hits.

I copied the existing INF unit and gave it missile ability. It did 4 damage to a regular INF. Not sure where the 0.5 is from. The code does nothing to the actual damage dealt.

To test the nuke+missile I copied a regular INFANTRY and the only two changes I did were to add <bDCMMissile> and change iNukeRange to 1. The unit successfully suicided and nuked when I attacked an enemy regular infantry. BTW, if you didn't notice 1.1 of the code fixed the nuke missile DOW yourself bug. ;) Check your xml to make sure you haven't got anything else turned on.

Dale
 
Dale said:
Battle simulation: Sorry, there's no SDK control over this. BTW, in an example of inf vs inf, the defender should "lose" one man then combat over. That's if the missile hits.

I copied the existing INF unit and gave it missile ability. It did 4 damage to a regular INF. Not sure where the 0.5 is from. The code does nothing to the actual damage dealt.

I guess I'm realizing I don't understand the core Civ4 battle engine. In the tests I was running, I was pitting a Warrior (strength: 2) against test missile units of strength 4, 10, and 20, and the 20-strength unit still dealt a mere maximum of 0.7 damage. Maybe that's because of what you wrote: "the defender should "lose" one man then combat over". Maybe there is some maximum damage you can deal in one round of combat? (If that were true, how do first-strike units come out of battle unscathed?)
 
MAD version 1.3b released!

Fixes crash when target city becomes invalid (by capture or razing for example).

See second post in this thread.

Dale
 
Dale said:
Fixed. Wasn't the dll, was the file Civ4MissionInfos.xml. I've attached it to the thread in the scenario forum.

Dale

I KNEW it couldn't be the DLL because it worked fine for me.

Roger Bacon
 
ok, i think i found one more bug. if you pretarget nukes and then save the game, then loading that game and resume playing it as normal, the game crashes to desktop. It crashes just at the beginnign of your next turn (when the message that your nukes are pretargeted shouldve shown), and doesnt crash if you retarget your nukes again.
 
another thing with the cruisenuke is that if another civilization's units (besides the enemy's) are in the vicinity or nukerange of the enemy's units and u cruisenuke them, ur civilization automatically declares war on them. This is less a problem for the human player, but it causes the AI to make "stupid" choices, like declare war an a good friend because the enemy's units happened to be around the friend's units when they were nuked.
 
Can a nuke be made to hit only one tile?
 
Hi Dale.

I integrated your MAD into my mod, but since that I get every turn an information about MAD targets and sound. Is there a possibility to switch off the information and the sound, or to make them triggerable?
 
Back
Top Bottom