Results 1 to 7 of 7

Thread: An Autorun script is in the works.

  1. #1

    An Autorun script is in the works.

    I've made an autorun script; So a player need not hold key down or put paperclip to hold key down.
    It will make your unit run 100m if healthy - crawl a 100m if wounded.
    It is an addaction driven script.

    Script exits if:

    Unit completes 100m movement.
    Unit takes damage along the way.
    Player issues the stop/break addaction to halt movement.
    The player dies.

    Right now tested and works for: Single player mode and campaign.
    Working on MP compatability.

    Once done I will submit the file and demo.

    Complete with remarks in script to explain how to use; explanation of the concept and how to further extend distance, etc....
    Last edited by WW2Weasel; Mar 24 2012 at 00:14.

  2. #2
    OK update just tested with WH40K mod associate newnoob - and Good news it works in MP - had a few small issues to fix - nothing that can't be fixed.

    So both players were able to autorun or autocrawl.

    So in a few days time the script and demo will be available for all.

    Need a few days to try and work in some more time to do mp testing - at work so cannot do further testing.

  3. #3
    Chief Warrant Officer Beagle's Avatar
    Join Date
    Jun 30 2001
    Location
    Holy Roman Empire
    Posts
    3,683
    Funny, because I habe autoron since OFP without any script. Does your's have collision avoidance? Because collision and gettig hung when you get back is my biggest problem with autorun.

  4. #4
    Perhaps we have a misunderstanding?

    Collision avoidance? My Auto-run script is just for Infantry. The idea behind my script is to move a unit on foot/running 100 meters with one click of the mouse.

    Well my script plays animations - so it's all on foot - there is no hang - and no collision - problems with infantry. Are you referring to "auto-hover"?

    on a side note: I reworked the script - hammered out the small issues and just need to retest again later.
    Last edited by WW2Weasel; Mar 22 2012 at 22:56.

  5. #5
    Chief Warrant Officer Beagle's Avatar
    Join Date
    Jun 30 2001
    Location
    Holy Roman Empire
    Posts
    3,683
    No im referrign to autorun on INfanrty...you know...I activate it and it rusn endlessly until I return to pc...but most of the time it get's stuck on some map objects...
    I don't use a script in game just a key repearter programmed into keyboard.

  6. #6
    Ahhh - k - gotcha - have a simple keyboard and don't use keyboard repeating software- so I don't do that option. The animation will run you through an object <I think, can't remember> so you're not gonna get stuck. But I currently set the distance to run @ 100m. But in the script I give each editor the instructions on how to increase distance if they feel they need more running room.
    Last edited by WW2Weasel; Mar 23 2012 at 00:46.

  7. #7
    Still at work - haven't mp tested. But I will post up scripts - if peeps want to MP test for me - that would be good.

    ok the first script: "Arun_Acrawl.sqs"


    ;Script by WW2Weasel < 03-21-2012 > for WH40K Mod -
    ;No permission is needed to modify this script.
    ;Have fun gaming - and why not visit us at the Wh40k mod and say hi!: http://s1.zetaboards.com/OFPWH40K/index/
    ;This script written to address an ofp fan's complaint regarding tedious long range running of unit.
    ;I had'nt thought of doing this before until I read the fan's request. I thought this was an absolutely important feature to have in operation flashpoint and it garnered immediate acion from me.
    ;The Scope of this script is to play animations to auto run or crawl if injured 100 meters. This script is meant for players not the AI.
    ;I thought long and hard about giving it more functionality. I decided to leave as is; but allow others to modify to suit their own tastes.
    ;Result of this Script: The player's unit begins running then you can steer him around much like you would a vehicle in opflash.
    ;Place in players init line of unit: Autorun = this addAction ["Auto-run - "+format ["%1",name this], "Arun_Acrawl.sqs"]
    ;How to modify distance to be more than 100 meters? Simple....
    ;- for running - it takes 35 iterations of the playmove command to run 100 meters. So to run Approx. 500 Meters (35 * 5 = 175) || ?canstand _unit: _i=175,goto "autorun"
    ;- for crawling - it takes 138 iterations of the playmove command to crawl 100 meters. So to crawl Approx. 500 Meters (138 * 5 = 690) || ?!canstand _unit: _i=690,goto "autorun"
    ;Also very important to include: Arun_Acrawl_break.sqs in your mission folder as well - As this is the Addaction break mechanism used to stop the Auto running/crawling.
    ;Also if you take dammage - if not immediately killed the script will stop.
    ;I have not tested yet in MP. But it should still work. It's meant for local players - and broadcasts the players positions via publicVariable.
    ;One possible problem in busy games is the animation may become choppy and distance traveled could be less than 100m.
    ;*** A Caveat - you may need to test delay in time with your pc and model/animation - time delay definitely needs fine tuning per individual's situation.
    ;Time delay is important for 2 reasons: 1) It allows for smooth running of animation and 2) Allows the Autorun break addaction to stop immediately upon activation.
    ;To not have a time delay - renders autorun breaking useless.
    ;On my pc default west soldier is ~.5 delay.
    ;*** Default for Standard Imperial Guard unit is ~.6 a larger unit like Ogryn is ~.8. If time is not set properly - jitter or pause may result.
    ;You may need to change the animations if you are using custom animations - below are the ARMA Cold War Crisis defaults.
    ;Default Bis run animation: _unit playMove "CombatRunF";
    ;Default Bis crawl animation: _unit playMove "LyingFastCrawlF"
    ;Autorunbreak = _unit addAction ["Auto-stop - "+format ["%1",name _unit], "Arun_Acrawl_break.sqs"]
    ;This runs other script that has a returned value to switch on/off script manually if player chooses via the addaction.

    ?_lockplyr:exit
    ?!local player && !local (_this select 0): exit
    _lockplyr=true
    _pbreak=false
    _unit=_this select 0
    _blplyr = "bplyr" + format["%1",_unit]
    ?!alive _unit || _pbreak:_pbreak=false,_unit removeAction Autorunbreak,_lockplyr=false,exit
    Autorunbreak = _unit addAction ["Auto-stop - "+format ["%1",name _unit], "Arun_Acrawl_break.sqs"]
    _health=getdammage _unit
    ?canstand _unit: _i=35,_arc="CombatRunF",goto "autorun"
    ?!canstand _unit: _i=138,_arc="LyingFastCrawlF",goto "autorun"

    #autorun
    ?bplyr==_blplyr:_pbreak=true
    ?!alive _unit || _pbreak:_pbreak=false,bplyr="",publicVariable "bplyr",_unit removeAction Autorunbreak,_lockplyr=false,exit
    _i=_i-1
    ?getdammage _unit > _health:exit
    _unit playMove _arc?_i==0:_unit removeAction Autorunbreak,_lockplyr=false,exit
    posplyr=getpos _unit
    PublicVariable "posplyr"
    ~.55
    goto "autorun"

    exit

    ---------- Post added at 00:50 ---------- Previous post was at 00:48 ----------

    ok the second script: "Arun_Acrawl_break.sqs"



    ;Script by WW2Weasel for WH40K Mod
    ;This script written to address ofp fan's complaint regarding tedious long range running of unit.
    ;This portion of the Autorun scripts is to handle controlled exit from script by player.
    ;Autorunbreak = _unit addAction ["Auto-stop - "+format ["%1",name _unit], "Arun_Acrawl_break.sqs"] - run from inside Arun_Acrawl.sqs

    ?!local player && !local (_this select 0): exit
    _unit =_this select 0
    bply = "bplyr" + format["%1",_unit]
    bplyr = bply
    publicvariable "bplyr"
    _unit removeAction Autorunbreak
    exit
    Last edited by WW2Weasel; Mar 24 2012 at 07:25.

Similar Threads

  1. Script works for me but not other players?
    By crushenator in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 7
    Last Post: Dec 31 2010, 13:41
  2. Script works on localserver but internet.
    By NeV3rKilL in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Sep 10 2009, 01:16
  3. How works an Deploy script???
    By edo in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 2
    Last Post: Feb 22 2008, 18:40
  4. How come this script only works for some units?
    By Tophe in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 0
    Last Post: Mar 9 2007, 18:55
  5. An air drop script that works!
    By Aculaud in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 6
    Last Post: Jun 26 2002, 23:49

Posting Permissions

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