Map Database  •  FAQ  •  RSS  •  Login

The Peasants Rebellion - Why doesn't the AI attack?

<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 23 Nov 2007, 16:53

The Peasants Rebellion - Why doesn't the AI attack?

I admit, I'm no expert at scripting (despite writing a documentation on it :D). This thing I've always been wondering about is why the AI does not attack at all in The Peasants Rebellion campaign? Is the piece of script that normally triggers an attack missing (something like !ATTACK_POSITION or whatever it was called) from all missions in The Peasants Rebellion campaign, or?

It is obvious that the AI has unintentionally been made passive in the campaign. My proof is e.g. the second message that is sent to you on the fourth mission:
"You must, under all circumstances, protect the village in the south from enemy attacks."

Quite an easy task when they never attack, isn't it? :D It would theoretically be possible to remedy the situation, right?
<<

merchant_992

Pikeman

Posts: 162

Joined: 11 Nov 2006, 23:00

Location: Rinsumageest, Nederland

Post 23 Nov 2007, 17:05

Maybe it is just because TPR was a project with way too little time. So they hadn't the time to build in attacks.
And it should be possible to build in attacks. The engine can attack, just look at the TSK campaign.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 23 Nov 2007, 17:07

Yeah, I guess it is so, but you don't happen to know the exact problem? I think !ATTACK_POSITION triggers these attacks and haven't found anything as of yet from TPR campaign, so is this the error?

EDIT:
Hmm, found something interesting:
"!SET_AI_ATTACK TYPE 2
!SET_AI_ATTACK TOTAL_AMOUNT 48
!SET_AI_ATTACK TAKEALL
!SET_AI_ATTACK TARGET 2
!COPY_AI_ATTACK 0"
Could this be the script piece that does not work... :?: Need to do some tests!
<<

merchant_992

Pikeman

Posts: 162

Joined: 11 Nov 2006, 23:00

Location: Rinsumageest, Nederland

Post 23 Nov 2007, 17:31

I am not so good at scripting so I don't know that. If that is the only problem, it would be very careless work of joymania.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 23 Nov 2007, 17:44

It's not like this would be the only careless thing they did in the game :D I think I found out the problem. There should be an attack position specified in that piece of the script, but it seems to be absent.
<<

merchant_992

Pikeman

Posts: 162

Joined: 11 Nov 2006, 23:00

Location: Rinsumageest, Nederland

Post 23 Nov 2007, 17:46

So just a few lines of text per mission, than would the whole campaign be a lot nicer.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 23 Nov 2007, 18:04

Bah, I don't get it! Just figured out that this TARGET 2 value meant that it calculates the attack position from the start position... Oddly enough the start position exists so the problem has to be elsewhere... I hope someone experienced knows what the problem is (Merchator, Lewin, The Dark Lord, anyone? :D), or otherwise I will have to test it out myself.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 24 Nov 2007, 00:45

Lewin to the rescue............ ;)

Bah, I don't get it! Just figured out that this TARGET 2 value meant that it calculates the attack position from the start position... Oddly enough the start position exists so the problem has to be elsewhere... I hope someone experienced knows what the problem is (Merchator, Lewin, The Dark Lord, anyone? :D), or otherwise I will have to test it out myself.
Ok, my first suggestion would be to open the mission in my editor, click anywhere in the attack you are not sure about and then press CTRL+E. This will show you what that attack does, and let you change stuff. :)
BTW: Did anyone know about that feature? It's really useful.
For all you lazy people, I have done that. :wink: (with the bit that Litude posted)
The attack says that it will continue for the whole level (not a once off), and that it will attack the closest building from the start position, and that the attack will happen once the army size gets to 48 men total, and they will take all of there troops that are not in the front line. (protection the base)
The problem might be that the army never reaches 48, as there is not enough !SET_AI_DEFENSE commands telling them where to place groups. :(
It also might be that I am completely wrong about all this, :wink: I haven't tested everything, most of it is based off what Nick said.
So to fix it, you could make the number of men needed lower, or you could set more spots to place men for the AI. If you are still unsure, please post again and ask me. :wink:
!ATTACK_POSITION has nothing to do with that, it will make troops attack a building at the game start.
Oh, and if anyone is interested, I am now making the GUI!
Lewin.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 24 Nov 2007, 09:31

Re: Lewin to the rescue............ ;)

The problem might be that the army never reaches 48, as there is not enough !SET_AI_DEFENSE commands telling them where to place groups. :(
Hmm... I think I already tried setting this AMOUNT to 1 and yet they didn't attack. Well, need to do some further tests!

EDIT:
Thanks to The Dark Lord, I finally figured this out. The TYPE 2 attack cannot be the first attack that the AI is supposed to do, or otherwise this piece of script will never work! I don't think your mission editor knows how to handle this, Lewin! :D

Return to “General Talk”

Who is online

Users browsing this forum: No registered users and 1 guest