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.
Trigger problems in Scenario Editor
-
- Crossbow
- Posts: 3
- Joined: Sep 16, 2016
- ESO: Grefven_af_Lofta
Trigger problems in Scenario Editor
- Attachments
-
- Lofta.age3Yscn
- (82.09 KiB) Downloaded 22 times
Re: Trigger problems in Scenario Editor
@musketeer925
musketeer925 wrote:notification
- musketeer925
- Retired Contributor
- Posts: 2484
- Joined: Mar 28, 2015
- ESO: musketeer925
Re: Trigger problems in Scenario Editor
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
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
-
- Crossbow
- Posts: 3
- Joined: Sep 16, 2016
- ESO: Grefven_af_Lofta
Re: Trigger problems in Scenario Editor
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!
- musketeer925
- Retired Contributor
- Posts: 2484
- Joined: Mar 28, 2015
- ESO: musketeer925
Re: Trigger problems in Scenario Editor
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.
Good to hear you got it working! Let me know if you need any more help.
-
- Crossbow
- Posts: 3
- Joined: Sep 16, 2016
- ESO: Grefven_af_Lofta
Re: Trigger problems in Scenario Editor
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
- musketeer925
- Retired Contributor
- Posts: 2484
- Joined: Mar 28, 2015
- ESO: musketeer925
Re: Trigger problems in Scenario Editor
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)
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.musketeer925) wrote:notification
Who is online
Users browsing this forum: No registered users and 3 guests