| 10-05-2007, 04:16 PM | #1 |
Okay, it's me again. Sorry I've been full of so many questions these days. So after looking at a post about a week ago about enabling/disabling attacks, I decided I wanted to give it a shot. It was said in the post that by adding the item abilities from orbs like orb of lightning, you can enable a units "Attack 2". Though it does apparently work with letting melee units attack air, I can't find any other change that doing that ability will allow, such as changing the damage type, splash damage, or even the amount of damage itself. It just goes off of the "Attack 1" stats. So I figure its because "Attack 1" has to be disabled, but is that even possible? Am I doing something wrong here? Has anyone else gotten this concept to work? |
| 10-05-2007, 05:08 PM | #2 |
You could use an upgrade to do it. I've never messed with enabling/disabling attacks with orbs, so I guess I'm not much help. |
| 10-05-2007, 06:01 PM | #3 |
Make the unit have no attacks enabled my default. Then add an orb ability which enables attack 1 to all your units. When you want to switch to attack 2, remove that orb and add your attack 2 one. |
| 10-07-2007, 05:33 PM | #4 |
You can also enable both attack type, and use the ability Drunken Haze to disable attack 1 or attack 2. But the way with the orbs is easy |
| 10-09-2007, 02:03 AM | #5 | |||
Hmm... well either I'm doing something wrong or you guys are just throwing out ideas that should logically work but don't. Quote:
Well, yeah, that would allow me to permanently change the units attack type, but in my case I would like to enable the second attack by using an ability and only for a certain duration. However, if someone knows a way to downgrade an upgrade through some custom code (given that you can't in the GUI) that would work great! Quote:
Seems like it should work, but I just can't pull it off. If I disable both attacks and add an orb ability that has its "Enabled Attack Index" set to 1, it will only enable Attack 2!!! What's up with that?!?! Quote:
Can't use drunken haze to disable attacks, only attack types such as melee, ranged, spells, etc. Though I guess I could make his Attack 2 melee... <Sigh> Oh well, I've been trying all weekend to get this to work to no avail. Actually, I did randomly get it working by using a combination of upgrades and orb abilities, but it turned out to be very undendable. I think the upgrades approach is the best way to go, but like I mentioned above, I haven't figured out a way to un-research upgrades in order to enable/disable attacks. So if any JASS coder knows a way to do it, please tell! |
| 10-09-2007, 03:38 AM | #6 |
Not sure if it works, but can't you have a unit as a requirement of the upgrade, and remove the unit when you don't want it anymore? |
| 10-09-2007, 06:10 AM | #7 |
Well, it looks like I got it working as good as it can for now. I ended up using 2 upgrades, one to use only Attack 1 and the other Attack 2. To start, the unit doesn't have any attacks enabled, but upon initialization recieves the first Attack 1 research. Then, when the ability is used, Attack 2 is researched, when its duration is completed, Attack 1 is researched again to the next highest level, and so forth... The only obvious problem is that there is a max upgrade level of 100, so I guess I'll either have to find a way to recycle the upgrade levels or just have to deal with the fact that the ability can only be used up to 100 times. Tomorow I'm going to work on it some more cuz I think there might be a way for me to just alternate between levels 1 and 0 for each upgrade, even though you technically can't "downgrade." Guess I'll keep ya posted just in case someone else is thinking of implementing this in their map... |
