Jump to content
Sign in to follow this  
Kladho

How to drag a unit from the mission

Recommended Posts

How to drag a unit from the beginning of the mission?

Like this:

753100_f520.jpg

And if you now that how to carry a unit from the begin of the mission?

:404:

Share this post


Link to post
Share on other sites

it must be posible bye scripting

Share this post


Link to post
Share on other sites

How can I script this for a scene:

At the end of a campaign mission I'm making my team get wounded and must be dragged away by the AI Takis in the closing scene.

I understand I'm supposed to use animations but I have no clue how to do it. Simply make AI unit A drag a wounded AI/player unit B. I have 5 team members so preferably 4 units getting dragged will be AI and the fifth, team leader, will be the player. I want the AI Takis to be dragging them away as the scene(outro) fades away.

Any suggestions? I've tried the search but people use retarded thread names that make it impossible to find anything anymore.

Share this post


Link to post
Share on other sites
How can I script this for a scene:

At the end of a campaign mission I'm making my team get wounded and must be dragged away by the AI Takis in the closing scene.

I understand I'm supposed to use animations but I have no clue how to do it. Simply make AI unit A drag a wounded AI/player unit B. I have 5 team members so preferably 4 units getting dragged will be AI and the fifth, team leader, will be the player. I want the AI Takis to be dragging them away as the scene(outro) fades away.

Any suggestions? I've tried the search but people use retarded thread names that make it impossible to find anything anymore.

If you use the animation viewer:

http://www.armaholic.com/page.php?id=10941

you can identify the dragger and dragee animations. You will probably need to attachTo the two units and play the animations. That is my best guess!

Hope it helps!

RR

Share this post


Link to post
Share on other sites
If you use the animation viewer:

http://www.armaholic.com/page.php?id=10941

you can identify the dragger and dragee animations. You will probably need to attachTo the two units and play the animations. That is my best guess!

Hope it helps!

RR

Yeah I know about all that but I wouldn't know where to start. I was hoping someone had done it before and could provide an example. I've been trying for weeks to get it done to no avail.

Thanks for the help though. It's always appreciated.

Share this post


Link to post
Share on other sites

Way too complicated for my knowledge. I tried looking there. I just need to know what the attachto command that is used looks like and how to set up the animations. It's just a simple scripted scene.

Really guys, I know where to look. I just don't know what to look at and how to implement it. If you can't help directly there's really no need to tell me to look places, unless there's a scene in a mission someone can point me to. I've pretty much tried everything.

Thanks for the help though. I do appreciate it.

How about this, does anyone know who took that screen shot posted above? If it's a BIS made picture, any idea who did it? I'll PM that person. Hell I'll ask the author of any mission where someone has seen a screen shot or scene with an AI unit dragging/carrying another unit. I can probable remake it from such a mission but I can't find or remember one that has such a scene.

Edited by Manzilla

Share this post


Link to post
Share on other sites

That's was a promo in-game screenshot from BIS from before ArmA2 came out.

Share this post


Link to post
Share on other sites

Norrins revive does have a carry.sqf and drag.sqf in the revive sqf folder. I saw attachto in there and animations. I'm at work so I can't offer more at the moment, and I haven't tried it, but looks very promising.

Share this post


Link to post
Share on other sites

Yup, I've been looking at it but can't figure it out exactly. Thanks for the reply.

Share this post


Link to post
Share on other sites

This is what I got so far:

_dragger switchMove "AcinPknlMwlkSnonWnonDb";
_injured switchMove "AinjPpneMstpSnonWrflDb";
_injured attachTo [_dragger, [0, 1.2, 0]];
_injured setDir 180;

It's not perfect, the units sometimes won't move. But it might be a start.

Share this post


Link to post
Share on other sites

Thanks Clayman!

I got the attachto working and the anim + movement for the dragger but the injured anim does not work.

I have this in the units init line:

this switchMove "AinjPpneMstpSnonWrflDb"; this playMove "AinjPpneMstpSnonWrflDb"; this attachto [H1,[0.1, 1.01, 0]]; this disableAI "ANIM";

