When i use
EVENT("OSDSELECT","BuildOSD:001")
{
*buildingconstruct %PLAYER% 3 Tower
}
EVENT("PlaceBuilding","3")
{
$newBuildingID = sysAddBuilding( 3,$gPlayerID,$gPlayerX,$gPlayerY,Tower,25,75 )
}
A ghost model appears in the center of the tile but when i place the building its placed in the corner... how can i make it to be placed where the ghost model is?
I use placeing mode 1 in game settings
Construction ingame menu script
sysAddBuilding uses map coordinates, what you're looking for is 'sysAddBuildingWorld' and you'll need the player's world rather than their map coordinate.
e.g.
e.g.
Code: Select all
EVENT("PlaceBuilding","3")
{
$newBuildingID = sysAddBuildingWorld( 3,$gPlayerID,$gPlayerWorldX,$gPlayerWorldY,Tower,25,75 )
}
ah ok.. that sounds like a bug which i'll need to look in to.. the sysAddBuilding should match the placing when in positioning mode 1.
Meanwhile, i think you can get the same effect by using the world coordinates and calculating the tile center as shown..
Meanwhile, i think you can get the same effect by using the world coordinates and calculating the tile center as shown..
Code: Select all
EVENT("PlaceBuilding","3")
{
$worldX = sysGetTileCenter( $gPlayerX )
$worldY = sysGetTileCenter( $gPlayerY )
$newBuildingID = sysAddBuildingWorld( 3,$gPlayerID,$worldX,$worldY,Tower,25,75 )
}
mm.. looks good to me and is used on aramathea to place towns without problems.
try replacing the 'sysAddBuildingWorld' with a
to see if the variables are being set correctly? (I presume the error is comin from having a building at 0,0)
try replacing the 'sysAddBuildingWorld' with a
Code: Select all
*say Coord: $worldX , $worldY