Jump to content


Photo

Strange infantry unit problem?


  • Please log in to reply
5 replies to this topic

#1 Boomerang Python

Boomerang Python

    Only War Mod Leader

  • Hosted
  • 2,370 posts
  • Location:Umeå, Sweden
  • Projects:Only War, Only War 2
  •  Colonel-Commissar

Posted 08 July 2009 - 04:30 PM

Alright here's another problem for you, basically, I've got a new infantry unit ingame and its using a laser weapon, however the problem is that
when it targets something and starts shooting at it, the actual projectiles wont hit the enemy unit it will only hit the ground underneath it instead, whats even weirder is that
when I put in a squad of GDI riflemen for testing purposes, so i figured i'd see if they could hit one of my new infantry units and strangely they could not, they would only shoot at its feet.
I should mention that my new infantry unit can hit buildings and tanks..

So what might I be missing? Hitboxes, hitbones, something in the code?

Cheers, Boomer.
My DeviantArt - Check it out.
Posted Image
My Wii code: 6472 3114 4930 8707

"Om du kan stå, när alla andra sviktar
och sen klandras du för att just du står rak
Om du kan tro på ditt när andra riktar
sitt välbekanta tvivel mot din sak

Om var minut av nitti sen kan fyllas
med verk av dig som giltigt räknats ner
min vän, som jordens konung ska du hyllas
men du är också man, och det är mer."

#2 Stygs

Stygs
  • Members
  • 99 posts

Posted 09 July 2009 - 10:32 AM

That happens because most infantry (or most unit in CNC3) are missing their ContactPoint. ContactPoint are used to determine where a unit is hit when attacked by other units. You can either define ContactPoint in the unit itself (just like EA did for most buildings) or use ContactPointGeneration:

<Geometry
	IsSmall="true">
	<Shape
		Type="CYLINDER"
		MajorRadius="7.0"
		Height="13.0"
		ContactPointGeneration="INFANTRY" />
</Geometry>

It generates random ContactPoint on the unit.
Advaible choices are:
NONE, VEHICLE, STRUCTURE, INFANTRY, SQUAD_MEMBER (no idea how thats different from INFANTRY)

Edited by Stygs, 09 July 2009 - 10:36 AM.


#3 Boomerang Python

Boomerang Python

    Only War Mod Leader

  • Hosted
  • 2,370 posts
  • Location:Umeå, Sweden
  • Projects:Only War, Only War 2
  •  Colonel-Commissar

Posted 09 July 2009 - 06:24 PM

Hmm, it already had one of those, except it was missing the ContactPointGeneration="INFANTRY" bit, however that still didn't fix it..

Is there something related to the weapon being a laser perhaps?

here's to code anyway, if someone might wanna check through it while theyre bored or something :p

CODE
<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/20...chema-instance" xmlns:xi="http://www.w3.org/20...2001/XInclude">
<Tags></Tags>
<Includes>
<Include
type="all"
source="ART:IIGuardsmen_SKN.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_SKL.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_IDLA.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_IDLB.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_IDLC.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_DTA.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_DTB.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_MVE.w3x" />
<Include
type="all"
source="ART:IIGuardsmen_ATK.w3x" />

