Map Database  •  FAQ  •  RSS  •  Login

Script equivalent to multiplayer builder

<<

grayter

Barbarian

Posts: 107

Joined: 18 Aug 2014, 12:06

KaM Skill Level: Skilled

Location: Poland

Post 03 Oct 2015, 13:48

Script equivalent to multiplayer builder

Hello, I would like to ask if there is any script command equvialent to "Multiplayer builder"?
I tried combination of several commands:

Actions.AIAutoAttackRange(i, 10);
Actions.AIAutoBuild(i, true);
Actions.AIAutoDefence(i, true);
Actions.AIAutoRepair(i, true);
Actions.AIDefendAllies(i, true);
Actions.AIRecruitDelay(i, 0);

but enemy village is five times smaller than setted by "Multiplayer builder".
Tested on mission Cursed Ravine (wihout scripts).
Can anyone help me?
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 03 Oct 2015, 14:56

Re: Script equivalent to multiplayer builder

From the code, AI Builder is set by the following:
  Code:
gHands[I].AI.General.DefencePositions.Clear; gHands[I].AI.General.Attacks.Clear; gHands[I].AI.Setup.ApplyAgressiveBuilderSetup;
and
  Code:
procedure TKMHandAISetup.ApplyAgressiveBuilderSetup; begin SerfsPerHouse := 1; WorkerCount := 20; ArmyType := atIronAndLeather; //Mixed army EquipRateLeather := 500; EquipRateIron := 500; AutoBuild := True; AutoRepair := True; AutoAttack := True; AutoDefend := True; DefendAllies := True; UnlimitedEquip := True; StartPosition := KMPoint(1,1); //So it is overridden by auto attack MaxSoldiers := -1; RecruitDelay := 0; RecruitCount := 10; AutoAttackRange := 6; end;
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

grayter

Barbarian

Posts: 107

Joined: 18 Aug 2014, 12:06

KaM Skill Level: Skilled

Location: Poland

Post 03 Oct 2015, 15:49

Re: Script equivalent to multiplayer builder

  Code:
gHands[I].AI.Setup.ApplyAgressiveBuilderSetup;
Is this method exposed and accessible from dynamic scripts? I am asking because dynamic scripting does not support methods like:
ArmyType := atIronAndLeather;
AutoAttack := True;
UnlimitedEquip := True;

How can I remove auto attacks of AI player?
<<

thibmo

User avatar

Council Member

Posts: 124

Joined: 03 Aug 2015, 09:12

KaM Skill Level: Skilled

Website: https://kp-wiki.org/

Location: the Netherlands

Post 15 Dec 2015, 18:39

Re: Script equivalent to multiplayer builder

  Code:
gHands[I].AI.Setup.ApplyAgressiveBuilderSetup;
Is this method exposed and accessible from dynamic scripts? I am asking because dynamic scripting does not support methods like:
ArmyType := atIronAndLeather;
AutoAttack := True;
UnlimitedEquip := True;

How can I remove auto attacks of AI player?
That line is a piece of code from the game itself and hence not usable by the script.
Everything you have at your disposal can be found here: https://github.com/Kromster80/kam_remake/wiki
~~ The magic wizard of PascalScriptus. ~~

KP-Wiki :
  • Information about Knights Province scripting ( unofficial )
  • Information about several hosting/server maintenance basics
  • Other random stuff
<<

Nibo The Destroyer

User avatar

Barbarian

Posts: 102

Joined: 25 Feb 2015, 22:04

KaM Skill Level: Skilled

Post 16 Dec 2015, 19:28

Re: Script equivalent to multiplayer builder

Am I the only one here to whom this scripting stuff seems like jibbrish?:P All i see is a lot of letters and numbers and then i get lost xD
Et ego vici
<<

grayter

Barbarian

Posts: 107

Joined: 18 Aug 2014, 12:06

KaM Skill Level: Skilled

Location: Poland

Post 18 Nov 2017, 18:26

Re: Script equivalent to multiplayer builder

  Code:
gHands[I].AI.Setup.ApplyAgressiveBuilderSetup;
Up, @Rey is this possible to add this command to dynamic scripts? Something like Actions.ApplyAgressiveBuilderSetup(playerId)?

Also Actions.ClearAttacks(playerId) will be useful for removing all attacks scripted in .dat file (including autoattacks).
<<

Rey

User avatar

KaM Remake Developer

Posts: 217

Joined: 12 Oct 2016, 07:41

KaM Skill Level: Fair

Location: Moscow

Post 18 Nov 2017, 19:08

Re: Script equivalent to multiplayer builder

I think its possible and seems to be easy to add
<<

grayter

Barbarian

Posts: 107

Joined: 18 Aug 2014, 12:06

KaM Skill Level: Skilled

Location: Poland

Post 18 Nov 2017, 19:40

Re: Script equivalent to multiplayer builder

Excellent! Thanks :)

Return to “Dynamic Scripting”

Who is online

Users browsing this forum: No registered users and 8 guests