Re: Dynamic Script Usage
PostPosted: 21 Aug 2013, 05:12
Can't wait to see your contest map, your ideas seem pretty interesting and I'm sure I'll like it !
Talk about Knights and Merchants!
https://knightsandmerchants.net:443/forum/
https://knightsandmerchants.net:443/forum/viewtopic.php?t=1489
nvm wrong topic
Yes, in the current release random numbers are predictable (under the same conditions the numbers will be the same). Once the mission has been running for a while you'll find that it's unpredictable because the players have influenced how many times random numbers were used. We are going to change this in the next release so it's not predictable even in OnMissionStart. More information here:
viewtopic.php?f=22&t=1805
var Warehouse02: Boolean;
var School01: Boolean;
var Inn01: Boolean;
var Barracks01: Boolean;
procedure OnMissionStart;
begin
//Warehouse, wares, School (Player 3)
Actions.GiveHouse (2, 11, 109, 108);
Actions.GiveWares (2, 1, 5000);
Actions.GiveWares (2, 2, 5000);
Actions.GiveWares (2, 7, 5000);
Actions.GiveWares (2, 8, 5000);
Actions.GiveWares (2, 10, 5000);
Actions.GiveWares (2, 13, 5000);
Actions.GiveWares (2, 27, 5000);
Actions.PlanAddRoad (2, 107, 110);
Actions.PlanAddRoad (2, 106, 110);
Actions.PlanAddRoad (2, 105, 110);
Actions.PlanAddRoad (2, 104, 110);
School01:= Actions.PlanAddHouse(2, 27, 104, 109);
end;
procedure OnTick;
begin
//Inn (Player 3)
if States.HouseIsComplete (School01) then
begin
Actions.PlanAddRoad (2, 107, 109);
Actions.PlanAddRoad (2, 107, 108);
Actions.PlanAddRoad (2, 107, 107);
Actions.PlanAddRoad (2, 107, 106);
Actions.PlanAddRoad (2, 106, 106);
Actions.PlanAddRoad (2, 106, 105);
Actions.PlanAddRoad (2, 106, 104);
Actions.PlanAddRoad (2, 105, 104);
Actions.PlanAddRoad (2, 104, 104);
Actions.PlanAddRoad (2, 103, 104);
Actions.PlanAddRoad (2, 103, 103);
Actions.PlanAddRoad (2, 102, 103);
Inn01:= Actions.PlanAddHouse (2, 13, 102, 102);
end;
//Barracks (Player 3)
if States.HouseIsComplete (Inn01)
begin
Actions.PlanAddRoad (2, 106, 103);
Actions.PlanAddRoad (2, 107, 103);
Actions.PlanAddRoad (2, 107, 102);
Actions.PlanAddRoad (2, 108, 102);
Actions.PlanAddRoad (2, 108, 101);
Barracks01:= Actions.PlanAddHouse (2, 21, 108, 100);
//Weapons (Player 3)
if States.HouseIsComplete (Barracks01)
Actions.GiveWeapons (2, 19, 5000);
Actions.GiveWeapons (2, 21, 5000);
Actions.GiveWeapons (2, 17, 5000);
Actions.GiveWeapons (2, 25, 5000);
end;
end;