Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Script jumps (overcoming obstacles)

  1. #1

    Script jumps (overcoming obstacles)

    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.5true];
    player setvariable ["ARGT_JUMP_READY"truetrue];

    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 = (- (damage player)) * (player getvariable "ARGT_JUMP_POWER");
      
    _speed _power 2;
      
    _velocity velocity player;
      
    player switchmove "ActsPercMrunSlowWrflDf_FlipFlopPara";
      
    player setvariable ["ARGT_JUMP_READY"falsetrue];
      
    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"truetrue]};
    }];

    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
    Last edited by Arigato; Jul 5 2012 at 06:12.

  2. #2
    Wow, super soldier comes!

  3. #3
    Private First Class Arigato's Avatar
    Join Date
    Mar 10 2010
    Location
    Russia
    Posts
    31
    Author of the Thread
    The request to the moderators section:
    Please move the topic in this section: http://forums.bistudio.com/forumdisp...-amp-Scripting
    Last edited by Foxhound; Jul 4 2012 at 07:21. Reason: thread moved

  4. #4

  5. #5
    ha i like that, would be cool to have something like this more realistic (short crouch slide to front or evasive role to left and right (only without heavy equipment).
    this version here should fit well with the halo units
    http://www.wissensmanufaktur.net/
    my system:
    Spoiler:

  6. #6
    If I read the lined properly, He defined the strength of the jump which you can modify too..
    Code:
    player***setvariable***["ARGT_JUMP_POWER",***5.5,***true];
    Good release anyways

  7. #7
    Private First Class Arigato's Avatar
    Join Date
    Mar 10 2010
    Location
    Russia
    Posts
    31
    Author of the Thread
    Yes, that's right, the strength of the jump is governed.

  8. #8
    I suppose _dikcode == 0x39 to define the key. Is there any list that shows which code represents which key? I use space for free look.

    Btw, in IronFront'44 you can jump right out of running over fences. Would be great to have this feature in Arma as well.

  9. #9
    Private First Class Arigato's Avatar
    Join Date
    Mar 10 2010
    Location
    Russia
    Posts
    31
    Author of the Thread

  10. #10
    Thanks, Arigato (lol )

    Unfortunately, the rolling animation can not be seen by other players in multiplayer, since switchmove is local.

    When you just execute
    Code:
    player switchmove "ActsPercMrunSlowWrflDf_FlipFlopPara";
    other players see him sliding a bit forward without even moving the legs at all. A command "switchMoveGlobal" would be really great...


    Other suggestions:

    A jump/roll forward while you are moving backwards, looks strange:

    Code:
    if ( ! (player getvariable "ARGT_JUMP_READY") || vehicle player != player ) exitwith {true};
    if ((speed player) < 0) exitwith {true};
    [...]
    You may also restrict the minimal required speed to < 15, so you only start to jump/roll when you have a certain speed.

    Currently there is another problem:
    When you hold a pistol in your hands, the character switches magically to his rifle when he starts to jump.

    You can even create fun-deathmatch-maps with very high jumps. You just need to set unit allowdamage false while he is jumping (or at least about to land) to prevent the falling damage.

Page 1 of 2 12 LastLast

Similar Threads

  1. A functional Swap Player method - Overcoming the limitations of selectPlayer
    By MadRussian in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Oct 14 2011, 19:54
  2. AI Halo jumps
    By destroystheovik in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Jan 3 2010, 14:38
  3. wav2lip obstacles
    By Balschoiw in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 1
    Last Post: Jul 2 2007, 10:51
  4. Random obstacles
    By marcusjm in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 5
    Last Post: May 26 2005, 18:33
  5. Breechable obstacles
    By Minotaur in forum ADDONS & MODS: COMPLETE
    Replies: 5
    Last Post: Apr 13 2002, 22:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •