You must be logged in to post messages.
Please login or register

AI & RM Scripting
Moderated by Sebastien, Leif Ericson

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: More undocumented RM scripting commands
posted 01-14-15 03:07 PM CT (US)   
So I was browsing through the string tables (trying in vain to change the fonts in the HD Edition) when I found the strings associated with rm scripts. Among those I found a couple more that aren’t documented anywhere yet:

In PLAYER_SETUP
set_position [N?] - I couldn’t get it to have any discernible effect.
min_distance [N?] - No discernible effect
max_distance [N?] - No discernible effect

In LAND_GENERATION
min_placement_distance [%?] - It has an effect, but I'm not sure exactly what it is yet. Only used in the Gold Rush map.
land_position [0-100%] [0-99%] - Defines the origin of a given land using X% and Y% coordinates. For example, land_position 50 50 would place the land at the map center. Default is random. Disabled for player lands and lands with assign_to_player. Setting the second number to 100 will crash the map. If land_position specifies an origin that lies outside the area specified by left_border %, right_border %, top_border %, bottom_border %, the land will not be created.

In ELEVATION_GENERATION
spacing [any number ≥1] - Specifies the spacing between each height level on each clump of elevation. Default is 1. Larger numbers produce hills with rings of flat areas on each level that can look sort of like a stepped pyramid.

In CLIFF_GENERATION
min_terrain_distance [any number ≥0] - Specifies the min distance of cliffs to the nearest body of water, including ice. Default is 1. Note that cliffs are generated before terrain, so this is not affected by terrain water.

In TERRAIN_GENERATION
percent_of_land [%?] - No discernible effect

In CONNECTION_GENERATION
create_connect_same_land_zones - Seems to behave exactly like create_connect_all_lands
default_terrain_replacement [a terrain name] - Creates connections by replacing ALL intervening terrain with the specified terrain. To be used before any replace_terrain commands. When used after a replace_terrain statement it overrides it and rereplaces terrain along the connection.

Others
#undefine - Doesn’t negate a previously used #define statement. Also doesn’t negate any predefined definitions as far as I can tell.

Definitions
FIXED_POSITIONS - Defined if the “Team Together” box is checked
DEATH_MATCH - Works
HIGH_RESOURCES - Works
MEDIUM_RESOURCES - Works
LOW_RESOURCES - Works
DEFAULT_RESOURCES - Works

As you can see, for many of these I have not been able to get them to work yet. I will update this post when I find out any additional information. If you know anything about any of these commands, please say so.

Cheers!

EDIT - Updated based on the new findings discussed in the comments. I also added land_position and spacing for elevation, which were discussed in a previous thread.

......../\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.

[This message has been edited by Zetnus (edited 03-11-2015 @ 08:37 PM).]

Replies:
posted 01-14-15 03:48 PM CT (US)     1 / 10  
Cool info!

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 01-20-15 05:03 PM CT (US)     2 / 10  
A bit more about min_terrain_distance [N] for cliffs, which is one of the more useful commands in this list:
It causes cliffs to avoid ice as well as water.
However, this does not apply to water or ice created with TERRAIN_GENERATION (perhaps because cliffs are placed before terrain is placed?).

I've incorporated those commands that I can get to work into the Updated New RMS Guide.

......../\
......./ / / \ Check out my Blacksmith submissions as well as my Random Map Scripts.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Definitive Random Map Scripting Guide
..../_____\\\ \
....\\\\\\\\\\\\\/ and the Random Map Scripting Links and FAQ thread.

[This message has been edited by Zetnus (edited 01-20-2015 @ 05:08 PM).]

posted 01-31-15 02:22 PM CT (US)     3 / 10  
A bit of progress:
min_placement_distance IS used in an official map. It's used exactly once in Gold Rush. It seems that it was removed by the Forgotten Empires team since it's no longer in the updated Gold Rush.

