I want to share a few basic visitor 3 scripts.
As there is very limited info out there, I thought it might be a good idea.
Single thread per script vs summary thread. Well unsure whats best here.
I do the summary thread for now. Please move if wrong category.
Unfortunately there are too many things on the list for perfect documentation.
So hope the basic summary is enough. Otherwise feel free to ask.
1)
Add/subtract an delta height from a particular objectNote that you need to select the object(s) and apply the script.
Add additional models and their specific height at the start of the script:
_heightDelta = 20.75;
_replaceObjectName = str("o\hous\most_stred30");
//_heightDelta = 20.88;
//_replaceObjectName = str("ace_vegetation_obj\m\tree\ace_akat02s");
and uncomment what you want to use.
ACE_SetAbsoluteHeightDelta.vis
echo "------------------------------";
echo "ACE_SetAbsoluteHeightDelta.vis";
echo "------------------------------";
// ---------------------------
// model specific height value
// ---------------------------
_heightDelta = 20.75;
_replaceObjectName = str("o\hous\most_stred30");
//_heightDelta = 20.88;
//_replaceObjectName = str("ace_vegetation_obj\m\tree\ace_akat02s");
//_heightDelta = 20.88;
//_replaceObjectName = str("ace_vegetation_obj\m\tree\ace_akat02s");
//_heightDelta = 20.88;
//_replaceObjectName = str("ace_vegetation_obj\m\tree\ace_akat02s");
// ------------------------
// gets the active document
// ------------------------
_doc = getActiveDoc;
// ----------------------------------
// dialogs definitions and formatting
// ----------------------------------
_dlgWrn1 = [200, 40, "Warning",["label", 180, 13, "Please select at least one object and then rerun the script.", 0], ["break"],["ok-button", 50, 13]];
// -------------------------
// gets the selected objects
// -------------------------
_obj = getSelectedPosEdObjects _doc;
_nObj = count _obj;
// -----------
// script core
// -----------
// there at least one object selected
if(_nObj > 0) then
{
_i = 0;
// Set the new height of all selected objects
{
if (str(getTemplateName _x) == _replaceObjectName) then {
_pos = getZeroPos _x;
_relHeight = getRelHeight _x;
_landHeight = (_doc getLandHeight _pos) select 0;
_offset = _relHeight - _heightDelta - _landHeight;
_x setRelHeight _offset;
_strLandHeight = str _landHeight;
_strOffset = str _offset;
_strRelHeight = str _relHeight;
_i = _i + 1;
_message = "LandHeight: " + _strLandHeight + ". Offset: " + _strOffset + ". RelHeight: " + _strRelHeight;
echo _message;
};
} forEach _obj;
// prompts final message
_strNumberOfModifiedObjects = str(_i);
_message = "Modified " + _strNumberOfModifiedObjects + " height values.";
echo _message;
}
else // there are no objects selected
{
// shows the Warning 1 dialog
_res = dialogBox _dlgWrn1;
};