Crash when attacking with a new unit

silverjaded

Chieftain
Joined
Jul 20, 2007
Messages
21
Hi,

I've added a nuclear attack sub.

The code looks fine and was mostly copied from the nuclear sub.
I haven't tweaked it yet but the idea is so I can hide my boomers and give the hunter killers longer range and sight.

I'm not sure what code to post.

Any ideas?

Thanks
 
Best at least as a start to post the mod itself. See whoward69's zip your mods and attach tutorial for which version of the mod is best to attach to a post, and how to attach it. (It is the one that gets sent to your MODS folder, instead of anything contained within the folder of the ModBuddy Project)
 
Thanks.

The mod also contains a supercarrier with files and data.
 

Attachments

  • Super Carrier (v 1).zip
    364.9 KB · Views: 125
I think your main problem is likely this:
Code:
UNIT_NUCLEAR_SUBMARINE: <CombatClass>UNITCOMBAT_SUBMARINE</CombatClass>
UNIT_NUCLEAR_ATTACK_SUBMARINE: <CombatClass>UNITCOMBAT_NAVAL</CombatClass>
I also found a couple of other things I think you need to look at:
Code:
		<Row>
			<UnitType>UNIT_NUCLEAR_SUBMARINE</UnitType>
			<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_NUCLEAR_SUBMARINE</UnitType>
			<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_NUCLEAR_SUBMARINE</UnitType>
			<UnitAIType>UNITAI_EXPLORE_SEA</UnitAIType>
		</Row>
		<Row>
			<UnitType>UNIT_NUCLEAR_SUBMARINE</UnitType>
			<UnitAIType>UNITAI_MISSILE_CARRIER_SEA</UnitAIType>
		</Row>
In comparison to your unit:
Code:
	<Unit_AITypes>
		<Row>
			<UnitType>UNIT_NUCLEAR_ATTACK_SUBMARINE</UnitType>
			<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
		</Row>
	</Unit_AITypes>
This really needs to be an <Update> because the game really doesn't like multiple-choice too much (doing this would tend to want to add UNITCLASS_NUCLEAR_ATTACK_SUBMARINE as an upgrade option since the game already has an update path for UNIT_SUBMARINE):
Code:
	<Unit_ClassUpgrades>
		<Row>
			<UnitType>UNIT_SUBMARINE</UnitType>
			<UnitClassType>UNITCLASS_NUCLEAR_ATTACK_SUBMARINE</UnitClassType>
		</Row>
	</Unit_ClassUpgrades>
Both the stock submarine units have this promotion, whereas your unit does not:
Code:
		<Row>
			<UnitType>UNIT_NUCLEAR_SUBMARINE</UnitType>
			<PromotionType>PROMOTION_SILENT_HUNTER</PromotionType>
		</Row>
 
You legend!

That fixed it straight away.
Though I don't know how half of what you mentioned was the case.

I coped the data from the original and edited what I needed.

Oh well, thanks again!
 
Top Bottom