Lingor Island - Old Spanish Castle

Deathcall

Well-Known Member
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:
Code:
[] ExecVM "OSC.sqf";
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.

Code:
_M13 = createMarker ["OSC", [6959.9023, 1569.4238]];
_M13 setMarkerText "Old Spanish Castle";
_M13 setMarkerType "Camp";
_M13 setMarkerColor "ColorBlack";
_M13 setMarkerBrush "Solid";
_OSC_ = _M13;
 
Hi Deathcal nice work have loaded it up and works fine, im on dayz.st servers and haven't noticed any lag on the server i also run most of my map edits the same way as you its a lot less complicated cheers Thebes.
 
I'm glad you like it Thebes, still hoping someone with better knowledge of scripting can tell me if this kind of work can affect server performance.
 
Cant see why this would degrade performance in any way, are you running your server on Windows 7/8 or on Windows Server OS? An engineer where i work has told me that your performance will start to GREATLY decrease after 15 people log into your machine if you are using a consumer version of Windows.
 
I can't be sure. Whatever the guys at DayZ.st use.

You should be good, since they are hosting many servers they are probably running Windows Server OS. Lag can be caused by conflicting scripts that cant decide wich to use. This is just from experience when having to fix mine from acting funny. If you are not always having lag, I wouldnt worry about it. Its probably just certain players with a high ping and lag spikes.
 
My performance improved a bit after redoing some scripts and making sure some are only run by the server, still, when the server gets above 30 players, there's lots of server-side lag (time picking up items or performing actions) and the little AI I have (one chopper flying around and a fishing boat towing a frigate) stutter as they move. Other time critical scripts like forcing the chopper crew to eject before they hit the ground sometimes work sometimes don't... maybe I should ask SARGE about that, he probably knows what I'm doing wrong.
 
Hey there, I have a quick question... I have been using editor and I am able to raise a building up or down, I can rotate, but I cannot tilt. I noticed you made that castle (looks awesome btw) how did you get them castle peices to not slant with the hill? I cannot for the life of me find out how to tilt.

Any help would be appreciated :)
 
Back
Top