Page 18 of 24

Re: New Dynamic Script Ideas

PostPosted: 21 May 2014, 16:15
by Michalpl
Maybe add Actions.gamespeed?

Re: New Dynamic Script Ideas

PostPosted: 21 May 2014, 17:05
by andreus
Is it really needed? :P

some new additions:

6323 Actions.AIDefencePositionRemoveAll(aPlayer)
6323 States.StatAIDefencePositionsCount(aPlayer)
6328 MultipleTypes for StatHouseTypeCount, StatUnitTypeCount
6331 MultipleTypes for killed, lost units and produced wares
6336 Actions.OverlayTextHide(aPlayer)

Re: New Dynamic Script Ideas

PostPosted: 21 May 2014, 17:13
by Michalpl
Maybe something like Warrior randomizer?

Re: New Dynamic Script Ideas

PostPosted: 21 May 2014, 17:22
by andreus
Actions.GiveGroup(aPlayer, States.KamRandomI(14) + 14, X, Y, Direction, Count, Columns) will give random warriors group: States.KamRandomI(14) + 14 can be any number, in range 14..27 (warrior type - militia..vagabonds)

Re: New Dynamic Script Ideas

PostPosted: 21 May 2014, 17:24
by Michalpl
Oh sorry i didn't knowed about that i need to learn more pascal scripting

Re: New Dynamic Script Ideas

PostPosted: 13 Jul 2014, 19:57
by RandomLyrics
Actions.PlanConnectRoad(aPlayer, X, Y, X2, Y2: integer);
to
Actions.ConnectRoad(aPlayer, X, Y, X2, Y2: integer; finished: boolean); - if finished = true then scirpt will make finished roads instead of plans.

Actions.HouseAddBuildingProgress(aHouse: integer) - script should give building materials if there arent any. or new script Actions.HouseGiveBuildingMaterial(aHouse: integer) - that should be neater.
I want to:
i put plan > laberer goes there and make ground for house > when his job is done, script give materials to that houseSite, and laborer start to build it

Re: New Dynamic Script Ideas

PostPosted: 14 Jul 2014, 06:07
by Lewin
Actions.PlanConnectRoad(aPlayer, X, Y, X2, Y2: integer);
to
Actions.ConnectRoad(aPlayer, X, Y, X2, Y2: integer; finished: boolean); - if finished = true then scirpt will make finished roads instead of plans.

Actions.HouseAddBuildingProgress(aHouse: integer) - script should give building materials if there arent any. or new script Actions.HouseGiveBuildingMaterial(aHouse: integer) - that should be neater.
I want to:
i put plan > laberer goes there and make ground for house > when his job is done, script give materials to that houseSite, and laborer start to build it
Both accepted. New script commands are low priority compared to bug fixes but we should be able to get them implemented before the next release.

Re: New Dynamic Script Ideas

PostPosted: 14 Jul 2014, 09:57
by RandomLyrics
Great thanks! Hm im thinking about, States.HouseSiteIsDigged(aHouse: integer) - returns true if laborer finished digging ground for house to start build.
That would be very helpful, for now i have to check if on House posiitons is laborer. Every house has specific tiles so it will be huge table to write :P
Could States.HouseResourceAmount returns -1 if its wrong ware type ?
I want to make script for copy houses like this:
  Code:
begin result:= -1; if (aHouse > 0) and InRange(toPlayer, 0, MAX_PLAYERS-1) then begin t:= States.HouseType(aHouse); x:= States.HousePositionX(aHouse); y:= States.HousePositionY(aHouse); //copy wares for k:= 0 to 27 do begin wares_count[k]:= States.HouseResourceAmount(aHouse, k); end; Actions.HouseDestroy(aHouse, true); h:= Actions.GiveHouse(toPlayer, t, x, y); if h > 0 then begin //paste wares for k:= 0 to 27 do begin if States.HouseResourceAmount(h, k) <> -1 then Actions.HouseAddWaresTo(h, k, wares_count[k]); end; end; result:= h; end; end;

Re: New Dynamic Script Ideas

PostPosted: 16 Jul 2014, 15:34
by Lewin
Great thanks! Hm im thinking about, States.HouseSiteIsDigged(aHouse: integer) - returns true if laborer finished digging ground for house to start build.
That would be very helpful, for now i have to check if on House posiitons is laborer. Every house has specific tiles so it will be huge table to write :P
Also accepted.
Could States.HouseResourceAmount returns -1 if its wrong ware type ?
I want to make script for copy houses like this:
It returns 0 when it's the wrong ware type (because the house has zero of that ware). So change your code:
if States.HouseResourceAmount(h, k) <> -1 then
to:
if wares_count[k] > 0 then

Re: New Dynamic Script Ideas

PostPosted: 16 Jul 2014, 18:10
by RandomLyrics
Brilliant! Thanks Lewin :D

Re: New Dynamic Script Ideas

PostPosted: 19 Jul 2014, 00:05
by Michalpl
Some thing like bowman crossbowman range i mean it should look like this (x,y coords of ranged units height,widtht)

Re: New Dynamic Script Ideas

PostPosted: 19 Jul 2014, 11:35
by RandomLyrics
Michal you want to Set the range or Read the range?
You cant change the range of bowman/xbow shoot, and you will not able to do that in near future.
If you want read range, just set it to global const, its same for xbow and bows, i think it will be: SHOOT_RANGE = 11; you have to count tiles by yourself to be accurate.
If i misunderstand you, tell me more about your idea.

Re: New Dynamic Script Ideas

PostPosted: 20 Jul 2014, 03:59
by Lewin
Michal you want to Set the range or Read the range?
You cant change the range of bowman/xbow shoot, and you will not able to do that in near future.
If you want read range, just set it to global const, its same for xbow and bows, i think it will be: SHOOT_RANGE = 11; you have to count tiles by yourself to be accurate.
If i misunderstand you, tell me more about your idea.
From here:
//Archer properties
RANGE_ARBALETMAN_MAX = 10.99; //KaM: Unit standing 10 tiles from us will be shot, 11 tiles not
RANGE_BOWMAN_MAX = 10.99;
RANGE_SLINGSHOT_MAX = 10.99;
RANGE_WATCHTOWER_MAX = 6.99; //Measured in KaM. Distance from the doorway of tower

RANGE_ARBALETMAN_MIN = 4; //KaM: We will shoot a unit standing 4 tiles away, but not one standing 3 tiles away
RANGE_BOWMAN_MIN = 4;
RANGE_SLINGSHOT_MIN = 4;
RANGE_WATCHTOWER_MIN = 0; //In KaM towers have no minimum range, they will shoot any unit less than the range

Re: New Dynamic Script Ideas

PostPosted: 23 Jul 2014, 01:29
by RandomLyrics
States.UnitIdle(aUnit: integer) - returns true if unit is idle. (serf have '?' over head). for exmaple you can count how many serfs are idle in your town. You can remove idle workers.
returns true for "army type" units if they havent any order (like walking, attacking, shooting) :)

Re: New Dynamic Script Ideas

PostPosted: 23 Jul 2014, 18:02
by pawel95
For Coop Maps (also for tsk/tpr coop maps): It would be quite cool when you could set a "randomizing" AI Attacking position: This way it´s possible that the ai will attack human player 1 or 2 (first). Would it be possible? Idea came me today, when I saw that one guy way playing a coop mission, but he already knew when and where he would get attacked (6)