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: 236

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: 263

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: 200
  • 5.jpg
    5.jpg
    28.5 KB · Views: 211

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: 224

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: 165
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top