• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Stopping Research

Status
Not open for further replies.
Level 4
Joined
Jun 12, 2009
Messages
57
I need help with this trigger. Whenever a unit picks up an item it increases their integer called vacuole_integer. Then this is displayed on their multiboard. I am basically creating a custom currency called vacuole( I am making a cell type game). Then they can research an ability if they have enough vacuoles they can research or evolve into a better unit. The problem is how do i stop a unit from researching if they don't have at least that integer amount? Here is my trigger so far. As for the displaying on the multiboard that is working.

  • Events
    • Unit - A unit owned by Player 1 (Red) Begins research
  • Conditions
    • (Researched tech-type) Equal to Upgrade (Night Elf)
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Vacuoleinterger[1] Less than 4
      • Then - Actions
        • //Here is where I want it to stop the upgrading
      • Else - Actions
        • Set Vacuoleinterger[1] = (Vacuoleinterger[1] - 4)
        • For each (Integer A) from 0 to Vacuoleinterger[1], do (Actions)
          • Loop - Actions
            • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String((Integer A)))
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Just use this:

  • Actions
    • Wait 0.03 seconds
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
    • Game - Force (Owner of (Researching unit)) to press Escape/Cancel
Note that ''Force UI Cancel'' has to be added 7 times because of queue.

Player won't loose any gold/lumber.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
BTW guys i found a faster way
  • cancle training of unit
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
      • (Your conditions...)
    • Actions
      • Set INTEGER = (Player number of (Owner of (Triggering unit)))
      • Unit - Change ownership of (Triggering unit) to Neutral Passive and Retain color
      • Unit - Change ownership of (Triggering unit) to (Player(INTEGER)) and Retain color
      • Selection - Add (Triggering unit) to selection for (Player(INTEGER))
EDIT : and player will not lose gold and lumber :D better than i tough so

i just tried with cancel but if i select another unit fast enough it will not force me to cancel
 
Status
Not open for further replies.
Top