Thursday, November 10, 2016

Arma 3 Scripting, More A3Wasteland Addons/Enhancements

Over the last year I have learned a lot about Arma 3 coding/scripting and am now able to write code/scripts from scratch... based off my own ideas. Something I never really thought I'd be able to do, but I have learned much more than I originally anticipated... which is a good thing.

In recent weeks, I have written a few new and different scripts for use within A3Wasteland mission... which is the game-mode/mission I tend to favor when it comes to playing Arma 3.

Since my last blog post about my random crate and soldier load out's, I have coded/scripted/released to github...

Notepad++ .sqf coding/scripting
purchaseFuel script, which disables free fuel at all fuel pump across any given map and attaches a cost for vehicles (land or air, including uav). You must have the carried money in order to refuel, and whether a total refuel or partial, you are charged for it. Jerry cans are still able to be filled for free though.

playerJump script, which is a script I wrote and tested quite a while ago, but only recently released. I wanted to see if it was possible to write a jump routine where as the screen did not visually glitch... and I succeeded. It took me a while to correct the jumping routine to as best I could manage within the script and animation bounds of Arma 3. Needless to say, compared to all the other jump scripts available (and the glitchy one in the default A3Wasteland mission), it is a LOT better.

globalChatMessages script, will rotate and display chat messages to each player. The messages are written within the script itself. This is able to be changed to whatever the server owner/admin would like to have displayed to all clients. The script is based purely client side.

titleTextMessages script, will rotate and display title text messages to all connected clients. The messages are written within a server-side script which is able to be changed on-the-fly. Upon server restarts, the script re-reads the server-side file for the current messages to display. This script is preferred over the globalChatMessages due to not needing to repack the mission.pbo each time the messages are changed.

cleanStores script, will locate all the available stores on the map of A3Wasteland, and attach a cleaning loop. This script will clean ALL objects listed in the configuration after a per-item duration (default 2 minutes) in order to keep the floors and immediate surrounding clean of discarded player items/weapons. The radius limit to where the cleaning extends to is also configurable.

buryDeadBody script, is a script to bury dead bodies at a cost (default $5000). I have seen other similar script(s), but thought I would write my own which functioned the way I would like (and hopefully others would like). To bury a dead body (eg, an enemy you just killed), you will need to have $5000 carried money to begin the process. A random timer between 30 and 60 seconds will commence in which is how long it will take to bury said body. Upon a successful bury, the body and all immediate surrounding objects/weapons will be removed/despawned. This script is useful for looting and disposing of the left-overs so that the enemy can not retrieve any of their gear.

afkTimer script, is a script to check for players that have gone AFK. I have noticed that some A3Wasteland servers have turned of food and drink, and some players take advantage of that and spawn in as BLUFOR or OPFOR, then hide and go AFK in order to farm money. This script puts an end to that, as if a player is AFK for longer than a duration (default 10 minutes), it will kick them back to the lobby.

cleanUpMissionObjects script, is a script that is to be used within A3Wasteland missions. This script will time and then remove all unlocked mission items after a time period once a mission is successfully completed. The script checks for players within the vicinity of said mission. If players exist within the mission area, the script will not delete/remove any object until there are no players around. The script also checks for locked objects and will not delete those that are locked.

fixTownStreetLamps script, is a script for turning lamps back to the on state. Many times I have noticed servers with a long night-time duration, and that players tend to shoot out town lamps in order to get complete darkness. This script will time loop and for all lamps that have been shot out, it will restore them to the on state in order to brighten the area back up. The lamps when turning back on have a somewhat realistic flicker effect (for player immersion).

outOfBounds script, is a script for checking that any player is within the bounds of the playable area for the map/mission. If a player is outside of the playable area which is marked visually on map by a blue circle/ellipse or is above a certain altitude, then an audible and visual warning with a count-down timer will appear on the players screen. If the count-down timer reaches 0 seconds aka player is still out-of-bounds, the player and any vehicle the player is in will be killed/destroyed. *NOTE, this was coded/scripted due to reading on a forum post that a player decided to go so far out-of-bounds, that Arma 3 crashed, but the A3Wasteland mission saved the players location, so upon returning to said server, the player would respawn on their last (out-of-bounds) location and Arma 3 would instantly crash again... *facepalm*

spawnBeaconDetector script, is for tracking down player spawn beacons. I was not happy with what was currently available for A3Wasteland, so I decided to write my own version from scratch. A player must have a mine-detector carried on them as well as being on foot in order to track spawn beacons. The sound effects emitted are in the 3D environment (not silent for all but the operator), which can reveal the players location should enemy be within the 100 meter range. Want to track beacons? There is a risk of giving away your position now... so track them down quick! The audible beeps for all to hear make a lot more sense to me rather than just an operator beep that no one else can hear... it is a detector after all, right?

All-in-all, I enjoy a challenge, and enjoy coding/scripting to enhance a game mode/mission that I enjoy to play, as well as giving the opportunity to other A3Wasteland administrators to use my scripts in their own mission(s).

I still intend on creating new content when the need arise and posting (some of) it on my github account.

Want something custom coded/scripted? Hit me up for a discussion on any of my social media links. You can also find me on discord at... soulkobk#3450, as that is currently my preferred method of contact.

Until next time!

-soul.