IPB Style© Fisana

Jump to content


Need help with tile area placement


  • Please log in to reply
2 replies to this topic

#1 FeXoR

FeXoR

  • Community Members
    PipPipPipPipPip

  • Centurio
    (659 posts)

Posted 20 March 2012 - 02:36 PM

When I have a list of tiles for example tileList = [[23, 116], [23, 117], [65, 86]] is it possible to use the standard area/placers/painters/constraints methods to place terrain/hight/... on them?

As you can see the tiles in the list are not necessarily connected.

I can add them to a tile-class or place terrain and set hight manually but I want them only to be placed if constraints are ok so their placement has to check other tile-classes.


So it would already help if I could check the constraints of the other tile-classes.

I would be grateful if someone could help me with that.

I don't mind the notation like tileList = [x1, z1, x2, z2...] or whatever.


Posted Image Im Übrigen bin ich der Meinung, dass 0A.D. Auslöser braucht. (IMO 0A.D. needs triggers ASAP.)

#2 Spahbod

Spahbod

  • WFG Programming Team

  • Triplicarius
    (534 posts)

Posted 20 March 2012 - 02:54 PM

You can do that I think. Painters are only dependent on an array of points no matter the number/placement.
Omid Davoodi [ aka Spahbod ]

Wildfire Games Random Map Designer, Low-level Programmer
Contact me: myops37@yahoo.com


Support Wildfire Games!

#3 FeXoR

FeXoR

  • Community Members
    PipPipPipPipPip

  • Centurio
    (659 posts)

Posted 20 March 2012 - 03:34 PM

View PostSpahbod, on 20 March 2012 - 02:54 PM, said:

You can do that I think. Painters are only dependent on an array of points no matter the number/placement.

Hm, ok.
Did this by:


var placer = new ClumpPlacer(1, 1, 1, 1, x, z);
var painter = [new TerrainPainter(terrainWood), new ElevationPainter(randFloat())]; // new TileClassPainter(clForest)
createArea(placer, painter);

for every single tile.

The TileClassPainter is commented out because he throws an error. (Not a problem for me cause I can add them by addToClass but in general it is)

A problem is that the SmoothElevationPainter does not work properly too. Even if I set height to 0 and no matter if I choose ELEVATION_MODIFY or ELEVATION_SET a single tile is alway very high on the left side (perhaps +10) and about half as high on the right.

However, it works with ElevationPainter as I did it manually.

Thx! Just needed a little motivation ^^

What happens if you place 2 clump placers at the same position when painting entities. Will there be 2 placed at the center of the same tile?



Edited by FeXoR, 20 March 2012 - 07:31 PM.

Posted Image Im Übrigen bin ich der Meinung, dass 0A.D. Auslöser braucht. (IMO 0A.D. needs triggers ASAP.)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users