Map Database  •  FAQ  •  RSS  •  Login

Fresh Topic

<<

Jochem

Serf

Posts: 5

Joined: 21 Aug 2010, 22:00

Location: Netherlands

Post 22 Aug 2010, 22:58

Fresh Topic

This topic couldn't be any fresher, because it's my first on these forums! though I've been looking through these forums for quite some time.

Straight of the bet with an editing question:
How do I stop AI's makeing Militas? I've set defence positions, but none of them are for Militas. Still they keep makeing them.

Also:
The soldiers of the second line, behind the defence position position themselves among the soldiers of the first line. How do I prevent this?

Thanks,
I'm looking forward to posting on these forums.
Love the Map- and Missioneditor ! Great job.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 23 Aug 2010, 19:50

I'm glad you joined Jochem!

First off, you can't place defensive positions for a single kind of soldier. You can only place defensive positions for infantry (which include militia, axe fighters, sword fighters, barbarians, and warriors (TRP only)), ranged units (bowmen, crossbowmen, ballistae (TPR only) and catapults (TPR only), long weapon units (lance carriers, pike men and peasants (TPR only), and mounted units (scout, knight and vagabond (TPR only). The AI will place each type of soldier in the correct defensive position. For example, the AI will place militia in infantry defensive positions.
Secondly, KaM has only a one type AI for making troops. The AI always make the best quality unit it can make for that certain type of unit. Let me explain: the AI will go from making a infantry then it will make a long weapon soldier (pike man or lance carrier) then it will make a ranged unit (crossbowman or bowman) and then a mounted unit. (though that might not be in the correct order). If the AI can, they will make an iron armor version of that type of unit. If not, then they will make a wood type. For example. Let's say the AI want's to make a ranged unit. If it has 1 bow, 1 leather armor, 1 crossbow, 1 iron armor, and 1 recruit; it will make a crossbowman because crossbowmen are of better quality then bowmen.
So, to stop the AI from making bowmen, just don't give the AI any weapon workshops, or don't let it start with any bows in it's barracks/storehouses.
Your asking how to stop the AI from making militia. If the AI is making militia, then it's because it wants to make an infantry unit but it can't make a sword fighter or a axe fighter. So to stop the AI from making militia, give them a armory workshop, leather (so they can make leather armor) and enough woods to make wooden shields and axes. The AI will start making axe fighters instead of militia. Or you could give the AI the necessary buildings and resources to make sword fighters.

I hope you understand.
The soldiers of the second line, behind the defence position position themselves among the soldiers of the first line. How do I prevent this?
I don't understand what your trying to ask (sorry). I'll tell you the difference between first and second lines and hope that helps.

The first line are the soldiers that will guard the base. They will NEVER be sent in AI attacks. The units in the second line will go on attacks if the attack includes that kind of unit. So, if you have and attack that sends a group of infantry and the AI has a group of infantry in it's second line, then they will send those.
Note that the AI doesn't need a first line to have a second line. A better name would be defenders and attackers.
Also note that the AI will fill up defensive positions in the same order you place them. This is because the AI reads the top of the code and reads down. So if you place your second line before your first line, they will fill up the second line first, understand?

Well I hope you do, and I hope this helps. If not, I'm sure Lewin will probably be able to help.
I used to spam this forum so much...
<<

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 23 Aug 2010, 21:41

Hi Jochem!
Also note that the AI will fill up defensive positions in the same order you place them. This is because the AI reads the top of the code and reads down. So if you place your second line before your first line, they will fill up the second line first
This is not true. The AI will always fill up defence positions with importance 0 first, no matter in what order you place them.

As for your question - I guess you have too many defence positions in your script. Could you write the piece of script (all defence positions) down here so we can take a look?
<<

Jochem

Serf

Posts: 5

Joined: 21 Aug 2010, 22:00

Location: Netherlands

Post 24 Aug 2010, 00:13

@Ben Thank you Ben for the tips and info. Yea I didn't get the first and second line thing, but now I get it.

@The DarkLord Hmm, I think it's because I have to little defence positions. I get to many Militia's so when there is no more defence position left for them they will take other (already filled) defence positions. Am I right?


Here are my defence positions anyways:

player five:
!SET_AI_DEFENSE 30 108 2 2 30 0 //
!SET_AI_DEFENSE 35 113 1 0 30 0 //
!SET_AI_DEFENSE 53 144 2 1 30 0 //
!SET_AI_DEFENSE 48 144 2 2 30 0 //
!SET_AI_DEFENSE 50 134 2 2 30 0 //
!SET_AI_DEFENSE 49 140 3 1 30 1 //
!SET_AI_DEFENSE 32 120 2 0 30 1 //
!SET_AI_DEFENSE 25 108 2 2 30 1 //
!SET_AI_DEFENSE 32 126 2 3 30 1 //

