Snakes are funny in Arma 3. In the early days of Arma 3 Alpha, snakes had human names and could open doors in buildings. With a little scripting effort you can still open a snake and put items in it like you do with inventory, or even wear it as a backpack. You can select snake to be your body just like you can do with a soldier or a rabbit, but I warn you, you might get motion sickness from all the weaseling around.

So I got curious, could I make snakes follow me like bloodthirsty suckers? While snakes are spawned as agents by the ambient life engine, if you also spawn them as agents you cannot order them to do anything, at least I couldn’t. However if you spawn them as units, you can indeed tell them to move towards you with doMove command. They won’t turn immediately but they will eventually crawl towards you.

There is however a problem with default snake positioning. It does not follow terrain on the slopes. This looks weird when you see one, as it usually has one side suspended in the air. This reminds me of cows on the hills in Arma 2. They would have rear hooves high above the ground with their heads buried in the ground. The solution is simple, make snake’s vectorUp adjust to surfaceNormal at snake’s position. It clearly works as you can see from the video. What I don’t understand is why it is not already done on the engine level.

I spawned 50 snakes around player for a quick test and ordered them to follow me on each frame while adjusting their vectorUp on each frame too. If all snakes are killed or deleted, the loop will exit. I also used getPosASL as I have discovered recently this is the fastest command to get position even if you combine it with ASLtoATL. My guess is because all other commands are fundamentally based on ASL position.

Here is the script I used in the video for you to try for yourself. It included FPS ticker in the script because I wanted to know how badly 50 snakes could affect performance. The video shows 30 FPS because FRAPS is capping it to 30. It is actually higher than that.

private ["_civ","_snakes"]; _civ = createGroup civilian; _snakes = []; for "_i" from 1 to 50 do { _snakes set [count _snakes, _civ createUnit [ "Snake_random_F", position player, [], 20, "NONE" ]]; }; _snakes spawn { waitUntil { { _x setVectorUp surfaceNormal getPosASL _x; _x doMove ASLtoATL getPosASL player; hintSilent str round diag_fps; alive _x } count _this == 0 }; };

Oh, and I’m sorry if I upset any of you, I realise there are people out there that have snake phobias :(.

Enjoy,
KK

EDIT: His lordship, the head snake charmer Pettka, has recently singlehandedly fixed bug where it was impossible to set different skins for snakes.

snakes

You can now set different textures for snakes with the following commands:

_snake setObjectTextureGlobal [ 0, "\A3\Animals_F\Snakes\data\Snake_Dice_CO.paa" ]; _snake setObjectTextureGlobal [ 0, "\A3\Animals_F\Snakes\data\Snake_Leopard_CO.paa" ];

This also means that snakes are now randomised when spawned on server.