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

AI & RM Scripting
Moderated by Leif Ericson

Hop to:    
Welcome! You are not logged in. Please Login or Register.2 replies
Age of Kings Heaven » Forums » AI & RM Scripting » Why won't my objects place?
Topic Subject:Why won't my objects place?
local boi
(id: dragon14)
posted 06-02-18 08:06 PM CT (US)         
today I've tried placing objects on WATER and GRASS

in both cases I used base_size, number_of_tiles and set_avoid_player_start_area tricks to spawn these terrains close to players, originally at the request of an aoezone user to make a map where fish spawn instead of berries. Then in objects i do set_place_for_every_player along with terrain_to_place_on

I'm using so many commands, I'm not entirely sure what is causing them to not spawn.

Hypothesis: Objects using set_place_for_every_player cannot spawn using terrain_to_place_on when the terrain was created using set_avoid_player_start_areas

In order to workaround this I find that you must use temp_min_distance_group_placement instead of set_place_for_every_player, and place enough groups that every player gets one. Additionally, you may need to use other_zone_avoidance_distance, otherwise two players terrains may be so close as to disallow all groups to place

In the below code, try adding set_place_for_every_player to the GOLD and see what happens


base_terrain FOREST

/* base_size 9 with number_of_tiles [0-1] creates 19x19 square */
/* bs 10 with not 0 makes 21x21 */

/* The following example will always spawn 19 extra tiles along the bottom side of a player land.
With smaller number of tiles, you can spawn less tiles. They start spawning from the right corner
Minimum number_of_tiles N for this example is N = 2; N < 2 has no effect
the number of tiles spawned does not match the number you use
For number_of_tiles N where N > 1 and N < 11, you can use the following function
f(N) = 2(x-1) + 1, where f(N) returns the number of extra tiles
set_avoid_player_start_areas avoids a 19x19 area centered on player lands
when combined with base_size and number_of_tiles, you can
create terrain only along a corner or bottom edge of a player land
then place objects only on that terrain
it's a bit confusing */

terrain_type DESERT
number_of_tiles 10
base_size 9
top_border 4
bottom_border 3
left_border 4
right_border 3
other_zone_avoidance_distance 10

create_terrain GRASS
base_terrain DESERT
land_percent 1
number_of_clumps 99


create_object TOWN_CENTER
min_distance_to_players 0
max_distance_to_players 0

create_object VILLAGER
min_distance_to_players 6
max_distance_to_players 6

create_object GOLD
number_of_groups 8
temp_min_distance_group_placement 20
terrain_to_place_on GRASS
number_of_objects 7

katsup or mustard

[This message has been edited by local boi (edited 06-02-2018 @ 08:20 PM).]

posted 06-05-18 07:25 PM CT (US)     1 / 2       
I did a bit of testing, and your issue is that you need to use set_gaia_object_only if you use set_place_for_every_player to place objects for players that aren't player-controlled objects.

......./ / / \ Check out my Blacksmith submissions as well as my stuff in the Steam Workshop.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Updated New RMS Guide <<<version 2.0 is out<<< and the Random Map Scripting Links and FAQ thread.
..../_____\\\ \
....\\\\\\\\\\\\\/ (unknowingly) the submitter of the 12000th item to the Blacksmith.
local boi
(id: dragon14)
posted 06-06-18 04:01 PM CT (US)     2 / 2       
omg i keep making that mistake lol

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

Hop to:    

Age of Kings Heaven | HeavenGames