Map Database  •  FAQ  •  RSS  •  Register  •  Login

New Dynamic Script Ideas

<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 21 May 2014, 16:15

Re: New Dynamic Script Ideas

Maybe add Actions.gamespeed?
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

Location: Russia

KaM Skill Level: Beginner

Post 21 May 2014, 17:05

Re: New Dynamic Script Ideas

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)
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 21 May 2014, 17:13

Re: New Dynamic Script Ideas

Maybe something like Warrior randomizer?
<<

andreus

User avatar

Sword Fighter

Posts: 343

Joined: 18 Dec 2011, 12:05

Location: Russia

KaM Skill Level: Beginner

Post 21 May 2014, 17:22

Re: New Dynamic Script Ideas

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)
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 21 May 2014, 17:24

Re: New Dynamic Script Ideas

Oh sorry i didn't knowed about that i need to learn more pascal scripting
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 13 Jul 2014, 19:57

Re: New Dynamic Script Ideas

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
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 14 Jul 2014, 06:07

Re: New Dynamic Script Ideas

RandomLyrics wrote: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.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 14 Jul 2014, 09:57

Re: New Dynamic Script Ideas

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;
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 16 Jul 2014, 15:34

Re: New Dynamic Script Ideas

RandomLyrics wrote: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.

RandomLyrics wrote: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
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 16 Jul 2014, 18:10

Re: New Dynamic Script Ideas

Brilliant! Thanks Lewin :D
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 19 Jul 2014, 00:05

Re: New Dynamic Script Ideas

Some thing like bowman crossbowman range i mean it should look like this (x,y coords of ranged units height,widtht)
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 19 Jul 2014, 11:35

Re: New Dynamic Script Ideas

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.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3821

Joined: 16 Sep 2007, 22:00

Location: Australia

KaM Skill Level: Skilled

Post 20 Jul 2014, 03:59

Re: New Dynamic Script Ideas

RandomLyrics wrote: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
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 23 Jul 2014, 01:29

Re: New Dynamic Script Ideas

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) :)
<<

pawel95

User avatar

Castle Guard Swordsman

Posts: 1911

Joined: 03 Oct 2008, 22:00

Location: "Pawel95" on Youtube.com

KaM Skill Level: Skilled

Post 23 Jul 2014, 18:02

Re: New Dynamic Script Ideas

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)
PreviousNext

Return to Ideas / Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest