Jump to content
Sign in to follow this  
dreadedentity

[RELEASE] Simple Base Editor

Recommended Posts

Dread's Simple Base Builder

Hello all,

A few days ago, I started working on a small project that will allow anyone to easily create a base. This is the result.

Stable in: Current stable release of A3 at the time of this posting

How to use: Download the script and place it in your root mission directory. In your player-unit initialization line type:

baseEditor = [this, P2] execVM "DE_simplebuilder.sqf";

//script handle MUST be "baseEditor"
//first parameter MUST be "this" or whatever unit you want to be able to edit, if called through script
//P2: NUMBER - The height (in meters) you want to be able to increment Z by.

Now drop a few objects in that you'll think you want to build with and click preview. It's okay if you find out halfway through that you want different parts. Saving your project will be explained later in this post.

Controls:

After you have picked up an object, there are a few things you're able to do.

Insert - Duplicates currently held object (some objects will fall to the ground after being duplicated).

Delete - Deletes currently held object.

End - Drops currently held object (use in case "drop" option doesn't show up).

PageUp & PageDown - Raises and lowers the object using the P2 value you specified.

< & > - Rotates the object 1 degree counter-clockwise and clockwise, respectively. Starting rotation is calculated when you picked the object up so it may "skip" the first time you press the key, depending on how much you moved around.

Reload Script:

After you duplicate items you must reload the script, otherwise they will not have an option to be picked up.

Copy to Clipboard:

Here is where, personally, I think the magic happens. Select this option, then you can alt-tab into notepad or notepad++. Copy the output there, press ctrl+h, and "replace all" colon's ( : ) with semi-colon's ( ; ). I recommend doing this in a blank file so you don't mess with other parts of your code. Now copy that and you're ready to import it to your missions. Create a variable and save the output as a "code" variable type. Example:

base =
{
    //output
};

So how do I actually get the base back?

Simple! Now all you have to do is call or spawn the code variable you just made! (objects will be re-created at the location they were saved) Example:

[] call base;
//OR
[] spawn base;

That's it! Have fun building!

Download (Dropbox)

All persons are free to use and modify these scripts to fit their needs, provided the original credit remains intact or I am credited somewhere in the modified script.

Share this post


Link to post
Share on other sites
Thanks bud.

No problem. Although I couldn't really get the "dynamic" part figured out, the pieces just never came back correctly. I'm looking into resolving the issue, but for the moment I have only commented out the related code, rather than deleting it in case somebody wants to take a look at it. So for now you'll have to design your bases/stuff in the spot you want them to be in the map.

I came up with a simple workaround, but had trouble implementing it with code. Anyone that wants to do this will have to do it manually. You just have to define a center point (for the rotation) by creating an object at that location (I like to use blue arrows), iterate through the _base array and get the azimuth for all the pieces and attach everything to the center point, then you can rotate and move it at will. Finally you can rotate the parts again, detach everything, and delete the arrow. For example:

base =
{
_center = createVehicle ["Sign_Arrow_Blue_F", [YOUR,CENTER,POINT], [], 0, "CAN_COLLIDE"];
//base builder output
_rotation = [];
{
	_rotation pushBack (direction _x);
	_x attachTo [_center];
}forEach _base;
//rotate and move at will
{
	detach _x;
	_x setDir ((_rotation select _forEachIndex) + AMOUNT_OF_ROTATION);
}forEach _base;
deleteVehicle _center;
};

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×