To activate the "little oval one that gives a bunch of options like demolish building, sell building. rename building, etc etc" set *settings -> Buildings -> Scripted Buildings to 1.
To set a percentage of the building materials to be recouped on demolish, set *settings -> Buildings -> Demolish Options (which has been renamed to 'Demolish Recoup Percentage' for 0.64.2).
If you want to do something more custom you can script a custom option to do it.
Adding a button that only appears for the owner is easy (and something you'll see done frequently in the civ sample code)..
Code: Select all
if ( $gBuildingOwnerID == $gPlayerID )
{
// Add your owner button(s) here
}
else
{
// Don't
}
From there, yeh, you'd do the normal OSDSelect event and *grantitem any items you want to return.
That leads to the interesting conclusion that there isnt a command to demolish an individual building yet (only *demolishplayerbuildings, which removes everything the player owns) so
*demolishbuilding [BUILDING_ID] has been added for the 0.64.2 server