HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

RemoveAbilityBJ

02-20-2004, 07:21 AM#1
Toth
I want to remove a unit's ability to attack and then add back like 3 seconds later. To do so I have used UnitRemoveAbilityBJ('Aatk', GetTriggerUnit()) just fine to remove the units ability, but I can't seem to add it back with UnitAddAbilityBJ('Aatk', the same unit) where same unit is of course the one that was affected. It there another command, or am I using it wrong, or is there just no way to add it back?
02-20-2004, 07:30 AM#2
Grater
I'm also unable to add it back, it is certainitely unlike normal abilities.

I think you need to use a transformation spell or chaos abilities to transform the unit to one without an attack, or an orb ability to switch the attack on.
02-20-2004, 11:39 AM#3
Cubasis
This is actually a funny subject.

DaKaN my team member found out (fortunately for our project KDH) that one can disable attack in a funny way by doing something funny.

If i remember correctly (i don't have the map near me right now), he just removes access to "atck"...as you would with f.ex. buildings in a Campaign map (so you can't build the house). Then... the button is still shown in the command console...but clicking it does nothing... not even a target-arrow is shown. It's funny.

Anyhow, i think this affects a whole player, so if you have players using more than 1 hero/units, this might not be good for you.

And sorry for not being able to mention the exact action/function, but I remember using it a long time ago (to have a builder have basic and advanced build menus.... by Disabling and Enabling a array of buildings for him, so if he chooses advanced (a dummy skill), i'd enable all the advanced buildings, disable all teh basic buildings, and call the build menu)

Anyhow, try to find it,

Hope this helped

Cubasis
02-20-2004, 01:47 PM#4
Vexorian
Will pay 500000 imaginary dollars to blizzard if they make a disableability for unit and enablabilityforunit. (those are 2 more natives I would like to see besides ( DestroyHandle, SetUnitAbilityLevel, MorphUnit, IsUnitInvulnerable, StartSoundFromLabel, GetAbilityOrderId and a lot of other stuff.
02-20-2004, 02:51 PM#5
Cubasis
Here are the functions i was talking about earlyer:

native SetPlayerAbilityAvailable takes player whichPlayer, integer abilid, boolean avail returns nothing

And, Vex, i likely could add alot of functions to that MostWanted list, including "DestroyTrackable" (and hopefully more API functions for trackables), and some more focused Item events for weaaddar =)

Cubasis

EDIT: I notice ofcourse that DestroyHandle would work instead of DestroyTrackable, but i don't know if they'd ever implement it :P, it's VERY risky, f.ex. if i were to destroy handles like Players.....and some of the Constant-Types (less serious ofcourse, but still messy), heh.

EDIT 2: And i never really understood why, oh why, they don't allow us to save Caches on Battle.Net..... what could be bad about it? nothing that you can't already do with a Single Player map... what would it's possibilities be? ENDLESS, everything from storing players high-scores in Tower Defence maps to MMORPGs (MiniMultiplayerOnlineRPG)... anyways,,, -_-
02-20-2004, 02:57 PM#6
Biflspud
This isn't at all a useful post, but I couldn't help it:

UnitRemoveAbilityBJ
Why in the heck would you want to remove the ability to give a BJ? :ggani:
02-20-2004, 03:02 PM#7
Vexorian
UnitRemoveAbilityBJ is the blizzard.j function that calls UnitRemoveAbility

Edit: It would be so cool to be able to destroy players, but blizzard could make it to work on everything but players (I don't think there is something else that could cause problems)
02-21-2004, 03:06 PM#8
Cubasis
Esotric,

I already explained how to disable the attack and enable it later. It works pretty well, and it's also pretty cool (f.ex. the attack button is there, but pressing it does nothing, not even a targetting cursor).

here is the jass function:

native SetPlayerAbilityAvailable takes player whichPlayer, integer abilid, boolean avail returns nothing

I actually am sure that it's in GUI too, just missing the "atck" ID.

So you'd do like this:

call SetPlayerAbilityAvailable( Player(0), 'atck', false )

too disable the attack. However, as i also explained, this disables the ability for a WHOLE player, so it only works for stuff like RPGs where you only control one player. That's why Vex talked about wanting to have a SetUnitAbilityAvailable

Cubasis