SC2Mapster Forums

Development > Data

Shift queuing with incremental cost upgrades

  • 6 posts
    #1 Feb 24, 2013 at 21:34 UTC - 0 likes

    My research building doesn't has the queue ability, but it is still possible to queue research by shift-clicking. This wouldn't be a problem if it weren't for my incremental cost upgrades. I have upgrades which modify their own cost so the later levels get more expensive. The problem is that if you shift-click an upgrade a lot, you can queue up a lot of levels for the default unmodified price.

    Is there any way to fix this? I'm quite desperate, so if there's a way to disable shift-queuing or anything really, I'd be willing to try it.

    I've tried triggers that order the unit to do what it wanted to do something like:

    Event: Unit is issued an order

    Actions: Order triggering unit to (Triggering Unit) unit order 0 (Replace existing orders)

    but it doesn't seem to replace the shift queue.

    Last edited Feb 24, 2013 by Siretu
    #2 Feb 24, 2013 at 21:51 UTC - 0 likes

    Use a Requirement Upgrade-Queued (you might have to add a build queue, but you can always limit it to 1 slot and/or hide the progress bar)

    You could also add a cooldown or regenerating charges to the ability or use an Effect-Instant ability for the clickable button, then make that apply an Issue Order effect for the research and some buff setup to handle the timer.

    #3 Feb 26, 2013 at 18:50 UTC - 0 likes

    Yeah, this is a possibility, but it's a lot of work since I have over 50 upgrades.

    #4 Feb 26, 2013 at 19:21 UTC - 0 likes

    Everything is a lot of work with this editor. Even closing it can take over 2 minutes!

    You can try with buffs or charges, but if you don't already know how to build such a system it'll be faster if you just brute-force add all the requirements.

    #5 Feb 28, 2013 at 12:10 UTC - 0 likes

    I figured out a way to block it with the trigger editor. Some of the stuff I do might not be necessary, but I've spent enough time with it so I cba testing it again without some parts of it.

    Prevent upgrade queue
        Events
            Unit - Any Unit is issued an order to Upgrade
            Unit - Any Unit is issued an order to Upgrade 2
        Local Variables
            o = (Triggering order) <Order>
        Conditions
        Actions
            Trigger - Turn (Current trigger) Off
            Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
            Unit - Order (Triggering unit) to ((Ability command for o)) (Replace Existing Orders)
            Trigger - Turn (Current trigger) On
    

    It's worth noting that it didn't seem to work if I just ordered it to do "o". I had to order it to do an order with no target and then use the "Ability Command for Order" on o to get it to work.

    Last edited Feb 28, 2013 by Siretu
    #6 Feb 28, 2013 at 20:38 UTC - 0 likes

    Yeah that workaround makes sense - ordering it to Stop clears its order queue, and then you re-order it to do it only once. I think it's odd though that without a queue ability it's still possible to queue. Is it possible that within the Research ability you have the flag "Use Unit Order Queue" selected? If so, try turning that off. It makes it so that the research order is treated as along the lines of a move, attack, patrol, etc., order, within its main queue, which every unit has. With the flag off, it is supposed to use a build queue. If that still doesn't fix the problem, then give the unit a queue ability with only 1 slot!

    Those fixes should work, but if they don't, then Photoloss' suggestion is valid and more secure than using a trigger workaround. Yes it takes a long time, but familiarize yourself with using the XML view of the Data editor (Ctrl+3), and it makes jobs a LOT quicker. You can simply give all of the upgrades the same Tech Tree Alias within the upgrade data, and make one single requirement that checks how many of those tech tree aliases are queued at the unit. Then put the requirement inside one of the upgrade commands within the research ability using the normal table view. Switch to XML view and copy and paste the same requirement into all of the other commands.

    Last edited Feb 28, 2013 by TrenchaunT
  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!