Trigger problems in Scenario Editor

Here you can post about your scenario's, mods, custom maps and YouTube channels!
Sweden Ghost beer
Crossbow
Posts: 3
Joined: Sep 16, 2016
ESO: Grefven_af_Lofta

Trigger problems in Scenario Editor

Post by Ghost beer »

Hello!
I was just wondering if anybody here knows how to properly spawn and march, etc, an AI army in a custom scenario. What I want to do is to spawn an enemy army and then make it march along a road nicely up to a little village I have built. I can make it spawn perfectly with the "Army Deploy" command and then make it march to a point or unit with the "Army move/move to unit", but when I add something more, like a different point, it just acts really weird and doesn't do what it should. I have tried different triggers to make it work but it seems impossible. So I would really appreciate if someone could help me out.

The things I want the army to do is:
1. Destroy the trading post.
2. March along the road, ie follow all the turns and stay on the road.
3. If the player attacks I would like them to stop and retaliate and then march on up to the village.

I have added the triggers I could myself, so if someone added the triggers I could just study it and understand how it works for myself. I have uploaded the map files if somebody would be interested in helping me.
Attachments
Lofta.age3Yscn
(82.09 KiB) Downloaded 22 times
User avatar
France Rikikipu
Retired Contributor
Posts: 1679
Joined: Feb 27, 2015
ESO: p-of
Location: In your base

Re: Trigger problems in Scenario Editor

Post by Rikikipu »

@musketeer925
User avatar
United States of America musketeer925
Retired Contributor
Donator 01
Posts: 2483
Joined: Mar 28, 2015
ESO: musketeer925

Re: Trigger problems in Scenario Editor

Post by musketeer925 »

Triggers to emulate AI can be pretty hard to do, because the real AI has some more complicated logic that you can re-build with triggers.

However I think what you're trying to do can be achieved pretty well. If you just use one Army Move effect they'll try to move in a straight line, which is obviously not what you want. However, you can choose some waypoints along the way that they'll walk in straight lines between and make turns with do something like this:

Trigger1:
- Conditions: Timer 10 sec
- Effects: Army Deploy, Army Move
Here, move them to the first waypoint along your path. Probably turn on Attack Move so they don't just blindly walk off if attacked.

Trigger2:
- Conditions: Units in area
- Effects: Army Move
In this trigger set up a way to detect the army arriving at the first waypoint. I'd probably use a units in area and set a certain threshold like >= 5 of the units have arrived within some distance of the point. You could also use Army Distance to point, but if one guy gets there and the others had attack moved into an army or something it would re-order all of them to keep going. Then, in the effects re-route them to the next waypoint. Repeat this as many times as you want to get enough waypoints to follow the path.

Also, so tips on your triggers:
- Give them names! It will be much easier
- If you have a bunch of triggers for one purpose, you can go to the Group editor, create a Group and then sort the triggers into groups. I highly recommend this.
- The "Fire Event" effect is really useful. Lets you set a trigger to inactive initially, then let some condition fire events or events happen in a chain. The "Activate Trigger" effect actually breaks all the triggers on a map, use Fire Event instead.
- If you start to find the built-in triggers aren't sufficient, there are a huge number of custom triggers that have been written and you can event script your own. They can be found over at HeavenGames: http://aoe3.heavengames.com/downloads/index.php
Sweden Ghost beer
Crossbow
Posts: 3
Joined: Sep 16, 2016
ESO: Grefven_af_Lofta

Re: Trigger problems in Scenario Editor

Post by Ghost beer »

Thank you VERY much! I am so grateful you took the time to help me out! The "Fire event" I didn't know about. I had used "Activate trigger" earlier, but as you said, it ruins stuff. The thing I discovered with the "Units in area" was that you have to have an object for that, but I fixed that with "Path blocks" because they are invisible anyway. It took sometime before I got it to work, but then it worked like a charm!
User avatar
United States of America musketeer925
Retired Contributor
Donator 01
Posts: 2483
Joined: Mar 28, 2015
ESO: musketeer925

Re: Trigger problems in Scenario Editor

Post by musketeer925 »

I generally use cinematic blocks for the center unit.

Good to hear you got it working! Let me know if you need any more help.
Sweden Ghost beer
Crossbow
Posts: 3
Joined: Sep 16, 2016
ESO: Grefven_af_Lofta

Re: Trigger problems in Scenario Editor

Post by Ghost beer »

Everything was working fine and all the units did what i wanted. I had tested the scenario many times but then when I saved my map, as I had previously done many times, and did a playtest none of my triggers worked. For example, I was to start in Imperial with all the map revealed and no fog of war but instead it was black and unexplored. As said, previously everything worked but now it's impossible. All triggers are ignored. Is this some kind of bug?
Attachments
Lofta.age3Yscn
(84.53 KiB) Downloaded 31 times
User avatar
United States of America musketeer925
Retired Contributor
Donator 01
Posts: 2483
Joined: Mar 28, 2015
ESO: musketeer925

Re: Trigger problems in Scenario Editor

Post by musketeer925 »

Yeah, so there are certain effects and conditions that if you use (or use incorrectly in some cases) all of your triggers break. "Activate Trigger", for example, is one of them.

My general strategy for fixing that is save a backup copy, and slowly start deleting my most recently added/edited triggers until some triggers start working again (for easy testing, add a simple Send Chat trigger that activates immediately, so as soon as you playtest you know whether stuff is working). Once you isolate what trigger it is, you can use the same sort of method to narrow down effects/conditions within the trigger(s) causing it.

If you can't find the issue I'd be able to take a look next Thursday (29th) but not before then. Feel free to tag me in this thread (@musketeer925) then so I get a notification or I will forget.

Who is online

Users browsing this forum: No registered users and 5 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV