HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Cancel Upgrade Order

10-24-2005, 06:37 AM#1
Soultaker
Hey all! What is the easiset way to cancel an upgrade that a unit is upgrading atm? An Order or through some kind of trigger?

It doesn't need to be just the Upgrade that it is upgrading atm, just so I can cancel a specify upgrade that my unit upgrade.

-Soultaker
10-24-2005, 02:24 PM#2
Vexorian
Code:
      set UnitVar = (Whatever the unit is)
      Custom Script call IssueImmediateOrderById(udg_UnitVar,851796)
10-24-2005, 07:44 PM#3
Soultaker
Quote:
Originally Posted by Lord Vexorian
Code:
      set UnitVar = (Whatever the unit is)
      Custom Script call IssueImmediateOrderById(udg_UnitVar,851796)

Hmmm, I can't get this to work... Have tried both with and without space before the call order, and using Researching Unit and Triggering Unit.

You sure that, that code should work?

-Soultaker
10-24-2005, 10:13 PM#4
Tim.
Did you set the UnitVar first? Are you getting a compile error or is it simply not working?
10-24-2005, 11:28 PM#5
Vexorian
things in JASS are case sensitive by the way
10-25-2005, 06:16 AM#6
Soultaker
Quote:
Originally Posted by Tim.
Did you set the UnitVar first? Are you getting a compile error or is it simply not working?

I did put the Set UnitVar First, and I did spell it case sensitively.

It doesn't give an error, it just doesn't work..

Btw. Should there be a space before the Call?

-Soultaker
10-25-2005, 12:51 PM#7
oNdizZ
Simple answer: Doesnt Matter.
10-25-2005, 08:46 PM#8
Vexorian
Is the trigger disabled?

you are using it for upgrade/building/trainning cancel , right? Cause it doesn't work for the other cancel

are you using it correctly?
(paste the damn trigger)
10-26-2005, 07:17 AM#9
Soultaker
Quote:
Originally Posted by Lord Vexorian
Is the trigger disabled?

you are using it for upgrade/building/trainning cancel , right? Cause it doesn't work for the other cancel

are you using it correctly?
(paste the damn trigger)

Code:
Start Upgrade Copy
    Events
        Unit - A unit Begins research
    Conditions
    Actions
        Game - Display to (Player group((Owner of (Triggering unit)))) for 3.00 seconds the text: You can't research ...
        Set UnitVar = (Triggering unit)
        Custom script:  call IssueImmediateOrderById(udg_UnitVar,851796)

Sorry, It's an research, not an upgrade... always getting confused by those 2 :P

-Soultaker
10-26-2005, 01:14 PM#10
Vexorian
My bet is that there is no cancel button yet so you can't press it, add a 0 seconds wait before setting UnitVare
10-27-2005, 08:17 AM#11
Soultaker
Quote:
Originally Posted by Lord Vexorian
My bet is that there is no cancel button yet so you can't press it, add a 0 seconds wait before setting UnitVare

I tried with a 0 second wait and a 1 second wait, neither worked... The Cancel button appears but nothing happens.

I thought that I would give it a try with the order "Cancel".

So I did, and all I had forgot was the wait order when I first started making the trigger. Here it is:

Code:
Start Upgrade DEBUG
    Events
        Unit - A unit Begins research
    Conditions
    Actions
        Game - Display to (Player group((Owner of (Triggering unit)))) for 3.00 seconds the text: Debug: Research Can...
        Wait 0.25 seconds
        Unit - Order (Triggering unit) to Cancel

Well, thanks for your help guys!

-Soultaker