logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,537
Total Threads: 8,626
Posts: 94,205

Administrators:
DeeZire, Redemption

There are currently 113 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here.

Reply
 
LinkBack Thread Tools
Old 09-11-2003, 01:15 PM   #1 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default 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?
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2003, 03:09 PM   #2 (permalink)
Senior Member
 
Join Date: Mar 2003
Location: USA
Posts: 452
Default

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.
guyee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2003, 03:23 PM   #3 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

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?
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2003, 03:53 PM   #4 (permalink)
Senior Member
 
Join Date: Mar 2003
Location: USA
Posts: 452
Default

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...
guyee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2003, 04:14 PM   #5 (permalink)
Senior Member
 
Join Date: Aug 2003
Location: USA
Posts: 302
Send a message via MSN to Vengence
Default

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.
Vengence is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-12-2003, 03:47 PM   #6 (permalink)
Senior Member
 
Join Date: Dec 2002
Posts: 1,031
Send a message via ICQ to Phoib Send a message via MSN to Phoib
Default

Don't let the missile damage vehicles. See the warhead of the Comanche_Vulcan.
Phoib is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-14-2003, 02:42 PM   #7 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

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?
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-14-2003, 04:12 PM   #8 (permalink)
Member
 
Join Date: Feb 2003
Location: not really shure
Posts: 74
Send a message via ICQ to kornlord283 Send a message via AIM to kornlord283 Send a message via MSN to kornlord283
Default

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
kornlord283 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-14-2003, 04:55 PM   #9 (permalink)
Senior Member
 
Join Date: Mar 2003
Location: UK
Posts: 676
Send a message via MSN to DJRowley
Default

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
DJRowley is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-15-2003, 03:04 AM   #10 (permalink)
Senior Member
 
Join Date: May 2003
Location: Eindhoven, Netherlands
Posts: 2,278
Send a message via ICQ to CodeCat Send a message via MSN to CodeCat
Default

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.
CodeCat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AI script problem, need help!(Solved) homura Generals & Zero Hour Editing 0 06-04-2005 09:31 PM
[SOLVED] Auto Guard CodeCat Generals & Zero Hour Editing 5 03-01-2005 05:08 AM
Problem with code[solved] Silent_Killa Generals & Zero Hour Editing 10 11-02-2004 01:25 AM
Airfeild Problem[SOLVED] RedLeader Generals & Zero Hour Editing 5 08-21-2004 01:10 AM
Creating a new building problem, Dozer don't auto build... DPsygnet Generals & Zero Hour Editing 3 08-24-2003 06:44 PM


All times are GMT -4. The time now is 12:44 PM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.0 Release Candidate 2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.