It's a BLUFOR unit that's getting dragger by a Takis civie but the BLUFOR units just stands there while being dragged.

Any suggestions? I'd prefer to figure out how to do it via the init line of the two units for now.

EDIT:

Hmmmm... it seems to work if I add a wp for the unit and place that in the wp's init.

I guess the script version is the way to go. ;)

Edited by Manzilla

Share this post


Link to post
Share on other sites

Most animations don't work in the init line. Either use a waypoint, trigger or script. ;)

Share this post


Link to post
Share on other sites

Thank you sir! I may have some more questions soon. I appreciate the help. :yay:

Share this post


Link to post
Share on other sites

I realize I might be getting to this thread late..

I got this managed last year:

I still have the mission file but its on another disk. I'll see if I can pull it and post the script tomorrow. However I should mention that's specifically for dragging/carrying and AI by the player, by setting him unconscious and making it not possible to heal him.

Share this post


Link to post
Share on other sites

K its massive for a post probably but here it is, where 'sarPilot' is the unit name of the AI who gets put unconscious and the player carries out.

sarPilot setCaptive true; sarPilot disableAI "ANIM";
sarPilot setHit ["body",0.7]; sarPilot setHit ["legs",0.9];
sarPilot setHit ["arms",0.6]; sarPilot setHit ["head_hit",0.3];
sarPilot setVariable ["BIS_noCoreConversations", true, true];

