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

Why Does this not work?

Status
Not open for further replies.
Level 22
Joined
Jun 23, 2007
Messages
3,242
  • Doctrine
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Set DocUpgraderLoc = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Iron Will Doctrine
        • Then - Actions
          • Player - Limit training of Iron Will Doctrine to 0 for (Owner of (Selling unit))
          • Player - Limit training of Never Stop, Never Tire to 0 for (Owner of (Selling unit))
          • Player - Limit training of No Mercy Doctrine to 0 for (Owner of (Selling unit))
          • Unit - Create 1 DoctrineUpgrader for (Owner of (Triggering unit)) at DocUpgraderLoc facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to research Iron Will Doctrine
          • Player - Enable Iron Will for (Owner of (Triggering unit))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Sold unit)) Equal to Never Stop, Never Tire
            • Then - Actions
              • Player - Limit training of Iron Will Doctrine to 0 for (Owner of (Triggering unit))
              • Player - Limit training of Never Stop, Never Tire to 0 for (Owner of (Triggering unit))
              • Player - Limit training of No Mercy Doctrine to 0 for (Owner of (Triggering unit))
              • Unit - Create 1 DoctrineUpgrader for (Owner of (Triggering unit)) at DocUpgraderLoc facing Default building facing degrees
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to research Never Tire, Never Stop Doctrine
              • Player - Enable Never Tire, Never Stop (Neutral Hostile) for (Owner of (Triggering unit))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to No Mercy Doctrine
                • Then - Actions
                  • Player - Limit training of Iron Will Doctrine to 0 for (Owner of (Triggering unit))
                  • Player - Limit training of Never Stop, Never Tire to 0 for (Owner of (Triggering unit))
                  • Player - Limit training of No Mercy Doctrine to 0 for (Owner of (Triggering unit))
                  • Unit - Create 1 DoctrineUpgrader for (Owner of (Triggering unit)) at DocUpgraderLoc facing Default building facing degrees
                  • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to research No Mercy Doctrine
                  • Player - Enable No Mercy for (Owner of (Triggering unit))
                • Else - Actions
                  • Do nothing
      • Custom script: call RemoveLocation(udg_DocUpgraderLoc)
what i want is for that when i train one of the 3 units, that unit and the other 2 become unavailable. this works if its unit is trained event, but not when unit is sold.
 
Level 7
Joined
May 3, 2007
Messages
210
  • Neutral Building - Remove Footman from (Triggering unit)
Can't be done on a player instance basis I don't think. You'd be better off checking how many units-of-type a player had and simply removing a unit if a player happens to buy one, reset the amount of units in stock and display a SimError message to the player telling him he has reached maximum.

The generic unit event "sells a unit" is referring strictly to buildings such as taverns, or what-not. You'll have to change every "Sold Unit" instance in your GUI to "Trained Unit" if you change the event.

Realisticly you have two options: (If i'm understanding your situation correctly) You either make players acquire units via training, or you apply the above stated suggestion.
 
Level 7
Joined
May 3, 2007
Messages
210
Another option is to create a marketplaces for each player (different unit-types for each player), make them invisible to other players besides the one that is referencing them, remove their collison size so you can just stack them on top of each other if needed. This way you can reference on a player basis.
 
Level 5
Joined
Nov 7, 2007
Messages
134
well, i want an instant way to train the units, and it seemed like selling them would be the best way.

If you only want them trained quickly, why not just reduce the build time of them to the lowest value possible? Then it would take like one second to train them instead of instantly, but maybe that's to long for you? If you did it that way you could use "Train Unit" instead of "Sold Unit".
 
Level 5
Joined
Nov 7, 2007
Messages
134
it is too long. its long enough for the dude to click the next unit and get both benefits.

Then how about executing the trigger with a "Begins Training A Unit"-event? Then it should prevent the player from training any other unit as soon as he begins training the first one, it wouldn't even have to be finished.
 
Status
Not open for further replies.
Top