 |
Forum Info
|
 |
Forum Members: 18,537
Total Threads: 8,626
Posts: 94,205
Administrators:
DeeZire, Redemption
There are currently 113 users online.
|
 |
Partner Links
|
 |
 |
Advertisements
|
 |
|
| Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here. |
09-11-2003, 01:15 PM
|
#1 (permalink)
|
|
Senior Member
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
|
Auto-choosing weapons problem (SOLVED)
I have made a variety of the overlord which has the standard main gun as primary weapon but a HE missile as secondary weapon. It is supposed to use its gun against vehicles and buildings, but the missile against aircraft and infantry. If you remember the C&C Mammoth Tank, this one is very similar. Here's the code:
Code:
WeaponSet
Conditions = None
Weapon = PRIMARY OverlordTankGun
PreferredAgainst = PRIMARY VEHICLE STRUCTURE
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
Weapon = SECONDARY MammothTuskMissile
PreferredAgainst = SECONDARY INFANTRY AIRCRAFT
AutoChooseSources = SECONDARY FROM_PLAYER FROM_SCRIPT FROM_AI
End
The problem is, with the current setup, the tank will use both the guns and the missiles simultaniously, no matter what the target is (except aircraft, as the gun is not capable of targeting them). So how do I get it to use missiles against infantry and aircraft and guns against vehicles and buildings?
|
|
|
09-11-2003, 03:09 PM
|
#2 (permalink)
|
|
Senior Member
Join Date: Mar 2003
Location: USA
Posts: 452
|
i dont think you can. since Anti_ground in the weapons section means all types of ground, infantry, buildings, and the like.
You can force it to target aircraft with the missiles as its primary targets.
Just put the Aircraft under the primary preferred against.
The tank is going to try to use the cannon against planes primarily, but since it can't it will automatically resort to its AA weapon.
So itll attack air threats first, then ground threats... but thats all you can do.
If you could make damage types, you could do something about that, but you cant.
|
|
|
09-11-2003, 03:23 PM
|
#3 (permalink)
|
|
Senior Member
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
|
But the comanche doesn't attack infantry with its rockets so it must be possible to do it with this tank! The comanche uses almost the same code, take a look and you'll see what I mean.
But the way you say it, it sounds like PreferredAgainst = PRIMARY VEHICLE STRUCTURE and PreferredAgainst = SECONDARY INFANTRY AIRCRAFT means vehicles and structures are its primary targets, and infantry and aircraft are its secondary targets. But AFAIK, it means that its supposed to use its primary weapon against vehicles and structures, and its secondary weapon against infantry and aircraft. And the latter is what I want it to do, but it won't. So what am I missing here?
|
|
|
09-11-2003, 03:53 PM
|
#4 (permalink)
|
|
Senior Member
Join Date: Mar 2003
Location: USA
Posts: 452
|
I dont know how exactly the primary secondary thing works. If you look at the gattling building, youll see it's primary weapon is preffered against aircraft, except that the primary weapon can't attack aircraft.
So... im not sure how it works exactly.
As for the comanche weapon, the only thing i see that could maybe do the targetting would be:
Quote:
|
AntiAirborneInfantry = No
|
but i doubt that that would work.
meh... meh i say...
|
|
|
09-11-2003, 04:14 PM
|
#5 (permalink)
|
|
Senior Member
Join Date: Aug 2003
Location: USA
Posts: 302
|
Just a thought, in the BattleMech mod I edited a mech to use it's cannon on vehicles only and its machine gun on infantry and I think it went like this:
Primary HumveeGun2
Preferred against infantry
Secondary AC-10 (cannon)
preferred against vehicles
I'm not sure how, but it only attacks vehicles with its cannon and infantry with its guns.
|
|
|
09-12-2003, 03:47 PM
|
#6 (permalink)
|
|
Senior Member
Join Date: Dec 2002
Posts: 1,031
|
Don't let the missile damage vehicles. See the warhead of the Comanche_Vulcan.
|
|
|
09-14-2003, 02:42 PM
|
#7 (permalink)
|
|
Senior Member
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
|
Quote:
|
Originally Posted by Phoib
Don't let the missile damage vehicles. See the warhead of the Comanche_Vulcan.
|
Both COMANCHE_VULCAN and JET_MISSILE, used by the comanche, can damage both infantry and vehicles. So this couldn't be what gets it to work. And BTW, the tank's gun uses ARMOR_PIERCING and the rockets use EXPLOSION, both are also in use for other weapons. I haven't got any free damage types left so this means I can't set the damage to 0% cause it will affect all the other units as well.
So is there anyone else that can explain this or help me out? Dee perhaps?
|
|
|
09-14-2003, 04:12 PM
|
#8 (permalink)
|
|
Member
Join Date: Feb 2003
Location: not really shure
Posts: 74
|
just a thought here
why would anyone use a whole missile against soldiers
get a machine gun instead
its easier to that way,
give the cannons AntiGround = Yes and everything else is No
give the cannons a DamageType which does not damage infantry in their Armor specifications (you might need to go to Armor.ini)
give the machinegun AntiGround = Yes and AntiAirborneInfantry = Yes
give it a DamageType that only damages infantry (sort of like the ComancheVulcan)
finally, give the missiles AntiAirborneVehicle = Yes, with a DamageType that affects either everything or just vehicles
|
|
|
09-14-2003, 04:55 PM
|
#9 (permalink)
|
|
Senior Member
Join Date: Mar 2003
Location: UK
Posts: 676
|
I'm not sure if this is what you mean, but your problem may lie in the Weapon Ranges. If you look at the Comanche weapons they both have the same range. I have been having problems with this as well. I made a tank with a massive long range railgun for anti-tank and a machinegun thing for infantry. The tank would fire the railgun at infantry a long way away as it could reach them and the gun couldn't, overriding the PreferredAgainst. (When the infantry were in range, it used the machine gun) Hope this helps 
|
|
|
09-15-2003, 03:04 AM
|
#10 (permalink)
|
|
Senior Member
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
|
Well, the weapons already have the same range (150) so that's not what causes it. I've tried this out though:
Code:
WeaponSet
Conditions = None
Weapon = PRIMARY OverlordTankGun
PreferredAgainst = PRIMARY VEHICLE STRUCTURE
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
Weapon = SECONDARY MammothTuskMissile
PreferredAgainst = SECONDARY INFANTRY ;AIRCRAFT
AutoChooseSources = SECONDARY FROM_PLAYER FROM_SCRIPT FROM_AI
End
So all I did was remove the AIRCRAFT parameter, and then suddenly it stopped using the cannon against infantry, like I wanted it to do. However, it still also used the rockets (as well as the cannons) against everything else, and this makes it rediculously powerful. So the rockets should not be allowed to fire on vehicles or buildings. I know I could just adjust the damage of the rockets to damage only infantry and aircraft, but I don't have any free damage types left so that's going to be hard.
EDIT: Ok, I've tried commenting out the STRUCTURE parameter like I did with the AIRCRAFT, and it attacked vehicles with the cannon only. So it seems the game doesn't parse the line properly if there is more than one parameter. This also explains how the comanche does it. However, I want it to attack BOTH vehicles and structures with only the cannons. So I'm kinda stuck here.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:44 PM.
|