Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 1:18 pm
All times are UTC + 0
How to make different weapons attacking different enemy?
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
secondwtq
Light Infantry


Joined: 26 Jun 2010
Location: China

PostPosted: Fri Feb 21, 2014 2:13 pm    Post subject:  How to make different weapons attacking different enemy? Reply with quote  Mark this post and the followings unread

I want a Generals style "Point Defense Laser" added on a tank(Predator for example), I added another WeaponSlotHardpoint with ANTI_SMALL_MISSILE as AntiMask for engaging flying missiles, while a cannon WeaponSlotTurret already set. But the tank always focus on attacking other units in game, the laser weapon rarely work.

So is PDL impossible in C&C3?

Back to top
View user's profile Send private message Send e-mail
Ju-Jin
Cyborg Firebomber


Joined: 23 Mar 2009
Location: Germany

PostPosted: Sat Mar 01, 2014 12:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Like the Obelisk use a SpecialObjectFilter to filter out everything but the missiles.

_________________

Back to top
View user's profile Send private message Skype Account
secondwtq
Light Infantry


Joined: 26 Jun 2010
Location: China

PostPosted: Sat Mar 01, 2014 6:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

I tried but the result is not very good, rockets poured to the tanks but they just did nothing except firing to soldiers and waited for death.

This is my code:

Code:

   <WeaponTemplate
      id="TestMissileJammerWeapon"
      Name="TestMissileJammerWeapon"
      ProjectileCollidesWith=""
      RadiusDamageAffects="ENEMIES NEUTRALS PROJECTILES"
      AttackRange="700.0"
      WeaponSpeed="9999"       
      AcceptableAimDelta="360d"
      FireFX="FX_NODBombHit"
      ClipSize="0"
      AutoReloadsClip="AUTO"
      CanFireWhileMoving="true"
      ReAcquireDetailType="PRE_SHOT"
      AntiMask="ANTI_SMALL_MISSILE" >
      <Nuggets>
         <ActivateLaserNugget
            Lifetime="0.1s"
            LaserId="0"
            HitGroundFX="FX_NODBombHit" >
            <SpecialObjectFilter
               Rule="NONE"
               Include="SMALL_MISSILE"/>
         </ActivateLaserNugget>
         <DamageNugget
            Damage="1000.0"
            Radius="1.0"
            DamageType="GUN"
            DeathType="BURNED"
            DamageFXType="ALIEN_ION">
            <SpecialObjectFilter
               Rule="NONE"
               Include="SMALL_MISSILE"/>
         </DamageNugget>
      </Nuggets>
   </WeaponTemplate>

Back to top
View user's profile Send private message Send e-mail
secondwtq
Light Infantry


Joined: 26 Jun 2010
Location: China

PostPosted: Fri Mar 07, 2014 2:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well I am considering an Object Creation solution for it. Creating a specific GameObject following its parent can be pretty easy, but I have not find out how to attach the spawned object to certain bone (such as the turret), and the effect would be not cool at all without it.

Back to top
View user's profile Send private message Send e-mail
Madin
Plasma Trooper


Joined: 05 Apr 2009

PostPosted: Fri Mar 07, 2014 8:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

secondwtq wrote:
Well I am considering an Object Creation solution for it. Creating a specific GameObject following its parent can be pretty easy, but I have not find out how to attach the spawned object to certain bone (such as the turret), and the effect would be not cool at all without it.


The Scrin PAC spawns a number of 'GameObjects' to specific bones. Check it out, making sure you do not miss the 'CombinedInfoModule' & 'SpawnBehavior' in the 'Behaviour' module.

Back to top
View user's profile Send private message
Ju-Jin
Cyborg Firebomber


Joined: 23 Mar 2009
Location: Germany

PostPosted: Fri Mar 07, 2014 10:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

Does your turret have its own AIUpdate? Also did you set it up as secondary weapon, not primary?

_________________

Back to top
View user's profile Send private message Skype Account
secondwtq
Light Infantry


Joined: 26 Jun 2010
Location: China

