Yamato upgrade active without research?

Zero866

New Member
Reaction score
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!
 

Dave312

Censored for your safe viewing
Reaction score
269
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.
 

Flare

Stops copies me!
Reaction score
662
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.
 

Zero866

New Member
Reaction score
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!
 

Dave312

Censored for your safe viewing
Reaction score
269
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
 

Flare

Stops copies me!
Reaction score
662
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.
 

Attachments

  • Yamato Cannon requirements.png
    Yamato Cannon requirements.png
    220.8 KB · Views: 220

Zero866

New Member
Reaction score
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!
 

Attachments

  • 3.jpg
    3.jpg
    194.8 KB · Views: 255

Dave312

Censored for your safe viewing
Reaction score
269
@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?

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?
 

Flare

Stops copies me!
Reaction score
662
You just have to choose something in the requirements that you have, like a command center.
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
 

Zero866

New Member
Reaction score
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:

You will need to add a new global variable called YamatoTimer of the type Timer.

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!
 

Dave312

Censored for your safe viewing
Reaction score
269
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.
 

Zero866

New Member
Reaction score
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.
 

Attachments

  • 4.jpg
    4.jpg
    93.8 KB · Views: 181
  • 5.jpg
    5.jpg
    28.5 KB · Views: 200

Dave312

Censored for your safe viewing
Reaction score
269
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.
 

Attachments

  • Add global var.png
    Add global var.png
    92.7 KB · Views: 211

Zero866

New Member
Reaction score
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.
 

Dave312

Censored for your safe viewing
Reaction score
269
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
 

Zero866

New Member
Reaction score
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
 

Dave312

Censored for your safe viewing
Reaction score
269
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.
 

Zero866

New Member
Reaction score
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.
 

Dave312

Censored for your safe viewing
Reaction score
269
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).
 

Attachments

  • YamatoAI.zip
    10.3 KB · Views: 154
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top