| 03-20-2004, 07:29 AM | #1 |
How can i make a unit shoot somwhere in the direction the enemy is? Im getting boored of those artillery units always shooting in the right direction (ex. mortar). I tried many different ways but i cant make that work. Help me please. |
| 03-20-2004, 03:02 PM | #2 | |
Quote:
Easy, howwever, if you have lots of these units my method would probabbly lag. EVENTS Unit is attacked CONDITIONS Attacking unit = to (your unit type here) ACTIONS Order attacking unit to order- attack ground at a point of random polar offset to your liking(or whatever) wait (slightly shorter than the attacking unit's refire rate) Order attcking unit to order- stop That should do it, Oh by the way, hi guys, im back! |
| 03-21-2004, 02:12 AM | #3 |
I believe you'd want to roll a random integer to see if you attack and hit the unit or you just shoot and miss. That trigger would 1.) Miss 100% 2.) Fire after the attack [I think?] |
| 03-21-2004, 02:13 AM | #4 |
that trigger wont miss 100% if there is splash damage, what sprite wants is artillery units firing in the general direction of the enemy, not straight at it, hunters trigger works prefectly for this. |
| 03-21-2004, 02:15 AM | #5 |
I belive he is refering to the dumb looks of how artillery always leads it's targets correctly. He wants it to physicly miss the target completely sometimes. At least thats what it looks like to me EDIT: lol, pheonix beat me to it! |
| 03-21-2004, 03:53 AM | #6 |
o.O I have something that works... sorry, but yours does not. Event - A unit is issued order torwards an object Condition - Target object of issued order is a unit equal to true Action - Order Targeting unit to "attack - ground" position of target unit of issued order offset by (random real between 0.00 and 450.00, random real between 0.00 and 450.00). Or if you would like to get a little bit involved I am sure you could get a ratio between the distance between the target unit and the targeting unit to determine the inaccuracy rate, but I'm not going to do that here. Dont use polar offsets, that is just more work... Plus, if you used "unit is attacked" this means that the projectile has ALREADY hit the target. |
| 03-21-2004, 04:21 AM | #7 |
Are you sure? I always thought that meant that it was targeted for an attack, but had not yet fired. |
| 03-21-2004, 04:25 AM | #8 | |
Quote:
I hope it occured to you that this will affect EVERY UNIT... You need a condition signifying the unit being issued the order is of the unit-type you want to 'miss'. Polar offsets more work? What are you talking about? Polar offsets are quite simple and easy to use. Your trigger does nothing but make the attack fall short or go to far, as opposed to miss slightly to the side, or to the side AND short/long. There is nothing wrong with polar offsets. |
| 03-21-2004, 04:57 AM | #9 | |
Quote:
They are infact GODLY. |
| 03-21-2004, 05:33 AM | #10 |
Ehh, Hunter heres how i made it. EVENTS Unit- A unit is attacked CONDITIONS (Unit-type of (Attacking unit)) Equal to Mortar Team ACTIONS Unit - Order (Attacking unit) to Attack Ground ((Position of (attacked unit)) offset by 256.00 towards 0.00 degrees) Wait 3.40 seconds Unit - Order (Attacking unit) to Stop Is that right? Note: The mortar teams cooldown is 3.50 seconds |
| 03-21-2004, 05:36 AM | #11 | |
Quote:
that wont work for default "defence" attacks only for ordered ones, it will also screw up royally with spells and certain orders "Unit is attacked" is triggered when a unit is the target of an attack NOT when it is hit by the attack. |
| 03-21-2004, 05:48 AM | #12 | |
Quote:
|
| 03-23-2004, 12:44 AM | #13 |
Before you insult me, the unit type of triggering unit was simply implied, and when you list all of the things my offset does, you literally mention every spot within 450.00 of the unit. Its the same thing with polar offset. And you have the nerve to PM me telling me I am wrong. Not very smart. |
| 03-23-2004, 12:45 AM | #14 |
Oh, it works, Phoenix. Try it out. |
| 03-23-2004, 03:50 AM | #15 |
You are aware if you give it an offset that is out of the attacking units range, it'll move closer to fire. That might be an issue. |