injuredAnim = sarPilot spawn {
  _this switchMove "AinjPpneMstpSnonWnonDnon";
 // waitUntil{!medicTreatingCaptive};
  _this setVariable ["BIS_IS_inAgony",true];
  _this setVariable ["BIS_IS_agonyDam",0,true];
  waitUntil{
     if(_this getVariable "BIS_IS_inAgony")then{_this setVariable ["BIS_IS_inAgony",true]};
     !(alive _this)
  };
  _this setVariable ["BIS_IS_inAgony",false,true];
};
captiveShowSignsOfLife = sarPilot spawn {
  _gestures = ["GestureSpasm0Weak","GestureSpasm1Weak","GestureSpasm2Weak","GestureSpasm3Weak","GestureSpasm4Weak","GestureSpasm6Weak"];
  _timer = 0;
  waitUntil{
     if(animationState _this != "AinjPpneMstpSnonWnonDnon")then{
        _this playActionNow "GestureNod";
        waitUntil{!(alive _this) || (animationState _this == "AinjPpneMstpSnonWnonDnon") || (animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")};
        if(animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")then{
           _this playMoveNow "AinjPpneMstpSnonWnonDnon";
           waitUntil{animationState _this == "AinjPpneMstpSnonWnonDnon"}
        };
        _timer = 0
     };
     if(_timer <= 0 && alive _this)then{
        _gesture = _gestures select (floor random 6);
        _this playAction _gesture;
        _timer = 120
     }; 
     sleep 0.5; 
     _timer = _timer - 0.5; 
     !(alive _this)
  };
  _this playActionNow "GestureNod";
  _this setHit ["head_hit",1];
};

This just make him unconscious, stops him from talking, makes the player unable to heal him, and allows you to drag/carry.

Share this post


Link to post
Share on other sites
K its massive for a post probably but here it is, where 'sarPilot' is the unit name of the AI who gets put unconscious and the player carries out,

This just make him unconscious, stops him from talking, makes the player unable to heal him, and allows you to drag/carry.

hey i am working on a arrest script....

i can get to the point were my detained person is on the floor face down but i now want to drage them (maybe have them standing hands behind back attached to a player who has hands holding them or something like they are holding their cuffs.

then i need them to be able to load them in to the cargo of a vehicel and pull them out.

and a function to put them down....any help?

Share this post


Link to post
Share on other sites
K its massive for a post probably but here it is, where 'sarPilot' is the unit name of the AI who gets put unconscious and the player carries out.

sarPilot setCaptive true; sarPilot disableAI "ANIM";
sarPilot setHit ["body",0.7]; sarPilot setHit ["legs",0.9];
sarPilot setHit ["arms",0.6]; sarPilot setHit ["head_hit",0.3];
sarPilot setVariable ["BIS_noCoreConversations", true, true];

injuredAnim = sarPilot spawn {
  _this switchMove "AinjPpneMstpSnonWnonDnon";
 // waitUntil{!medicTreatingCaptive};
  _this setVariable ["BIS_IS_inAgony",true];
  _this setVariable ["BIS_IS_agonyDam",0,true];
  waitUntil{
     if(_this getVariable "BIS_IS_inAgony")then{_this setVariable ["BIS_IS_inAgony",true]};
     !(alive _this)
  };
  _this setVariable ["BIS_IS_inAgony",false,true];
};
captiveShowSignsOfLife = sarPilot spawn {
  _gestures = ["GestureSpasm0Weak","GestureSpasm1Weak","GestureSpasm2Weak","GestureSpasm3Weak","GestureSpasm4Weak","GestureSpasm6Weak"];
  _timer = 0;
  waitUntil{
     if(animationState _this != "AinjPpneMstpSnonWnonDnon")then{
        _this playActionNow "GestureNod";
        waitUntil{!(alive _this) || (animationState _this == "AinjPpneMstpSnonWnonDnon") || (animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")};
        if(animationState _this == "AinjPfalMstpSnonWnonDnon_carried_down")then{
           _this playMoveNow "AinjPpneMstpSnonWnonDnon";
           waitUntil{animationState _this == "AinjPpneMstpSnonWnonDnon"}
        };
        _timer = 0
     };
     if(_timer <= 0 && alive _this)then{
        _gesture = _gestures select (floor random 6);
        _this playAction _gesture;
        _timer = 120
     }; 
     sleep 0.5; 
     _timer = _timer - 0.5; 
     !(alive _this)
  };
  _this playActionNow "GestureNod";
  _this setHit ["head_hit",1];
};

This just make him unconscious, stops him from talking, makes the player unable to heal him, and allows you to drag/carry.

hey im trying to get a guy to drag a conciouse unit..."he has been arrested and in the sqf before this is lying down faceing th floor with hands behind back and an action to drag...can u spot a mistake?

_suspect = _this select 0;
_unit  = player;

_suspect setCaptive true;
_suspect disableAI "ANIM";

_suspect setVariable ["BIS_noCoreConversations", true, true];

_suspect switchMove "CivilSitting";

_unit playaction "AcinPknlMstpSrasWrflDnon"

_suspect attachto [_unit,[1, 1, 0]]

_suspect setDir 180;

_action = _suspect addAction["foo", "foo.sqf"];
while {_action >= 0} do	{
_suspect removeAction _action;
_action = _action - 1;
};

_unit addAction ["Drop body", "arrest_sqf\drop.sqf"];

if (true) exitWith {};

Share this post


Link to post
Share on other sites

I think the way forward would be to firstly link the wounded soldier & the soldier dragging him to the First Aid modules then use a (possibly) yet to be discovered action command for the AI to drag or carry him (if there is such a command).

The magic number to have a First Aid Linked Person rolling round on the floor is "this setdammage 0.89", as discovered by someone on the forums (sorry can't remember who).

Regards

James

Share this post


Link to post
Share on other sites
Then I suppose you could use setDamage on the player you want to drag.

http://community.bistudio.com/wiki/setDamage

?

supose but im useing the accachto command so i dont see why they would need to be damaged? im not makeing then unconciouse at all :/....

unless an unconciouse player becomes an object lmao.

this really sucks

---------- Post added at 11:14 AM ---------- Previous post was at 11:12 AM ----------

I think the way forward would be to firstly link the wounded soldier & the soldier dragging him to the First Aid modules then use a (possibly) yet to be discovered action command for the AI to drag or carry him (if there is such a command).

The magic number to have a First Aid Linked Person rolling round on the floor is "this setdammage 0.89", as discovered by someone on the forums (sorry can't remember who).

Regards

James

is that for me?

im not trying to carry an hurt ai im trying to drag one on full life but i havee arrested them.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×