PostPosted: Sat Mar 08, 2014 10:50 am    Post subject: Reply with quote  Mark this post and the followings unread

To Ju-Jin: I used Golan's Titan for test (for it has a HierarchicalTurret structure for Smoke Emitter) and replaced the dummy weapon for Smoke Emitter with the PDL weapon, it has PRIMARY_WEAPON set, and it also has a TurretAITargetChooserData.


Code:

<WeaponSetUpdate
            id="ModuleTag_WeaponSetUpdate">
            <WeaponSlotHierarchicalTurret
               ID="1"
               ParentID="2">
               <Weapon
                  Ordering="PRIMARY_WEAPON"
                  Template="TestMissileJammerWeapon" />
               <TurretSettings
                  TurretTurnRate="90"
                  TurretPitchRate="40"
                  AllowsPitch="true"
                  MinimumPitch="25d"
                  MaxDeflectionAntiClockwise="180d"
                  MaxDeflectionClockwise="180d"
                  MinIdleScanTime="1.0s"
                  MaxIdleScanTime="5.0s"
                  MinIdleScanAngle="0.0"
                  MaxIdleScanAngle="90.0">
                  <TurretAITargetChooserData
                     CanPickDynamicTargets="true"
                     CanAcquireDynamicIfAssignedOutOfRange="true" />
               </TurretSettings>
            </WeaponSlotHierarchicalTurret>
            <WeaponSlotHierarchicalTurret
               ID="2"
               AllowInterleavedFiring="false"
               InterleavedStyle="INTERLEAVE_FIRST_AVAILABLE"
               WeaponChoiceCriteria="PREFER_MOST_DAMAGE">
               <Weapon
                  Ordering="PRIMARY_WEAPON"
                  Template="GDITitanEPPCannon" />
               <TurretSettings
                  TurretTurnRate="90"
                  TurretPitchRate="40"
                  AllowsPitch="true"
                  MinIdleScanTime="1.0s"
                  MaxIdleScanTime="5.0s"
                  MinIdleScanAngle="0.0"
                  MaxIdleScanAngle="60.0">
                  <TurretAITargetChooserData
                     CanAcquireDynamicIfAssignedOutOfRange="true" />
               </TurretSettings>
            </WeaponSlotHierarchicalTurret>
         </WeaponSetUpdate>



To Madin: Yeah it really works! I tested for a whole afternoon and I think I'm satisfied Very Happy

But it seems the spawned object is just following the parent object, not the bone. If the turret rotates, the child donot follow it, its position and rotation depends only on the body of parent, rather than the turret or any bone. Fortunately in C&C3, the body and turret of a unit is usually in the same direction. It's hard to see the turret rotates but body not follow except in moving.

Edit: I'm also wondering that, is it possible to make a spawned&combined unit attackable by other units? If a spawned unit is set CombineOnCreate="true", it seems to be invulnerable unless the parent died. But it would be very cool to make a "modular weapon" with it.

Back to top
View user's profile Send private message Send e-mail
Beethoven
Vehicle Driver


Joined: 05 May 2015

PostPosted: Sat May 09, 2015 6:55 am    Post subject: Reply with quote  Mark this post and the followings unread

weapons can target separately if they cant access one target.

for example if one weapon can only target air and another weapon can only target ground. and if both targets exist then they can fire separately.
also when turrets have MaxDeflectionClockwise and MinDeflectionClockwise limited or two weapons have different range or when they have different type of target

note that AllowInterleavedFiring must be true.
and all weapons must be primary with different slot id.

Back to top
View user's profile Send private message
tony71
Civilian


Joined: 02 Jul 2017
Location: Montreal

PostPosted: Sun Jul 02, 2017 9:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

To Xerox45: Yeah it really sucks! I tested for a whole afternoon and I think I'm satisfied Very Happy

But it seems the spawned object is just following the destroyer before it actually flies down

_________________
cqmiMontreal

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1437s ][ Queries: 11 (0.0072s) ][ Debug on ]