Post 03 Jan 2019, 15:22

RnSt script-RaNdom STorehouse

Hi,

I've worked out a script which is randomly place the storehouse on the locations. Probably some of them already played it on Rich Land which was one of the beta version of the script. (the coordinates were typed there manually. The new one is working with a kind of radius from the originally added Storehouse.)

This script can be a nice solution vs the pre-builders. Of course there are pros and cons. Just few of them:
cons:
-random placement of the storehouse. It sometimes make the locations harder, but sometimes makes easier.
-Some position can make crying players

Pros:
-Easy set up of the script
-always different starting position
-need a bit more sense to adept the new position.


If would like to try out the script on different map:
1. Set up vision for every location. It is not problem on well known map. But sometimes good if you have opened editor to know where to build.
2.copy the *.script file into the target map's folder and rename the *.script file
3.open the *.script file and set up constans parameters(const)
SX,SY is the size of the map.
The storehouse values are evident.(At this moment using only the regular wares only, and 3labourer+4serfs set up.)
RS=5; -this is the radius from the original Storehouse's position. 5 tiles to each direction- so it means 10*10=100tiles where the storehouse can be placed randomly. Of course depends of the objects and the edges of the map. Take care to setting up very huge number, as in that case storehouses can be placed into the battle field or into the neigbours location. Value 10 already gives very strange placements. Larger values can be playable if adding more stones to the Storehouse. Don't forget the stonemason can walk 14-15 tiles.
  Code:
const //max size of the map; SX= 238; //X coordinate SY= 190; //Y coordinate //values for the wares in the STOREHOUSES ST= 65; //stone TM= 50; //timber GC= 60; //goldchest WB= 50; //winebarrel BR= 40; //bread SO= 20; //sousage FI= 30; //fish //The +/-tile delayfrom the original storehouse RS= 5; 4.Set up PP, the numbers of the players. Enjoy the random s :mrgreen: t.
Rich Land RnSt has a specielly modified script with the uniqe set up. If wants to make uniqe location set up then just use kind of code at the last phase of the OnMissionStart.
In the sample code Player 4 and player 8 get some bonus wares and +1+1serfs, labourers. I guess it could work in the new version also, but I did not have enough time to test it. (XR[P],YR[P] are the coordinates of the freshly placed storeH)
  Code:
//few additional for loc 4&8 If (P = 3) or (P = 7) then begin Actions.GiveWares(P,2,10);//timber +10 Actions.GiveWares(P,8,5);//wine +5 Actions.GiveWares(P,10,5);//bread Actions.GiveWares(P,13,5);//sousage +5 Actions.GiveWares(P,27,5);//fish +5 Actions.GiveUnit(P, 0, (XR[P]-1), (YR[P]+2), 4); //serfs Actions.GiveUnit(P, 9, (XR[P]+1), (YR[P]+2), 4); //labourers XZ[P]:=XR[P]; YZ[P]:=YR[P]; //inc(P); end;



From here can download the latest version of the script which easily can be added to any map with the steps described previously.
Border Battlefield v1.1 RnSt.zip
Have fun!
t
You do not have the required permissions to view the files attached to this post.