player four:
!SET_AI_DEFENSE 68 73 5 0 30 1 //
!SET_AI_DEFENSE 73 77 5 0 30 1 //
!SET_AI_DEFENSE 79 78 6 2 30 1 //

player three:
!SET_AI_DEFENSE 157 17 4 2 30 0 //
!SET_AI_DEFENSE 129 16 4 2 30 0 //
!SET_AI_DEFENSE 141 6 4 3 30 1 //
!SET_AI_DEFENSE 147 6 4 3 30 1 //
!SET_AI_DEFENSE 135 10 4 3 30 1 //
!SET_AI_DEFENSE 143 12 4 2 30 0 //
!SET_AI_DEFENSE 149 12 5 2 30 0 //
!SET_AI_DEFENSE 125 5 4 3 30 1 //
!SET_AI_DEFENSE 143 16 4 0 30 0 //
!SET_AI_DEFENSE 125 10 4 3 30 1 //
!SET_AI_DEFENSE 153 3 6 3 30 1 //

player two:
!SET_AI_DEFENSE 59 48 4 0 30 0 //
!SET_AI_DEFENSE 54 48 4 0 30 0 //
!SET_AI_DEFENSE 50 46 3 2 30 0 //
!SET_AI_DEFENSE 51 41 2 2 30 0 //
!SET_AI_DEFENSE 62 43 5 0 30 1 //
!SET_AI_DEFENSE 120 38 2 3 30 0 //
!SET_AI_DEFENSE 120 45 1 2 30 0 //
!SET_AI_DEFENSE 116 38 2 2 30 0 //
!SET_AI_DEFENSE 115 31 3 1 30 1 //
!SET_AI_DEFENSE 112 38 2 3 30 1 //
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 24 Aug 2010, 00:23

Ben wrote:
Also note that the AI will fill up defensive positions in the same order you place them. This is because the AI reads the top of the code and reads down. So if you place your second line before your first line, they will fill up the second line first


This is not true. The AI will always fill up defence positions with importance 0 first, no matter in what order you place them.
Sorry, it's been a while since I made a mission, so I let my pride get the best of me (I didn't check what i was saying :oops: )

@ Jochem I don't think that you have too many defensive positions. As I remember it, you can have a maximum of 20 per team.
I used to spam this forum so much...
<<

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 24 Aug 2010, 06:43

@The DarkLord Hmm, I think it's because I have to little defence positions. I get to many Militia's so when there is no more defence position left for them they will take other (already filled) defence positions. Am I right?
Yes, you are right! So what you could do is:
- Create more defence positions
- Set a maximum number of soldiers for the AI
- Let the AI attack
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 24 Aug 2010, 18:08

Opps :oops: :oops: :oops:
I thought he said I have too many defensive positions. Notice where I said "I don't think that you have too many defensive positions..." I just keep geting burned here it seems. I guess I should just let the Dark Lord help, eh?
I used to spam this forum so much...
<<

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 24 Aug 2010, 21:21

No, it was me who said that, so what you said actually made a bit sense. I thought that he had put too many soldiers in his mission and therefore too many defence positions, as you often see that beginning mission makers have huge numbers of soldiers on their maps. That would result in those soldiers ignoring the script because there are too many defence positions. But Jochem's own suggestion is much more likely - especially now he showed that there aren't that much defence positions in his script.

Don't worry about making mistakes, Ben. Everyone makes them and there will always be people to correct you. And so you learn from your mistakes. It's good you try to help as good as you can. :)
<<

Jochem

Serf

Posts: 5

Joined: 21 Aug 2010, 22:00

Location: Netherlands

Post 25 Aug 2010, 11:02

I got it now! Thank you so much guys!

@Ben no problem. You're just trying to help.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 25 Aug 2010, 16:44

Yeah, as much as I hate to admit it, I'm still learning. Truly what I think I should do is make some missions by using the script only: no GUI.
Anyway, Jochem, you should put your mission on Lewin's website. I'd like to see how it turns out :)
I used to spam this forum so much...
<<

Jochem

Serf

Posts: 5

Joined: 21 Aug 2010, 22:00

Location: Netherlands

Post 26 Aug 2010, 10:15

Anyway, Jochem, you should put your mission on Lewin's website. I'd like to see how it turns out :)
I will. I needs need to find the time to finish it :P

Return to “Map Design”

Who is online

Users browsing this forum: Ahrefs [Bot] and 14 guests