Random map scripting




  • Admin
There is not too much in the field of random map scripting that I can add. The best thing I can do is share the most complete guide I know of
Definitive Random Map Scripting Guide

It’s a very complete and up to date guide, that even informs which version of the game supports each command, so that people programing for older versions of the game are aware of it.

I have tried to do some research on the field of porting scripts from Definitive Edition to Wololo Kingdoms DE. However I’ve been unable to create a tool able to completly translate the code; there are too many variables I may have not encountered and different scripters have different ways of writting the variables that confuse any automatic translator.

What I can contribute with is with a couple of features added in Definitive Edition for which I have created scripts to add code to existing maps. The first one is the circle_radius, a feature to place players at the same distance from the center of the map, and Fixed Positions, a feature that places players of the same team in order so that players are able to decide whether to be flank or pocket.

This two features are based on using the “direct_placement” option, that puts objects in speciffic coordinates, rather than the “random_placement” that is usually used in random maps.

Also, I’ve seen people using Allied Vision mods all the time when it’s really not needed if you configure the map to have the resource that activates cartography set to 1 from the beginning. I’ll explain how to do so.

circle-radius command​

This command is used to set the bases of the players at the same distance to the center, along a circle of a given radius. This helps avoiding edges of the map.

The idea of placing players along a circle was around before this command was implemented, I’ve seen old scripts by Chrazini that do that. However, I’m not aware of a tool that generates that code automatically, as it can easily be 10,000 extra lines, which is impossible to copy from an existing script in order to adapt it.

The script I’m sharing here creates the necessary code to copy directly into the random map script and handle the random placement of players. It uses the command “assign_to AT_TEAM” that gives the position to a member of the team without considering order. Note the following:
  • You have to set the placement to “direct_placement” in the section. Normal random maps have “random_placement” instead.
  • This code is meant to be placed in the section, where the “create_land” of the players should be.
  • When using it, you need to modify the variable constants with the lines of code that should go in all “create_land” entries, such as terrain_type, land_percent, base size, etc.
  • You can set the radius of the circle for each number of players.
  • This code will add a bit of deviation in the circle when having 4 or less players and put players equidistantly when having 5 or more, so as not to have bases intersecting.
Access the Python code here.

See the map “DE_Big_Freeze” for an example of where to put the code.

Fixed Positions​

Definitive Edition introduced the option Team Positions that places players of the same team in order, so that middle numbers are always pockets. For Wololo Kingdoms, this was adapted in some maps of the ECL. The script I did is very similar to the one that creates circles except that it only works for 3v3 and 4v4 games and that it replaces the “assign_to AT_TEAM” command with “assign_to AT_COLOR”, that gives the land to the speciffic color. For this reason, players can only use speciffic colors, as explained in Features.

Access the Python code here.

Allied Vision​

Having allied vision activated at the start of the game is easy. That functionality depends on a resource that is initially set to zero until the players build the market.

To set it to one at the start, in the section PLAYER SETUP, add the following:
#const REVEAL_ALLY 50
effect_amount MOD_RESOURCE REVEAL_ALLY ATTR_ADD 1

The first line declares a value and gives it the resource ID and the second one adds 1 to the value of the resource, setting it to 1.

Longer Lasting Resources​

This feature can be added into the map by changing the ammount fo resources the objects carry. You need to add the following lines in the PLAYER SETUP section:

Code:
effect_amount SET_ATTRIBUTE BAMBOO_TREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE OAKTREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE PINETREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE PALMTREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE TREE_A ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_B ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_C ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_D ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_E ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_F ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_G ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_H ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_I ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_J ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_K ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE TREE_L ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE FOREST_TREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE SNOWPINETREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE JUNGLETREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE DRAGONTREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE BAOBABTREE ATTR_STORAGE_VALUE 2000
effect_amount SET_ATTRIBUTE ACACIA_TREE ATTR_STORAGE_VALUE 1500
effect_amount SET_ATTRIBUTE DLC_MANGROVE_TREE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE DLC_RAINTREE ATTR_STORAGE_VALUE 1000

#const GURJARA_BUSH 1628
effect_amount SET_ATTRIBUTE FORAGE_BUSH ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE DLC_ORANGEBUSH ATTR_STORAGE_VALUE 1250
effect_amount SET_ATTRIBUTE GURJARA_BUSH ATTR_STORAGE_VALUE 1250

effect_amount SET_ATTRIBUTE GOLD_MINE ATTR_STORAGE_VALUE 8000
effect_amount SET_ATTRIBUTE STONE_MINE ATTR_STORAGE_VALUE 3500

effect_amount SET_ATTRIBUTE FISH ATTR_STORAGE_VALUE 2000
effect_amount SET_ATTRIBUTE SHORE_FISH ATTR_STORAGE_VALUE 2000
effect_amount SET_ATTRIBUTE GREAT_FISH_MARLIN ATTR_STORAGE_VALUE 3500
effect_amount SET_ATTRIBUTE GREAT_FISH_MARLIN2 ATTR_STORAGE_VALUE 3500
effect_amount SET_ATTRIBUTE DORADO ATTR_STORAGE_VALUE 2250
effect_amount SET_ATTRIBUTE SALMON ATTR_STORAGE_VALUE 2250
effect_amount SET_ATTRIBUTE TUNA ATTR_STORAGE_VALUE 2250
effect_amount SET_ATTRIBUTE 458 ATTR_STORAGE_VALUE 2250

#const GOOSE 382
#const PIG 997
effect_amount SET_ATTRIBUTE DLC_LLAMA ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE GOOSE ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE SHEEP ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE DLC_COW ATTR_STORAGE_VALUE 1500
effect_amount SET_ATTRIBUTE TURKEY ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE PIG ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE DLC_GOAT ATTR_STORAGE_VALUE 1000
effect_amount SET_ATTRIBUTE DLC_WATERBUFFALO ATTR_STORAGE_VALUE 1500

#const IBEX 1472
effect_amount SET_ATTRIBUTE DEER ATTR_STORAGE_VALUE 1400
effect_amount SET_ATTRIBUTE DLC_ZEBRA ATTR_STORAGE_VALUE 1400
effect_amount SET_ATTRIBUTE DLC_OSTRICH ATTR_STORAGE_VALUE 1400
effect_amount SET_ATTRIBUTE IBEX ATTR_STORAGE_VALUE 1400

effect_amount SET_ATTRIBUTE WILD_BOAR ATTR_STORAGE_VALUE 3400
effect_amount SET_ATTRIBUTE JAVELINA ATTR_STORAGE_VALUE 3400
effect_amount SET_ATTRIBUTE ELEPHANT ATTR_STORAGE_VALUE 4000
effect_amount SET_ATTRIBUTE DLC_RHINO ATTR_STORAGE_VALUE 4000

You can change the resource numbers to whatever you want. In this example, it’s just the normal value multiplied by 10.
 
Back
Top Bottom