• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Remove build ability and give it back later in game?

Status
Not open for further replies.
Level 14
Joined
Jul 1, 2008
Messages
1,314
Good evening ladies and gentlemen,

Is there some way to give back the ability "build - humans" to a unit, from which it has been taken away ingame before by "Unit - Remove Ability"?

Somehow I can remove it but not give it back by the reverse action ....
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Can you show what you have currently?

But if it can be player specific you could always use Disable/Enable Ability For Player
Or Limit Construction of Building A-Z for player
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
Thanks for your reply, p0ke

So, what I am trying to do is have a unit with a build menu, that I can show or hide, whenever I want. As the build menu is always visible from the beginning, if you add buildings to a unit, I wanted to hide the menu initially.

What does not work for me:
- Disable build ability
- Limit Construction of all buildings (does not hide the build menue, if no buildings left)
- Impossible to add/remove buildings via triggers
- Remove the build ability. Actually, well, it works kind of, but I cannot show it again by "Unit Add Ability", after I removed it.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Okay so this could potentially work for you. However, read the whole post to understand the
"potentially" part.


This will work for you. When you transform them they can gain the build ability and when you want to take it away you transform them back and remove it.
Hero passive transformation

What you would do is you would follow the directions here and you would have 2 forms of your unit, one that can build and one that does not have the build ability i.e builds no structures.

However, when I tested the unit retained the build ability and it was just an empty menu. But everything else about it was working as wanted.

This doesn't get us anywhere though as it's pretty much the same as denying construction of particular buildings.

But, if you are saying you've had success removing the build ability. This gets much better as a solution because we want the build ability removed.

What Ability ID does build have?


Edit: Did some digging, using this trigger I was able to get what you wanted to happen.

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set TempUnit = Peasant 0001 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Equal to 0
        • Then - Actions
          • Set TempInt = 1
          • Unit - Add Transformation 1->2 to TempUnit
          • Unit - Remove Transformation 1->2 from TempUnit
        • Else - Actions
          • Set TempInt = 0
          • Unit - Add Transformation 2->1 to TempUnit
          • Unit - Remove Transformation 2->1 from TempUnit
          • Custom script: call UnitRemoveAbility(udg_TempUnit, 'AHbu')
 
Last edited:
Level 14
Joined
Jul 1, 2008
Messages
1,314
hey p0ke,

thank you very much for your time and attempt to help me! Actually, your idea is quite smart and it works fine, when I test it as well.

The problem is, I already use this very same bear form trick to change between a non-combat and combat form of this hero, so it could become quite chaotic - anyway possible at least so thanks for your input :)

While this being a nice work-around, the question remains, if someone knows if

I can add the build ability in game again after removing it before?
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
If you can find an abilityid for it (no idea what build's ID is and google isn't helpful) try temporarily disabling the build ability for owner of the unit. Won't work if you want some units to be able to build and some not to, but if there is only one builder or every builder for a player is affected at once that might do it.

You could also try catching when a unit is issued the order with no target "851994" (open build menu) and order the unit to stop.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
Hey Pyrogasm, thanks for trying to help me but please try to read the posts above you. Disabling does not work, when I try to. Or did I not undestand you and you do know, how to disable the build ability?
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Disabling an ability for a player is different that removing it for a unit. It 'hides' the ability from every unit owned by the player and doesn't allow casting of it, but you still can order it through triggers because the units still have the ability... the player just can't see it to click on it or use its hotkey. If you disable Ensnare for someone playing orc, all current Raiders and every future raider they build will not show Ensnare on its command card but they'll still 'have' the ability.

  • Player - Disable <Ability> for Player(1)
But Build doesn't show up in the list of <Ability>s. You'll have to find its rawcode (like 'Aloc' or whatever) somehow and disable that. Google and you might find it but I couldn't in 3 minutes of searching.

Did you try catching the order and ordering the unit to stop? There might also be an order to close the build menu, so I would check that too.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
*sigh*
dude .... I dont know what to say about this.
did you read even a single word from above? :confused:2
or am I an idiot and do not understand you completely??
well, thanks anyway for your elaboration on Disabling abilities, I guess .... but It does not work (which I stated above a few times).

Anyway, the question is simply:

Is there a way to add the build ability in game again after having removed it before by "Unit - Remove Ability"?

I dont want to be rude, but please dont spam...
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,010
Sorry I was 100% sure both times I posted that you had not even mentioned disabling it. If you can't catch the order to open build menu and disabling doesn't work then there is no way to do this other than morphing the unit. Maaaaaybe with tinker upgrades?
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
hey there, sorry I think I sounded too rude!
thanks for your input :)

well, as I wrote, I initially want to hide the menue and then show it or hide it later dynamically, if needed. The order trick will not help me with that so I did not try it.
I dont get it why disabling does not work, but removing does ... Must be hardcoded ..

anyway, morphing it using the bear form as suggested by p0ke works and has no side effects, so I wont risk the tinker upgrades, but thanks. It would be less chaotic though to be simply able to hide that damn ability when I need to ..
 
Status
Not open for further replies.
Top