Wargames:Help Site:Customize WGL:wglinitds script
wglinitds script
With WGL 5.1 out the door, a bug in it serves as a good reason to show you an example of how one can use the custom script wglinitds.sqs on a dedicated server.
The Purpose
The script wglinitds.sqs is executed around 1-2 seconds into a MP game and only on a dedicated server. The idea with is to let server admins execute server-side script when a MP mission starts.
HowTo
- Create a folder scripts in the OFP server folder.
- Create a script named wglinitds.sqs in that folder.
- Edit it to suit your needs.
Example Script
WGL 5.1.0 has a small omission where a function that should have been loaded isn't. This function is used by the helicopter and airplane fuel leak simulation system to clean up a certain array when a helicopter or plane is destroyed.
One could call this WGL 5.1 quirk a memory leak. Now, let's use wglinitds.sqs to patch that bug. Unfortunately, due to limitations in OFP, we can't make this a 100% "will always do it" solution. For this fix to work, a MP mission must have one of the following:
- A game logic named server.
- A game logic named LocalServerObject (this is a common CTI mission object).
- The Chain of Command Network Services (CoC NS).
On your dedicated server, create the text file scripts/wglinitds.sqs and put this into it: