Advertisement

Author Topic: v3scripts  (Read 1727 times)

0 Members and 1 Guest are viewing this topic.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
v3scripts
« on: 18 Dec 2008, 21:34:06 »
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.   :good:



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 object

Note 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:

Quote
_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

Code: [Select]
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;
};

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: v3scripts
« Reply #1 on: 18 Dec 2008, 21:37:21 »
Thanks for the submissions. Is it possible to package them up with a readme so they can go into the depot?
Xbox Rocks

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: v3scripts
« Reply #2 on: 19 Dec 2008, 09:18:17 »
 :)

You mean me doing that right?
Any special requirements?  :good:

Offline Wolfrug

  • Addons Depot
  • Administrator
  • *****
  • Official OFPEC Old Timer
Re: v3scripts
« Reply #3 on: 19 Dec 2008, 10:44:05 »
I have no idea how these things work - are these V3 scripts, to be used solely for addon-making in Visitor, or are they some kind of 'regular' scripts? :D

If they're solely V3 scripts to be used in Addon making, they go into the Configs & Scripting subforum, I'd think. Or the V3 subforum. What? I just work here!

They're looking good though!

Wolfrug out.
« Last Edit: 19 Dec 2008, 14:36:24 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: v3scripts
« Reply #4 on: 19 Dec 2008, 13:06:40 »
I'd say put these into the V3 forum and the O2 ones into the the O2 forum. I assume "configs and scripting" is about config.cpp and sqs/sqf to actually put into addons, not actually running scripts inside the BIS tools (I know these scripts are in SQF, but there are a lot of tool-specific commands which are quite irrelevant to most people). Feel free to take them where-ever suits you though, Wolfrug; it is your depot (They definitely aren't ED though :scratch:)
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Wolfrug

  • Addons Depot
  • Administrator
  • *****
  • Official OFPEC Old Timer
Re: v3scripts
« Reply #5 on: 19 Dec 2008, 14:44:17 »
Duly moved.

Q - perhaps for a set of scripts like these, it'd be best if you summarize them something like this:

scriptname1-> one line description of use
scriptname2-> one line description of use

etc. That way it's easy to put it into the description field of the "pack" : if you could also put them all together in a zip file or the like, that'd make it even better. :)

Note: If you only have like 2-4 or so scripts, then individual threads & individual uploading would probably be the best, but for larger packs than that one might as well put them all together in one.  :good:

Great stuff!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"