Jump to content

Building Optimizer/Organizer


Recommended Posts

Idk if this is the right place for this, but it seemed like the most obvius ...

 

anyway, i got sick of always having such a hard time going through my map additions when i need to change something, so i wrote a script that (once setup correctly) can help you organize and/or optimize your buildings/vehicles from map additions on your server

 

idk if anyone else ever had the problem of going through all the diffrent map additions you have cause:

some building needed to be set to indestructable or

a vehicle needed variables set to not be deleted by the server or

loot that needs permaloot variable to avoid the server cleanup or

a vehicle init that needs to be set in a certain way or

a building that needs to be upright and

what about when i switch map, i have to change what script is executed or not and

how exactly was it i lit an object on fire or filled a crate with random loot?

 

 (....list goes on from here)

 

this will take care of all that ...

 

obviusly it will take some time to setup if you have a lot of map additions (hurray for macros), but once done and notes set by each addition this will give a much better overview of your map additions, not to mention the easy management in case buildings/vehicles needs to change or diffrent vars set

 

... i did throw in a few of my own buildings and some map additions i picked up on the forum, including the default traders of cheranrus (aircraft dealer is changed tho) and utes (+my additions)

 

personally i use it for pretty much all my buildings and box spawns on my server and afaik the players are pretty happy about the box filling

 

editor format:

_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["M1A2_TUSK_MG", [2280.48, 14372.865, 0.00012207031], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setDir 87.745941;
  _this setPos [2280.48, 14372.865, 0.00012207031];
};

my format:

//this vehicle will be locked and protected from server delete and disabled R3F Tow and lift
[["M1A2_TUSK_MG", [2280.7029, 14365.368, -0.00012207031]],[90.433128],[0,7,3,5]],

buildingOptimizer.sqf

http://pastebin.com/pSHM8iFw

 

buildings.sqf

http://pastebin.com/V25YwYdq

 

boxfill.sqf

http://pastebin.com/0ajwHcgT

 

install can be done in many ways, the most obvius and easiest would be to put them in dayz_server.pbo in a folder called buildings (or whatever you want, as long as all three files are togheter) and in your init use something like this:

if (isServer) then {
	// Add custom buildings
	_handle = [] execVM "\z\addons\dayz_server\Buildings\buildingoptimizer.sqf";
};

(i guess this might needs a bit more explaining for normal humans to understand, so if someone else can help me explain it better, it would be greatly apriciated)

 

currently does not work for spawning the trader units ... (but i have plans)

 

anyways enjoy if you like

 

Regards

Halvhjearne

Link to comment
Share on other sites

idk if i get an actual performance gain from this, as it only runs once when the server starts it dosnt really affect performance really, but had it not been for the fact that i forgot to change the cratefiller to a private var (since i use it for other stuff), it would forget everything when it is done, so no resource waste atleast.

 

also i use execVM, you could do something like call compile preprocessfilelinenumbers, im pretty sure that would speed up things, but what would be the point?

it does write in the log how long it takes to finish the script, so you are welcome to test.

 

however you do get an awsome overview of your buildings so you can easy edit stuff and you can quite easy add a new case to the setvars function and do something else, if you have something special you like to do to buildings or vehicles like set a variable or whatever really, if not that then you can always just set something custom in the init field if you need.

Link to comment
Share on other sites

What sort of performance gains if any are you seeing from this

It really just streamlines your builds especailly if you have a lot of commands to set. If you have vehicles that you don't want players to sell, or you have a lot of setvectors and you can even add your own function if you have your own commands that you commonly use.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...