<Include
type="all"
source="ART:FXObeliskLaser.xml" />
<Include
type="all"
source="ART:FXLaserOverlay.xml" />
<!-- Base Object -->
<Include
type="instance"
source="DATA:BaseObjects/BaseInfantry.xml" />
</Includes>
<GameObject
id="ImperialGuardsmen"
inheritFrom="BaseInfantry"
SelectPortrait="Portrait_ImperialGuardsmanCameo"
ButtonImage="Portrait_ImperialGuardsmanCameo"
Side="ImperialGuard"
EditorSorting="UNIT"
TransportSlotCount="1"
BuildCost="100"
BuildTime="2"
CommandSet="EmptyCommandSet"
KindOf="PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_INFANTRY CAN_SHOOT_OVER_WALLS"
RadarPriority="UNIT"
ThreatLevel="10"
ProductionQueueType="INFANTRY"
UnitCategory="INFANTRY"
WeaponCategory="GUN"
VoicePriority="88"
EditorName="ImperialGuardsmen"
Description="Desc:ImperialGuardsmen"
TypeDescription="TYPE:ImperialGuardsmen">
<DisplayName
xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">NAME:ImperialGuardsmen</DisplayName>
<ArmorSet
Armor="ImperialGuardsmenArmor"
DamageFX="InfantryDamageFX" />
<LocomotorSet
Locomotor="HumanLocomotor"
Condition="NORMAL"
Speed="50" />
<SkirmishAIInformation
UnitBuilderStandardCombatUnit="true" />
<Draws>
<scriptedModelDraw
id="ModuleTag_Draw"
OkToChangeModelColor="true">
<ModelConditionState
ParseCondStateType="PARSE_DEFAULT">
<Model
Name="IIGuardsmen_SKN" />
<WeaponFireFXBone
WeaponSlotType="PRIMARY_WEAPON"
BoneName="BoneMuzzle" />
<WeaponRecoilBone
WeaponSlotType="PRIMARY_WEAPON"
BoneName="" />
<WeaponMuzzleFlash
WeaponSlotType="PRIMARY_WEAPON"
BoneName="" />
<WeaponLaunchBone
WeaponSlotType="PRIMARY_WEAPON"
BoneName="BoneMuzzle" />
</ModelConditionState>
<xi:include
href="DATA:Includes/GDIUnitFormationPreviewStates.xml"
xpointer="xmlns(n=uri:ea.com:eala:asset) xpointer(/n:FormationPreviewStates/child::*)" />
<!-- invisible when garrisoned -->
<ModelConditionState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="INSIDE_GARRISON">
<Model
Name="" />
<WeaponLaunchBone
WeaponSlotType="PRIMARY_WEAPON"
BoneName="" />
</ModelConditionState>
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="INSIDE_GARRISON">
<!-- no anim -->
</AnimationState>
<AnimationState
ParseCondStateType="PARSE_DEFAULT"
Flags="RESTART_ANIM_WHEN_COMPLETE"
AllowRepeatInRandomPick="true"
StateName="STATE_Idle">
<Animation
AnimationName="IIGuardsmen_IDLA"
AnimationMode="ONCE"
AnimationPriority="50" />
<Animation
AnimationName="IIGuardsmen_IDLB"
AnimationMode="ONCE"
AnimationPriority="45" />
<Animation
AnimationName="IIGuardsmen_IDLC"
AnimationMode="ONCE"
AnimationPriority="5" />
</AnimationState>

<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="STUNNED_FLAILING"
StateName="STATE_stunned_flailing">
<Animation
AnimationName="EULoRWar_FLYA"
AnimationMode="LOOP" />
</AnimationState>
<AnimationState
ParseCondStateType="PARSE_NORMAL"
StateName="STATE_stunned_landing">
<Animation
AnimationName="EULorWar_LNDA"
AnimationMode="ONCE" />
</AnimationState>
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="DYING">
<Animation
AnimationName="IIGuardsmen_DTA"
AnimationMode="ONCE" />
<Animation
AnimationName="IIGuardsmen_DTB"
AnimationMode="ONCE" />
</AnimationState>

<!-- ATTACKING -->
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="FIRING_OR_PREATTACK_A">
<Animation
AnimationName="IIGuardsmen_ATK"
AnimationMode="ONCE" />
</AnimationState>
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="USING_WEAPON_A">
<Animation
AnimationName="IIGuardsmen_ATK"
AnimationMode="MANUAL" />
</AnimationState>

<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="MOVING"
StateName="STATE_Moving">
<Animation
AnimationName="IIGuardsmen_MVE"
AnimationMode="LOOP"/>
</AnimationState>

