• 🏆 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!

Neutral building won't stop selling a unit

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I want a neutral building that a team can use to research collective upgrades. E.g., Player 1 researches DEFEND and then I use a trigger to research it instantly for all his allies. Since neutral buildings can't research tech, I made a unit called "Defend" and when it's purchased I remove the unit and set all the Defend techs for those players to 1.

It works, but I can't get the neutral building to stop selling the dummy Defend unit. I set the cooldown for a long time, but I don't want the icon there confusing people. I used the action:

Neutral Building - Remove Defend from Imperial Command Control 0107 <gen>

But the Defend unit is still there for sale.
 
That action can only be used, if the building you are using (Imperial Command Control) has the ability "Sell units".
Since I have experienced the same problem though, do this instead; don't have the unit types added by the object editor; instead, add them with triggers.
  • Trigger1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Neutral Building - Add Defend to Imperial Command Control 0107 <gen> with 3 in stock and a max stock of 3
Now, it will be normally removed:
  • Neutral Building - Remove Defend from Imperial Command Control 0107 <gen>
 
Level 3
Joined
Jun 12, 2010
Messages
25
Better way perhaps?

Ok the Trigger looks like this: WARNING this isn't jass, i just couldnt get a decent picture of what it sez

Events:
---Unit - A unit Finishes research

Conditions:
---Or - Any (Conditions) are True
-Conditions:
-(Researched tech-type) Equal to Defend
-(Researched tech-type) Equal to Flak Cannons

Actions:
---Set TempPlayerGroup = (All Allies of (Owner of Researching)))
---Player Group -Pick every player TempPlayerGroup and do(Player - Set the current research level of (Researched Tech Type) to 1 for (Picked)
---Custom Script: call DestroyForce( udg_TempPlayerGroup) //Player Group


You do not have to look at the attachment, its just a screenshot of the triggs
View attachment Untitled-1.psd
 
Level 14
Joined
Aug 30, 2004
Messages
909
This is odd; I tried using a trigger to add the units to the merchant building but they never show up. The building still has invulnerable and Sell Units (and if I leave a unit to be sold by the merchant building it will appear there as normal), but when the trigger fires to add units to it nothing is added.

I'm sure the trigger is firing. I put it as map initialize first then moved it later to a trigger that responds to a "help" command... nothing seems to make a difference. Here's the action command:

  • Neutral Building - Add Aerial Mine to Imperial Command Control 0107 <gen> with 1 in stock and a max stock of 1
The Aerial Mine (and six others) are set to have a maximum of 1 in stock and 0 initial delay. As far as I can tell this trigger does nothing. Can anyone imagine what is wrong?


UPDATE:

I started a new map with just a paladin and a mercenary camp. I deleted all triggers except one that fires after 5 seconds adding a footman to the camp. No footman is ever added to the camp. Can someone else verify this? Has the action every worked for anyone?
 
Last edited:
Level 14
Joined
Aug 30, 2004
Messages
909
FIXED

Please don't put any more thought into. It turns out the problem is "Select Units" and "Sells Units" are not the same ability.

/shame

Still, it is weird that mercenary buildings don't start with the "Sells Units" ability at all and still manage to do it.

Thanks, +rep to all involved.
 
Status
Not open for further replies.
Top