Page 1 of 1

Script equivalent to multiplayer builder

PostPosted: 03 Oct 2015, 13:48
by grayter
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?

Re: Script equivalent to multiplayer builder

PostPosted: 03 Oct 2015, 14:56
by Krom
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;

Re: Script equivalent to multiplayer builder

PostPosted: 03 Oct 2015, 15:49
by grayter
  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?

Re: Script equivalent to multiplayer builder

PostPosted: 15 Dec 2015, 18:39
by thibmo
  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

Re: Script equivalent to multiplayer builder

PostPosted: 16 Dec 2015, 19:28
by Nibo The Destroyer
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

Re: Script equivalent to multiplayer builder

PostPosted: 18 Nov 2017, 18:26
by grayter
  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).

Re: Script equivalent to multiplayer builder

PostPosted: 18 Nov 2017, 19:08
by Rey
I think its possible and seems to be easy to add

Re: Script equivalent to multiplayer builder

PostPosted: 18 Nov 2017, 19:40
by grayter
Excellent! Thanks :)