Jump to content
Stygs

Objectfilter on FireOnObjectsNugget?

Recommended Posts

After a short break, I am back to CNC modding and ran instantly into a problem >_>

One of my units has an abillty that uses WeaponFireSpecialAbilityUpdate to fire an attributmodifer on every enemy in a certain radius (its just fires at its own position and has a huge radius).
That worked fine.

Now I wanted to use FireOnObjectsNugget to fire another weapon on all enemys but as soon as I use "Relationship="ENEMIES NEUTRAL"" as filter, it stops working.

	<WeaponTemplate
		id="ScrinCorruptorToxicSuicideBomb">
		<Nuggets>
			<AttributeModifierNugget
				PartitionFilterTestType="SPHERE"
				AttributeModifierName="AttributeModifier_CorruptorToxicBomb"
				Radius="300" >
				<SpecialObjectFilter
					Rule="ANY"
					Relationship="ENEMIES NEUTRAL"
					Include="INFANTRY VEHICLE"
					Exclude="AIRCRAFT">
					<xi:include
						href="DATA:Includes/Filter/Commandos.xml"
						xpointer="xmlns(n=uri:ea.com:eala:asset) xpointer(/n:ObjectFilter/n:Exclude/child::*)" />
					<xi:include
						href="DATA:Includes/Filter/Epics.xml"
						xpointer="xmlns(n=uri:ea.com:eala:asset) xpointer(/n:ObjectFilter/n:Exclude/child::*)" />
				</SpecialObjectFilter>
			</AttributeModifierNugget>
			<FireOnObjectsNugget
				Radius="300.0"
				Weapon="AlienCorruptorContaminate">
				<Filter
					Rule="ANY"
					Relationship="ENEMIES NEUTRAL"
					Include="INFANTRY VEHICLE"
					Exclude="AIRCRAFT">
					<xi:include
						href="DATA:Includes/Filter/Commandos.xml"
						xpointer="xmlns(n=uri:ea.com:eala:asset) xpointer(/n:ObjectFilter/n:Exclude/child::*)" />
					<xi:include
						href="DATA:Includes/Filter/Epics.xml"
						xpointer="xmlns(n=uri:ea.com:eala:asset) xpointer(/n:ObjectFilter/n:Exclude/child::*)" />
				</Filter>
			</FireOnObjectsNugget>
		</Nuggets>
	</WeaponTemplate>

 

The Attributmodifer works fine, but the filter on FireOnObjectsNugget stops working as soon as I add a Relationship entry and I dont understand why :(

Any other idea how I can prevent AlienCorruptorContaminate from firing on alied units? (SpecialObjectFilter doenst seem to have any effect on it).

Edited by Stygs

Share this post


Link to post

Fire an AttributeModifierNugget on allied which gives a status to them. Then exclude this status from being attacked. I've done something equal once to disable the enemy ai without affecting allied ai (see my source code).

As status you can use "CAN_ATTACK". I know most units should actually have that status already but somehow it works nevertheless.

 

Example:

	<WeaponTemplate
		id="ProtectorWeapon"
		Name="ProtectorWeapon"
		RadiusDamageAffects="ALLIES"
		AttackRange="500000.0" 
		>
		<Nuggets>
			<AttributeModifierNugget
				Radius="500000"
				PartitionFilterTestType="SPHERE"
				AttributeModifierName="AttributeModifier_Protector">
                <SpecialObjectFilter 
				  Rule="ANY" 
				  Relationship="SAME_PLAYER"
					Include="VEHICLE HUGE_VEHICLE INFANTRY STRUCTURE AIRCRAFT">
				</SpecialObjectFilter>
			</AttributeModifierNugget>		
		</Nuggets>
	</WeaponTemplate>

	<AttributeModifier
		id="AttributeModifier_Protector"
		Category="NONE"
		ObjectStatusToSet="CAN_ATTACK"
		Duration="1.21s">
	</AttributeModifier>

And for your actual weapon use this entry:

ForbiddenTargetObjectStatus="CAN_ATTACK" 

Share this post


Link to post

Sounds good, but didnt work - if I add it to the FireOnObjectsNugget, it still fires on my own units. If I add it to the TintObjectsNugget on my AlienCorruptorContaminate weapon, the nugget stops having any effect.

 

This TintObjectsNugget stuff is just weird.

 

I used CANNOT_BE_SOLD but I kinda doubt that anothrt state would make a difference.

Edited by Stygs

Share this post


Link to post

Hm maybe it really has something to do with the type of nugget and its respective exotic behaviour. Try to duplicate it one by one from my source code. I can assure you it definitely works with at least some nuggets in KW 1.2. Also I remember there was a reason I have used "CAN_ATTACK" instead of in such cases commonly used statuses like "RIDER1". But also keep in mind that the protective status must be active as long as needed. Good Luck

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×