Page 1 of 1
Placing buildings
Posted: Tue Jan 21, 2014 1:35 pm
by matias
The building aren't placed where the watermark shows inside world building
Code: Select all
EVENT("OSDSELECT","BuildOSD:005")
{
*buildingconstruct %PLAYER% 5 Wall
}
EVENT("PlaceBuilding","5")
{
$didAdd = sysAddBuilding(5,$gPlayerID,$gPlayerX,$gPlayerY,Wall,0,0 )
}
Posted: Tue Jan 21, 2014 2:36 pm
by Mit
'sysAddBuilding' uses map/tile coordinates, which is appropriate on some worlds but not on others.
You might want to use sysAddBuildingWorld and instead of $gPlayerX and $gPlayerY (which provide you with the player location in map/tile coordinates) you'd use $gPlayerWorldX and $gPlayerWorldY.
That do the trick?
Posted: Wed Jan 22, 2014 2:26 pm
by matias
i used that but it places the buildings in the place where the player is and i want to use the tile separation for better organization between buildings. if the building canĀ“t fit the ghost building i ll have to change all the 0 position of all my buildings with the converter.. and i think its easier to change the parameters of the position of the building to fit the ghost one
Posted: Wed Jan 22, 2014 5:39 pm
by zaroba
If you edit the models themselves and the script tries to place them where the player is standing and not where the ghost is showing, then the player will need to be in a specific spot for the building to appear where you want them or they will still be off.
Also, if the building models are off center then their names wont show directly over the buildings in-game and the access area will be off as I believe these are based on where the building is placed, not where the model is located.
Posted: Wed Jan 22, 2014 6:10 pm
by matias
To be clear.. when i used the build placing as an adm in the world (configurated to use tile spacing ) the building fitted the ghost. but when i scripted something to build for players the building doesnt fit the ghost its y.x displaced from ghost
Posted: Fri Jan 24, 2014 10:41 am
by Mit
mm.. ok.. this sounds like it might be a bug in the way the building construct ghost works in the tile-based placement modes. Can you confirm your setting for Buildings -> Positioning Mode ?
Meantime, as an alternative you could probably work around this in script using
sysGetTileCenter such as :
Code: Select all
$tileCenterX = sysGetTileCenter( $gPlayerWorldX )
$tileCenterY = sysGetTileCenter( $gPlayerWorldY )
$ret = $sysAddBuildingWorld( 5, $gPlayerID, $tileCenterX, $tileCenterY,Wall,0,0 )