Yamato upgrade active without research?

Discussion in 'Starcraft 2 (SC2) Editor Help' started by Zero866, Sep 12, 2010.

  1. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    I am building a map that has a boss. This boss is a very large Battlecruizer that has the normal attack. Additionally, I wanted the BC to be able to shoot all the way across the map with a Yamato Cannon. For the life of me, I can't figure out how to activate Yamato Cannon for the AI or a User, without (in game) researching it first. I just want the Yamato to be available right away and have the AI use it.

    Any hints would be appreciated!
     
  2. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    The easiest way would be to research the Yamato Cannon upgrade on Map Initialization with a trigger. As far as getting the AI to use it, you could trigger it with a Unit enters range of unit event and use a couple of conditions to check if the battlecruiser has enough energy and if the target unit is a strong enough unit to warrant the use of the cannon.
     
  3. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    For making it available from the beginning, there should be a research validator associated with the Yamato Cannon ability (I think) - if you remove that, it should be available without research

    For making the AI use it, you could add a Buff Behaviour which periodically executes a Search Area effect, targeting any nearby enemies (or a certain number of them) and using the Yamato Cannon's firing effect.
    I'm not sure how this would work if your boss unit has a limited supply of Energy for using the ability (triggers may prove to be more useful here), but cooldown could be done via the Period field for the behaviour.
     
  4. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    Thanks for the hints.

    @Flare - The requirement is set to none: http://preview.milpond.com/images/1.jpg
    The Boss is set to unlimited energy. I am not sure how to add buffs that would do as you talked about. I would need a little more info.

    @Dave312 - When it comes to actually laying out triggers I tend to have issues. Here is an example of a trigger I tried: http://preview.milpond.com/images/2.jpg And as you might have expected, no new results! So anymore hints would be helpful!
     
  5. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    The following trigger should do the job. You will need to add a new global variable called YamatoTimer of the type Timer. This trigger will cause the battlecruiser to use the yamato cannon against an attacking unit provided that it the attacking unit is not owned by the same player as the battlecruiser and the attacking unit has at least 50 hit points. It also has a built in cooldown of 10 seconds.

    Trigger:
    • AI_Yamato
      • Events
        • Unit - Battlecruiser [67.52, 139.50] is attacked
      • Local Variables
      • Conditions
        • (Remaining time of YamatoTimer) == 0.0
        • (Owner of (Attacking Unit)) != (Owner of (Triggering unit))
        • ((Attacking Unit) Life (Current)) >= 50.0
      • Actions
        • Unit - Order (Triggering unit) to (Battlecruiser - Yamato Cannon targeting (Attacking Unit)) (Replace Existing Orders)
        • Timer - Start YamatoTimer as a One Shot timer that will expire in 10.0 Game Time seconds
     
  6. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Wrong field Zero (I think) :p The research Requirement is under Ability - Commands+

    EDIT: Ok, finally got a chance to test. Removing the research Requirement from the execution command under Ability - Commands+ appears to work just fine - the Yamato Cannon ability became available for use, and the ability was carried through all the way from cast to projectile launch.
     

    Attached Files:

  7. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    @312Dave - I have successfully been able to add the event and the actions. I have the line "owner of" in the conditions. I just don't know how to get the options like "remaining time" and "attacking unit" as a condition. Otherwise, this trigger looks like it would do it. Also, what is a good way to add a global trigger?


    @Flare - It looks like I have already set the requirements that way. I have attached my screenshot. I will try it again from another map...
    EDIT: @Flare - You are correct. You just have to choose something in the requirements that you have, like a command center. I kept trying it from an ability aspect. Thanks for your help!
     

    Attached Files:

    • 3.jpg
      3.jpg
      File size:
      194.8 KB
      Views:
      163
  8. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    The "remaining time" condition is from a comparison function called Remaining Time of Timer (located under the Timer section).

    The "attacking unit" condition is a comparison function comparing the life of the unit so it is called Unit Property (under the unit section). You will need to set the property type to Life.

    By "global trigger" do you mean you want to make this AI work for all battlecruisers on the map? If so, I need to know which players this will be applied to?
     
  9. Flare

    Flare Stops copies me! Staff Member

    Ratings:
    +662 / 0 / -0
    Or you could click the red X (in the bottom-center of my screenshot) to remove the Requirement completely - I probably should've taken a new screenshot with the intended result, but that image was already in My Pictures so I assumed it was correct, and hadn't realised that the old screenshot didn't show the Ability - Commands+ window after the Requirement was removed
     
  10. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    @Dave312 - I am trying to do this Yamato with player 10 specifically, but it can happen for all of them since BattleCs won't be used by any human players. Here is what you said earlier which made me ask my question:

    I am not sure how to add a global variable you mentioned.

    Also: Each time I try to save the map I get a syntax error each time it gets to a line that has YamatoTimer in it. Maybe I am not supposed to type in YamatoTimer as a custom script.

    Thanks again!
     
  11. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    Yeah that line was not meant to be done as a custom script. You need to create a global variable. To do this, select any trigger in your trigger list (you need to give this list the focus), and then click on the New Variable button on the command toolbar (it is the second last one, shortcut is Ctrl+B). Now name this variable YamatoTimer and set the type to Timer. Leave the rest of the fields as is. Now you should be able to change the custom script line you put in so they will work correctly.

    On a side note, were you planning on having more than one battlecruiser using this AI? If so, the triggers may need to be adjusted slightly.
     
  12. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    I think I have finished all of the triggers editing. The only thing I end up with at the end is the syntax error. The areas I have added a custom script are highlighted in red. I also added another image which shows how I added the custom script for one of the actions.
     

    Attached Files:

    • 4.jpg
      4.jpg
      File size:
      93.8 KB
      Views:
      111
    • 5.jpg
      5.jpg
      File size:
      28.5 KB
      Views:
      124
  13. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    You have added your variable as a local variable. A new instance of a local variable is created every time the trigger is run. You don't want this to happen so it needs to be a global variable. See the attached image for how to add a global variable.

    Once you have added a global variable you can fix up your triggers so you won't get the syntax error.

    To fix your condition with YamatoTimer in it, you need to change the timer property, change the source to Variable and select your timer from the list. Do the same thing to fix your timer action.

    To fix your order action, you need to change the Order property to Order Targeting Unit (listed as a function), set the Ability Command to Yamato Cannon, and set the unit property to Attacking Unit. That should be it.
     

    Attached Files:

  14. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    Alright! It has been tested to work! Your triggering has been flawless!

    I only have one more question related to this Yamato trigger.

    Do you know what would be the simplest way to change the "Unit - Battlecruiser [58.36, 141.28] is attacked" to "any enemy (non-allied) unit is in range." The BC I have edited has an extremely large range, more than any other unit.

    I thought about this one: "Unit - Any Unit Enters within 1.0 of Point." But, I am not sure how to implement it into the current configuration.
     
  15. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    Yeah you are on the right track. Use the event Unit Enters/Leaves Range of Unit. Because you have changed the event, there will no longer be a unit assigned to the Attacking Unit value and the Triggering Unit will be the unit entering the range of the battlecruiser. I have made the required adjustments and the trigger is shown below.

    Trigger:
    • AI_Yamato
      • Events
        • Unit - Any Unit Enters a distance of 10.0 from Battlecruiser [67.52, 139.50]
      • Local Variables
      • Conditions
        • (Remaining time of YamatoTimer) == 0.0
        • ((Triggering player) is in (Enemies of player (Owner of Battlecruiser [67.52, 139.50]))) == true
        • ((Triggering unit) Life (Current)) >= 50.0
      • Actions
        • Unit - Order Battlecruiser [67.52, 139.50] to (Battlecruiser - Yamato Cannon targeting (Triggering unit)) (Replace Existing Orders)
        • Timer - Start YamatoTimer as a One Shot timer that will expire in 10.0 Game Time seconds
     
  16. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    Alright. I am at the last step for this trigger. I am struggling to find how to construct: ((Triggering Player) is in (Enemies of player...

    This is a comparison again. I can find Triggering player but I don't get any options that allow anything further from it.

    Trigger:
    • (triggering player)==1
     
  17. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    I did it by using a "Player in Player Group" check. I then set the player group to enemies of the player that owns the battlecruiser. I don't have access to copy of the editor but I'll give you the the exact info you need when I get a chance if you haven't figured it out by then.
     
  18. Zero866

    Zero866 New Member

    Ratings:
    +0 / 0 / -0
    Ah, your hint did the trick. I was able to find the correct settings to match yours.

    The only thing is that the unit does not fire the yamato unless I make a second BC (under my control) and then press the yamato button. Then the Yamato battle takes place where they just keep firing it.
     
  19. Dave312

    Dave312 Censored for your safe viewing

    Ratings:
    +269 / 0 / -0
    I'll make a test map and upload it when I get home



    EDIT: Map Attached. Note that the battlecruiser will only fire the Yamato cannon when an enemy unit enters range. If the enemy unit remains within that range, the attack won't be fired. To fix this you could use both versions of the trigger in this thread (keeping the same cooldown timer for both).
     

    Attached Files:

Share This Page