It is used in LAND_GENERATION under create_land and has a value of 100.
Altering this value changes the way the lands are generated (from the same seed), but only in large increments. For example, setting the value to 50 might change the map, but setting it to 90 might not. Setting it to 0 might then produce the same lands as setting it to 50. But in different situations the map will change when altering the setting from 20 to 25.

Adding this command to multiple non-player lands also sometimes affects the pattern of land generation differently from when it is only added to a single land.

Unfortunately, I have not been able to see any patterns in the way in which min_placement_distance affects land generation. It certainly DOES have some sort of effect, but it's annoyingly elusive. It's not as simple as the min distance between lands, or between the centers of lands, or to the nearest player land...

Following this discovery I searched all the gamedata.drs files for any of the the commands, but none of the others turned up (other than DEATH_MATCH in MegaRandom).

[This message has been edited by Zetnus (edited 01-31-2015 @ 02:23 PM).]

posted 02-22-15 12:58 PM CT (US)     4 / 10  
Random titbit of information:

The pre-defined name for Perch is just "FISH"

I never realized that until now.
posted 02-22-15 09:39 PM CT (US)     5 / 10  
Sounds fishy to me
posted 03-06-15 11:53 AM CT (US)     6 / 10  
Another minor discovery:
When you use spacing_to_other_terrain_types this also affects the minimum distance of your terrain patches to any cliffs.
This lend further credibility to my assertion that cliffs are generated before before terrain.
posted 03-06-15 05:51 PM CT (US)     7 / 10  
Thanks for listing all of this here!

If i have some free time at some point i may try to create a fancy rms there.

Creator of Promi.
Any feedback is greatly appreciated.
posted 03-09-15 12:48 PM CT (US)     8 / 10  
This is really interesting, thanks for looking into the things and sharing your results!


FIXED_POSITIONS could refer to the checkbox in the setup menu that decides if teams are next to each other or randomly scattered? I think it's called "Team Together".

[This message has been edited by John the Late (edited 03-09-2015 @ 12:50 PM).]

posted 03-11-15 01:57 PM CT (US)     9 / 10  
FIXED_POSITIONS could refer to the checkbox in the setup menu that decides if teams are next to each other or randomly scattered? I think it's called "Team Together".


Good call! I just tested this, and you are correct. FIXED_POSITIONS applies whenever the "Team Together" box is checked.
posted 04-28-15 07:28 PM CT (US)     10 / 10  
More random news:
I've discovered a partially implemented terrain that is exclusive to the HD Edition (and AoF) on Steam.
It's called "ROCK" and no, I don't mean terrain 40.
If you use "create_terrain ROCK" it will create a patch of black terrain (because there is no texture for it). Units and buildings can't be placed on this terrain, however units can walk on to it. It's white on the minimap.
The reason why this is significant is because if you try to for example define terrain 40 as "ROCK" (#const ROCK 40) it doesn't work, because ROCK is already a predefined name. So you have to do something like "#const ROCK1 40".

I don't know the terrain const for ROCK; all I can say is that it's not 42 or 43. It doesn't show up in the Advanced Genie Editor 3 as far as I can tell.

Using "create_terrain ROCK" in the non-HD version will crash the game.

EDIT: Using ROCK1 is a bad idea too because that generates a grass covered terrain rather than the const you specified it as. Looks like that name is also already taken. :P ROCKS isn't specified though.
EDIT2: ROCK1 is only defined in AOF, and is functionally equivalent to GRASS. If used in non-AoF it is ignored and does not cause crashes.
EDIT3: Last edit, I promise!
It's more complicated than I originally thought, and I think I better stop making edits until I actually understand what's going on a bit better. In the meantime all I will say is that it looks like the function of some of the grass terrains has been recently altered in the HD Edition.
Somehow this happens to me rather often: I find something cool, and get excited about it. And then, once I've started to tell people about it, I realize that there is much more to the story than what I already know.

[This message has been edited by Zetnus (edited 04-28-2015 @ 07:58 PM).]

Age of Kings Heaven » Forums » AI & RM Scripting » More undocumented RM scripting commands
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames