Hello everyone, I'd like to share one of my creations to you in exchange of some help...
Here's what I have to offer:


Uploaded with ImageShack.us
The Old Spanish Castle is a small construction I did for Lingor. It's situated atop "Sniper Hill", nearby El Villon and provides for excellent over-watch over the entire area.
The castle is of simple but very functional design, it comes with a custom weapon spawn on top of it's south tower (M4SPR, can be disabled or changed to something else very simply) and a food box.
I've tested it on my server and it works fine. Just some minor script.txt fixes so it doesn't kick people.
Now, the way I add this to the server is what I'd like to consult with you all. You see, I tried the mission.sqm method, you know, adding them to the mission file, but it was too cumbersome and some things just did not work right. It also required a lot of work when I had to add new things because I had to merge and repack and you know the drill...
So I came up with an idea. After working with the 3D editor and the 2D to 3D converter... and learning the basics about coding, I realized that the 3d Editor mission.sqf is pretty much a very rough script file.
With that in mind, I aimed to convert my map-addition to a script, so I could easily enable and disable it whenever I wanted to, and edit it without having to touch the mission.sqm. The matter was simple, removed a couple lines from the top and from the bottom and the script worked like a charm. Just requires a line on your init.sqf.
So if everything is so peachy, why do I need help? Well, my server has been taking performance hits for a long while, and I'm pretty sure the way I'm adding these new locations must be very costly in that regard. I'd be very grateful if anyone who actually knows his way around scripting can tell me if there's a way of fixing this script (and others like it) so it doesn't make my players lag, or, at least, tell me to give up and go the regular way.
So, without further ado, here's the script.
Step by step:
1) Download the script.
2) Unpack your mission.pbo
3) Put the file you downloaded on your mission folder (created when unpacking the .pbo)
4) Open the init.sqf on your mission folder.
5) Add the following line on the very bottom:
6) Save the file.
7) Repack your mission.
Recommendation
To check if you like the castle, and if it works for you, I recommend you try it on your editor first. Just create a new mission on the 3D editor and save it. Go to your mission folder (the one you just created) and create an init.sqf. Add the command specified on step 5 to your fresh init and save. Now paste the OSC.sqf on the same folder and restart it. The castle should be there.
Notes
The castle towers WILL spawn zombies.
I've marked both the Food Box and the Custom Weapon as Container and Weapon Holder respectively. Should be easy to delete or modify them.
The commands used on this script that might trigger off restrictions are: setPos, setVectorUp and setDir.
EDIT
In my server, I mark all the custom locations so players know where to go to check the new things out. Here's the code for the marker.
Here's what I have to offer:


Uploaded with ImageShack.us
The Old Spanish Castle is a small construction I did for Lingor. It's situated atop "Sniper Hill", nearby El Villon and provides for excellent over-watch over the entire area.
The castle is of simple but very functional design, it comes with a custom weapon spawn on top of it's south tower (M4SPR, can be disabled or changed to something else very simply) and a food box.
I've tested it on my server and it works fine. Just some minor script.txt fixes so it doesn't kick people.
Now, the way I add this to the server is what I'd like to consult with you all. You see, I tried the mission.sqm method, you know, adding them to the mission file, but it was too cumbersome and some things just did not work right. It also required a lot of work when I had to add new things because I had to merge and repack and you know the drill...
So I came up with an idea. After working with the 3D editor and the 2D to 3D converter... and learning the basics about coding, I realized that the 3d Editor mission.sqf is pretty much a very rough script file.
With that in mind, I aimed to convert my map-addition to a script, so I could easily enable and disable it whenever I wanted to, and edit it without having to touch the mission.sqm. The matter was simple, removed a couple lines from the top and from the bottom and the script worked like a charm. Just requires a line on your init.sqf.
So if everything is so peachy, why do I need help? Well, my server has been taking performance hits for a long while, and I'm pretty sure the way I'm adding these new locations must be very costly in that regard. I'd be very grateful if anyone who actually knows his way around scripting can tell me if there's a way of fixing this script (and others like it) so it doesn't make my players lag, or, at least, tell me to give up and go the regular way.
So, without further ado, here's the script.
Step by step:
1) Download the script.
2) Unpack your mission.pbo
3) Put the file you downloaded on your mission folder (created when unpacking the .pbo)
4) Open the init.sqf on your mission folder.
5) Add the following line on the very bottom:
Code:
[] ExecVM "OSC.sqf";
7) Repack your mission.
Recommendation
To check if you like the castle, and if it works for you, I recommend you try it on your editor first. Just create a new mission on the 3D editor and save it. Go to your mission folder (the one you just created) and create an init.sqf. Add the command specified on step 5 to your fresh init and save. Now paste the OSC.sqf on the same folder and restart it. The castle should be there.
Notes
The castle towers WILL spawn zombies.
I've marked both the Food Box and the Custom Weapon as Container and Weapon Holder respectively. Should be easy to delete or modify them.
The commands used on this script that might trigger off restrictions are: setPos, setVectorUp and setDir.
EDIT
In my server, I mark all the custom locations so players know where to go to check the new things out. Here's the code for the marker.
Code:
_M13 = createMarker ["OSC", [6959.9023, 1569.4238]];
_M13 setMarkerText "Old Spanish Castle";
_M13 setMarkerType "Camp";
_M13 setMarkerColor "ColorBlack";
_M13 setMarkerBrush "Solid";
_OSC_ = _M13;