ARIGATO JUMPER SCRIPT (v1.2)
http://s015.radikal.ru/i330/1207/44/1945c31b784d.jpg (107 kB)
Bring to your attention the script jumps (something that lacked both players Arma
). Besides the standard jumping over low fences (default key is [V]) the script adds a full jump, with which you can fly over more serious obstacles. To jump using the traditional key [SPACE].
jumper.sqf
PHP Code:
/*
* ARIGATO JUMPER SCRIPT (v1.2)
* (c) Arigato Software, 2012
*/
player setvariable ["ARGT_JUMP_POWER", 5.5, true];
player setvariable ["ARGT_JUMP_READY", true, true];
ARGT_JUMP =
{
private ["_moves", "_state", "_velocity", "_power", "_speed"];
if ( ! (player getvariable "ARGT_JUMP_READY") || vehicle player != player ) exitwith {true};
_moves = configfile >> gettext ( configfile >> "CfgVehicles" >> typeof player >> "moves" );
_state = getnumber (_moves >> "Actions" >> gettext ( _moves >> "States" >> animationstate player >> "actions" ) >> "upDegree");
if ( _state in [1,2,3,4,5,6,7,11,13,14] ) exitwith {true};
_power = (1 - (damage player)) * (player getvariable "ARGT_JUMP_POWER");
_speed = _power / 2;
_velocity = velocity player;
player switchmove "ActsPercMrunSlowWrflDf_FlipFlopPara";
player setvariable ["ARGT_JUMP_READY", false, true];
player setvelocity [(_velocity select 0) + _speed * sin getdir player,
(_velocity select 1) + _speed * cos getdir player,
(_velocity select 2) + _power];
true
};
player addeventhandler ["AnimDone",
{
private ["_unit"];
_unit = _this select 0;
if ( ! (_unit getvariable "ARGT_JUMP_READY") ) then {_unit setvariable ["ARGT_JUMP_READY", true, true]};
}];
ARGT_KEYDOWN =
{
private ["_dikcode"];
_dikcode = _this select 1;
switch ( true ) do
{
case ( _dikcode == 0x39 ) : {call ARGT_JUMP}; // DIK_SPACE
default {false};
};
};
while { true } do
{
waituntil { ! isnull finddisplay 46 };
finddisplay 46 displayaddeventhandler ["KeyDown", "_this call ARGT_KEYDOWN"];
waituntil { isnull finddisplay 46 };
};
He runs init.sqf mission, additional configuration is not required. To make it easier to understand attached the demo mission.
Notes:
1. Bots do not jump, just a player.
2. Not tested in multiplayer missions.
3. If you jump from a hill, and you can break.
4. The action assigned to the key [SPACE] will be lost.
5. The lower the player's health, the less power the jump.
Discussion: http://www.flashpoint.ru/threads/%D0...8%D0%B9.49776/
Download the demo mission:
1. http://www.armaholic.com/page.php?id=17140
2. http://narod.ru/disk/54944927001.5a0....utes.zip.html
3. http://webfile.ru/6021715
(c) Arigato Software, 2012