Map Database  •  FAQ  •  RSS  •  Login

AI defence postions

<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 30 Jul 2013, 06:46

AI defence postions

First of all, since this is my first post, I wanna say hi to everyone! I've been playing Knights and Merchants since I was little and now, since there are the Remake, with its porper Map Editor I decided to start a little Campain and play around with dynamic scrpit.
But somehow I have discovered some "problems" with the AI defence positions (or I am just too noob - who knows?). However, I've tried to set the AI defence positions in the Map Editor, that comes with the Remake, but after I do start the Game, all the Unit are swapping positions. For example the Warriors at the northern Gate are swapping position with the Warriors on the southern Gate. Same happens with every other Group, except the one that are not on a defencive position. Is that normal or did i do something wrong? Maybe there are just too many defencive positions?

(I hope I did not post that into the wrong subsection.)
<<

Bence791

Knight

Posts: 618

Joined: 20 Jul 2012, 20:25

KaM Skill Level: Beginner

Location: Hungary

Post 30 Jul 2013, 06:57

Re: AI defence postions

Welcome to here, have fun around :)

Happened to me as well, and it would idd better if they stayed at the cosest def. position :D Does it matter about the amount/kind of troops? If not, you can just put the same amount and quality troops and it won't matter whether they change places or not (12 swordfighters replacing other 12 and viceversa doesn' really change anything).
The Kamper is always taking my colour!

<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 30 Jul 2013, 07:35

Re: AI defence postions

Thanks for the quick reply! (:

So basicly you are saying that normal? On one hand thats good, since I do not feel that noob anymore, but on the other hand its pretty annoying and does not make any sense haha. I mean, it does not really matter that they swap position, since I could give them the same formation and quantity as you mentioned, but I am kinda a perfectionist. :|
However, I also noticed that the Swordmens are swapping position with the Warriors (Both Melee and set to melee, so I am not surprised), which I do not like at all, since the Warriors would be superior here.

Isnt there any way to assign a Group to a specific defence position using dynamic script or something?
<<

Bence791

Knight

Posts: 618

Joined: 20 Jul 2012, 20:25

KaM Skill Level: Beginner

Location: Hungary

Post 30 Jul 2013, 08:02

Re: AI defence postions

Dynamic scripts can't handle defence positions yet (afaik).
I could give them the same formation
The formation they are given in the MapEd by static scripts count, not the one you give them at start (I think). You can find it on the AI setup tab, below those sliders. There you can give how many columns and men a group should consist of. I don't think the AI would separate his troops if for example you give him 5; 15 groups and the formation is set to 4; 12.
The Kamper is always taking my colour!

<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 30 Jul 2013, 08:12

Re: AI defence postions

Dynamic scripts can't handle defence positions yet (afaik).
I thought so. :(


I know about the formation thing and AI setup tab. I tried to give every group the same formation and quantity, but they are still swapping. With formation I just meant columns and men in general. Sorry about the misunderstanding! I am bad at explaining haha.

You think it would might help if I "summon" the troops OnMissionStart instead of using the editor? Well, I'll try it out when I get home. Doubt its gonna help tho, but I am curious now. :P
<<

Bence791

Knight

Posts: 618

Joined: 20 Jul 2012, 20:25

KaM Skill Level: Beginner

Location: Hungary

Post 30 Jul 2013, 08:17

Re: AI defence postions

Don't know, but it is just unnecessary work I think :p It shouldn't harm much if the AI is swapping his troops in the first 2 minutes imo.
The Kamper is always taking my colour!

<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 30 Jul 2013, 08:22

Re: AI defence postions

Still worth a try I guess. Thanks for the help. :)
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 30 Jul 2013, 09:01

Re: AI defence postions

Hi Strangelove, welcome. ;)

If the defence positions work the same as in TPR, there is a very easy fix. You need to edit the static script. Just make sure the !SET_AI_DEFENSE POSITION comes after the !SET_GROUP. So first you create the group, then you immediately assign a defence position to it before you create the next group. You CAN first create all groups and then all defence positions, as long as you make sure they 'match' (so the first defence position should belong to the first group, second to second, etc.).

For example:
  Code:
!SET_GROUP 14 182 133 6 4 12 !SET_GROUP 14 156 172 4 4 12 !SET_AI_DEFENSE POSITION 156 172 4 0 50 0 !SET_AI_DEFENSE POSITION 182 133 6 0 50 0
In the case above, the groups will swap places.
  Code:
!SET_GROUP 14 182 133 6 4 12 !SET_GROUP 14 156 172 4 4 12 !SET_AI_DEFENSE POSITION 182 133 6 0 50 0 !SET_AI_DEFENSE POSITION 156 172 4 0 50 0
In this case they won't. It's pretty easy. Good luck!
<<

Strangelove

User avatar

Crossbowman

Posts: 230

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 30 Jul 2013, 09:33

Re: AI defence postions

OMG I so hope thats gonna work haha. I will try that immediately when I get home!

Thanks! :)

EDIT: Worked as intended! :D

Return to “General / Questions”

Who is online

Users browsing this forum: No registered users and 1 guest