Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Choose random anim from list not working

  1. #11
    Just looked at this thread and saw a animation loop method.
    Tried the waitUntil that was there, and it works pretty well!
    Code:
    private["_man"];
    
    _man = _this select 0;
    
    While { alive _man } do {// && !(animationState _man == _Anim)
    	_Anim = [
    	"AidlPercMstpSlowWrflDnon_i02",
    	"AidlPercMstpSlowWrflDnon_i04",
    	"AidlPercMstpSlowWrflDnon_i05",
    	"AidlPercMstpSlowWrflDnon_i06",
    	"AidlPercMstpSlowWrflDnon_i07",
    	"AidlPercMstpSlowWrflDnon_i08",
    	"AidlPercMstpSlowWrflDnon_i09",
    	"AidlPercMstpSlowWrflDnon_i10",
    	"AidlPercMstpSlowWrflDnon_i11",
    	"AidlPercMstpSlowWrflDnon_i12",
    	"AidlPercMstpSlowWrflDnon_i13",
    	"AidlPercMstpSrasWrflDnon01",
    	"AidlPercMstpSrasWrflDnon02",
    	"AidlPercMstpSrasWrflDnon03",
    	"AidlPercMstpSrasWrflDnon04",
    	"AidlPercMstpSrasWrflDnon05",
    	"AidlPercMstpSrasWrflDnon06",
    	"AidlPercMstpSrasWrflDnon_i01",
    	"AidlPercMstpSrasWrflDnon_i02",
    	"AidlPercMstpSrasWrflDnon_i03",
    	"AidlPercMstpSrasWrflDnon_i04",
    	"AidlPercMstpSrasWrflDnon_i05",
    	"AidlPercMstpSrasWrflDnon_i06",
    	"AidlPercMstpSrasWrflDnon_i07",
    	"AidlPercMstpSrasWrflDnon_i08",
    	"AidlPercMstpSrasWrflDnon_i09",
    	"AidlPercMstpSrasWrflDnon_i10",
    	"AidlPercMstpSrasWrflDnon_i11",
    	"AidlPercMstpSrasWrflDnon_i12",
    	"AidlPercMstpSrasWrflDnon_i13"
    	] call BIS_fnc_selectRandom;
    	if !(animationState _man == _Anim) then { hint "!= _Anim"; _man switchMove _Anim /**_man switchMove "AidlPercMstpSrasWrflDnon_i13"*/};
    	if (animationState _man == _Anim) then { hint format["Playing animation %1", _Anim]; waitUntil {!(animationState _man == _Anim)}; };
    	//hint format["Playing animation %1", _Anim];
    	sleep 0.2;
    };
    I'm almost done.. Is there a way to find the behavior of a unit? I tried using " "CARELESS" = Behaviour _man ", but it wasn't working. Sorry for all the questions, still trying to grip on this

    Edit: Just saw your post muzzle, gonna try it now!
    Last edited by ayser; Aug 11 2012 at 16:02.

  2. #12
    Just tested. Works fine, just be sure the unit is SAFE or CARELESS.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Choose a random Trigger
    By Kilbur in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Jun 21 2012, 08:43
  2. Working Animations + Anim loop script
    By KBourne in forum IRON FRONT: LIBERATION 1944 - MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Jun 10 2012, 20:27
  3. choose random script
    By quincy in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Mar 12 2011, 15:31
  4. Choose weapon from list
    By blackt12 in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Apr 6 2007, 15:57
  5. Custom music in an island anim not working.
    By theavonlady in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 25
    Last Post: May 24 2003, 21:03

Posting Permissions

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