Posted: Fri Feb 21, 2014 2:13 pm Post subject:
How to make different weapons attacking different enemy?
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.
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. QUICK_EDIT
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. QUICK_EDIT
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.
To Madin: Yeah it really works! I tested for a whole afternoon and I think I'm satisfied
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. QUICK_EDIT
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. QUICK_EDIT
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