<!-- SELECTED -->
<AnimationState
ParseCondStateType="PARSE_NORMAL"
ConditionsYes="SELECTED"
Flags="RESTART_ANIM_WHEN_COMPLETE"
StateName="STATE_SelectedPose">
<Animation
AnimationName="IIGuardsmen_IDLA"
AnimationMode="ONCE"
AnimationPriority="50" />
<Animation
AnimationName="IIGuardsmen_IDLB"
AnimationMode="ONCE"
AnimationPriority="25" />
<Animation
AnimationName="IIGuardsmen_IDLC"
AnimationMode="ONCE"
AnimationPriority="25" />
</AnimationState>
</ScriptedModelDraw>
<LaserDraw
id="ModuleTag_LaserDraw"
Texture1_UTile="1"
Texture1_VTile=".5"
Texture1_UScrollRate="0"
Texture1_VScrollRate=".2"
Texture1_NumFrames="1"
Texture1_FrameRate="30"
Texture2_UTile="1"
Texture2_VTile=".03"
Texture2_UScrollRate="0"
Texture2_VScrollRate="1"
Texture2_NumFrames="1"
Texture2_FrameRate="30"
LaserWidth="2"
LaserStateID="1">
<FXShader
ShaderName="Laser.fx"
TechniqueIndex="0">
<Constants>
<Texture
Name="Texture1">
<Value>FXObeliskLaser</Value>
</Texture>
<Texture
Name="Texture2">
<Value>FXLaserOverlay</Value>
</Texture>
</Constants>
</FXShader>
</LaserDraw>
</Draws>
<Behaviors>
<WeaponSetUpdate
id="ModuleTag_WeaponSetUpdate">
<WeaponSlotHardpoint
ID="1">
<Weapon
Ordering="PRIMARY_WEAPON"
Template="ImperialGuardLasgun" />
</WeaponSlotHardpoint>
</WeaponSetUpdate>
<LaserState
id="ModuleTag_LaserState"
LaserId="1" />
<Physics
id="ModuleTag_Physics" />
<StancesBehavior
id="ModuleTag_Stance"
StanceTemplate="Generic" />
<SlowDeath
id="ModuleTag_Death"
SinkDelay="10s"
SinkRate="2.4"
DestructionDelay="4.5s">
<DieMuxData
DeathTypes="ALL" />
<Sound
Type="INITIAL"
List="GDI_Generic_VoiceDieMS" />
</SlowDeath>
<LargeGroupAudioUpdate
id="LGAU">
<Key>GDI_GrenadierSoldier</Key>
</LargeGroupAudioUpdate>
<AudioLoopUpgrade
id="Generic_Infantry_Upgrade"
SoundToPlay="Generic_Infantry_Upgrade">
<TriggeredBy>Upgrade_GDICompositeArmor</TriggeredBy>
</AudioLoopUpgrade>
</Behaviors>
<AI>
<AIUpdate
id="ModuleTag_AI"
AutoAcquireEnemiesWhenIdle="YES">
<UnitAITargetChooserData
IdleScanDelay="0.3s"
ReacquireDelay="0.3s"
CanPickDynamicTargets="true"
/>
</AIUpdate>
</AI>
<Body>
<ActiveBody
id="ModuleTag_Body"
MaxHealth="8000" />
</Body>
<Geometry
IsSmall="true">
<Shape
Type="CYLINDER"
MajorRadius="4.0"
Height="13.0"
ContactPointGeneration="SQUAD_MEMBER"
/>
</Geometry>
<AudioArrayVoice>
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceAttack"
AudioType="voiceAttack" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceAttackBuilding"
AudioType="voiceAttackGarrisonedStructure" />
<AudioEntry
Sound="GDI_ElvenWarrior_VoiceCreate"
AudioType="voiceCreated" />
<AudioEntry
Sound="GDI_ElvenWarrior_VoiceCreate"
AudioType="voiceFullyCreated" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceGarrison"
AudioType="voiceGarrison" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceMove"
AudioType="voiceMove" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceMoveAttack"
AudioType="voiceAttackAfterMoving" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceRetreat"
AudioType="voiceRetreatToCastle" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceSelectMS"
AudioType="voiceSelect" />
<AudioEntry
Sound="GDI_GrenadierSoldier_VoiceSelectBattleMS"
AudioType="voiceSelectBattle" />
</AudioArrayVoice>
<!--
GDI_GrenadierSoldier_VoiceSuppress
-->
<!--
<AudioArraySound>
<AudioEntry Sound="AudioEvent:TEMP_PredatorMoveStart" AudioType="soundMoveStart" />
<AudioEntry Sound="AudioEvent:PredatorAmbientLoop" AudioType="soundAmbient" />
</AudioArraySound>
-->
<ShadowInfo
Type="DECAL"
SizeX="14"
SizeY="14"
Texture="ShadowI" />
<VisionInfo
VisionRange="350"
ShroudClearingRange="400" />
<CrusherInfo
CrushableLevel="4"/>
</GameObject>
</AssetDeclaration>


