OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Mr.Peanut on 11 Sep 2008, 20:09:11

Title: Swimmer Keeps Weapons v1.1 (DELETED)
Post by: Mr.Peanut on 11 Sep 2008, 20:09:11
UPDATED 15/09/2008

A simple little script, but good learning material for beginners.

Swimmer Keeps Weapons v1.1
by Mr.Peanut
15/09/2008

Description: A clan mate of mine was complaining about losing weapons whilst swimming in ArmA
so I wrote this little script. In ArmA you lose all weapons and ammo, except sidearms,
if you go for a long swim. This script will automatically restore all your weapons and ammo
as soon as you touch bottom again.  If the player swims out to a boat and loses his weapons enroute,
his weapons will be restored when either the boat lands and he exits the boat, or if he swims
back to shore.

Usage: Copy smb_skw folder into your mission folder. In your init.sqf add the following:
unit call compile preprocessFileLineNumbers "SMB_SKW\SMB_SKW_init.sqf";
or in the unit's init field:
this call compile preprocessFileLineNumbers "SMB_SKW\SMB_SKW_init.sqf";

Requires: Kronzky's String Function Library v2.2.0, which is included in the smb_skw folder.
Automatically initialises the string functions if required.

MP: Respawn and JIP compatible with one exception; a player (re)spawns into an AI that has already
lost its weapons and has not yet had them restored.

Revisions:
1.1 12/09/2008 - Changed from global variables to vehicle stored variables so that script
                        would work on AI.
     15/09/2008 - Updated documentation.




Title: Re: Swimmer Keeps Weapons v1.0
Post by: hoz on 11 Sep 2008, 20:15:42
Nice one, I hate when the AI looses thier guns.
Title: Re: Swimmer Keeps Weapons v1.0
Post by: fleepee on 11 Sep 2008, 21:18:48
I've tested it quickly, it's ok with players but not with AI (of my team)...
Title: Re: Swimmer Keeps Weapons v1.0
Post by: Mr.Peanut on 12 Sep 2008, 01:10:51
Never said it would work with AI... 
I hate AI so I actually never thought about it. It'll take a wee bit of reworking for AI, but I can do it. 

edit: updated to work with stinking AI