Thanks in advance for your time.
My DeviantArt - Check it out.
Posted Image
My Wii code: 6472 3114 4930 8707

"Om du kan stå, när alla andra sviktar
och sen klandras du för att just du står rak
Om du kan tro på ditt när andra riktar
sitt välbekanta tvivel mot din sak

Om var minut av nitti sen kan fyllas
med verk av dig som giltigt räknats ner
min vän, som jordens konung ska du hyllas
men du är också man, och det är mer."

#4 CommieDog

CommieDog
  • Project Team
  • 81 posts
  • Location:Alaska (where even gravity is bigger)

Posted 10 July 2009 - 01:58 PM

You mention that the unit has a laser weapon, but then you say that it's shooting projectiles. It seems to me that you're best off removing the projectiles from the weapon.
CommieDog™: The Original Proletarian Pet
Learn from your parents' mistakes: use birth control.

#5 Boomerang Python

Boomerang Python

    Only War Mod Leader

  • Hosted
  • 2,370 posts
  • Location:Umeå, Sweden
  • Projects:Only War, Only War 2
  •  Colonel-Commissar

Posted 10 July 2009 - 08:38 PM

well, i didnt actually mean to say projectiles, i meant to say that the laser beams targeted the ground underneath the target...

still haven't been able to figure this out

Edited by Boomerang Python, 11 July 2009 - 11:09 PM.

My DeviantArt - Check it out.
Posted Image
My Wii code: 6472 3114 4930 8707

"Om du kan stå, när alla andra sviktar
och sen klandras du för att just du står rak
Om du kan tro på ditt när andra riktar
sitt välbekanta tvivel mot din sak

Om var minut av nitti sen kan fyllas
med verk av dig som giltigt räknats ner
min vän, som jordens konung ska du hyllas
men du är också man, och det är mer."

#6 Boomerang Python

Boomerang Python

    Only War Mod Leader

  • Hosted
  • 2,370 posts
  • Location:Umeå, Sweden
  • Projects:Only War, Only War 2
  •  Colonel-Commissar

Posted 17 July 2009 - 03:57 PM

Okay so I've managed to work around this problem somehow by just recoding/editing the NOD Commando, must have missed some minor bits in the code.
Thanks for your suggestions though.
My DeviantArt - Check it out.
Posted Image
My Wii code: 6472 3114 4930 8707

"Om du kan stå, när alla andra sviktar
och sen klandras du för att just du står rak
Om du kan tro på ditt när andra riktar
sitt välbekanta tvivel mot din sak

Om var minut av nitti sen kan fyllas
med verk av dig som giltigt räknats ner
min vän, som jordens konung ska du hyllas
men du är också man, och det är mer."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users