h34dup 148 Posted October 2, 2012 I have run into a couple of walls with a mission I'm working on for Lions of Kandahar... My searches have not yielded anything about controlling drag/pickup wounded, only conversation about how to make the modules work. It has to do with the sort of functionality from the First Aid: Simulation and First Aid: Battlefield Clearance modules that would allow the player to drag/pickup an AI. I want to have: 1) A controlled IED explosion which ejects the passengers of a Humvee out onto the ground (this is in-place), 2) I am trying to keep them alive using allowDamage (this is inconsistent, in most cases one of the two AI dies), and setting damage to like 0.7 using setDamage and not setHit (lost the link with the body part translations) 3) The player will run to the first AI and do an action to put out the fire on one AI's body (I know how to make something like this work), 4) The player will have to defend the area for a few minutes 5) This is where I really need some help, then I want him to pickup or drag the two AI's to a nearby casualty collection point, when both of them are within the trigger area, the mission will continue to the next phase. So, I am looking to recreate basically the functionality from the Training portion of Arma2, where the two AI units are injured but not dead, and can be dragged or carried. Can/should this be done using the above-mentioned modules, or is there a function I can use, or some kind of action/playmove combo that would attach the AI to the player? Thanks in advance for any links, explanations, etc. Share this post Link to post Share on other sites
kylania 568 Posted October 2, 2012 Here's how BIS did it, maybe pull out some parts of this? //-------------------------------------------------------------------------------------------------- // DEFAULTS (FOR ULTRAEDIT HINTING) //-------------------------------------------------------------------------------------------------- BIS_AdvHints_Header = ""; BIS_AdvHints_Text = ""; BIS_AdvHints_Footer = ""; BIS_AdvHints_Duration = -1; BIS_AdvHints_ShowCond = "true"; BIS_AdvHints_ShowCode = ""; BIS_AdvHints_HideCond = ""; BIS_AdvHints_HideCode = ""; BIS_AdvHints_Silent = false; BIS_AdvHints_Seamless = false; BIS_AdvHints_KeyPress = ""; BIS_AdvHints_CanSkip = true; BIS_AdvHints_NoFooter = false; call BIS_AdvHints_setDefaults; //-------------------------------------------------------------------------------------------------- // INTRO //-------------------------------------------------------------------------------------------------- //display welcome hint [bIS_MissionName,BIS_Objectives] call BIS_AdvHints_createWelcome; //-------------------------------------------------------------------------------------------------- // APPLYING FIRST AID //-------------------------------------------------------------------------------------------------- //navigate to area of action [bIS_WP_Wounded] call BIS_guidePlayer; //apply agony on the assistant BIS_GetUp = false; BIS_fallDownScript = { ["BIS_fallDownScript ------------------------------"] call BIS_debugLog; ["> body",BIS_Wounded getVariable "body"] call BIS_debugLog; ["> damage",BIS_Wounded getVariable "body"] call BIS_debugLog; _this setVariable ["body", 5]; _this setDamage 0; }; BIS_fallDownSpawn = BIS_Wounded spawn { while {!BIS_GetUp} do { waitUntil {(BIS_Wounded getVariable "body") < 5}; ["HEALING.."] call BIS_debugLog; waitUntil {(BIS_Wounded getVariable "body") <= 0.5}; ["HEALED!"] call BIS_debugLog; BIS_Wounded call BIS_fallDownScript; }; }; _nic = BIS_Wounded spawn { while {!BIS_GetUp} do { sleep 0.01; _this setDamage 0; }; }; //apply agony on the assistant BIS_Wounded setVariable ["body", 5]; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf0_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf1_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf2_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_WP_Wounded,4] call BIS_checkptReached"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf4_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf5_0"+BIS_GFX_FirstAid+ localize "STR_EP1_tool.txt3" + (["heal"] call BIS_getIcon) + localize "STR_EP1_tool.txt1"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf6_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "player distance BIS_Wounded < 2.2 && cursorTarget == BIS_Wounded"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf8_0"; BIS_AdvHints_TInfo = format[ localize "STR_EP1_mission_flow.sqf9_0" + (["heal"] call BIS_getIcon) + localize "STR_EP1_tool.txt10", "Action" call BIS_getKeyBind]; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf10_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "BIS_Wounded getVariable 'body' < 5"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf12_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf14"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState BIS_Wounded) != 'Unconscious'"; BIS_AdvHints_HideCode = "BIS_Wounded setDamage 0"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // DRAGGING //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf16"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf17"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf20_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf21_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf22_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf23_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "animationState(player) in ['acinpknlmstpsraswrfldnon', 'acinpknlmwlksraswrfldb', 'acinpknlmstpsnonwnondnon', 'acinpknlmwlksnonwnondb']"; call BIS_AdvHints_showHint; //navigate from start to target area [bIS_WP_Wounded,BIS_WP_DragTarget] call BIS_guidePlayer; //create WP BIS_Objective = BIS_WP_DragTarget; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf24_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf26_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf27_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_Wounded,BIS_WP_DragTarget,4] call BIS_isInDistance2D"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // CARRYING //-------------------------------------------------------------------------------------------------- //hide arrow & ball marker call BIS_deleteGArrow; call BIS_deleteGBall; //apply agony on the assistant //_nic = [] spawn {BIS_Wounded setVariable ["body", 5]; waitUntil {damage BIS_Wounded > 0.5} ; BIS_Wounded setDamage 0;}; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf28"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf29"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 7; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf32_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf33_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf34_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf35", {'NextAction' call BIS_getKeyBind}, {'PrevAction' call BIS_getKeyBind}, {'ActionContext' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "animationState(player) in ['acinpercmstpsnonwnondnon', 'acinpercmrunsnonwnondf', 'acinpercmstpsraswrfldnon', 'acinpercmrunsraswrfldf']"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf36_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf37_0"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf39_0", {'Stand' call BIS_getKeyBind}, {'Crouch' call BIS_getKeyBind}, {'Prone' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; //navigate from start to target area [bIS_WP_DragTarget,BIS_WP_CarryTarget] call BIS_guidePlayer; //create WP BIS_Objective = BIS_WP_CarryTarget; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf40_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf42_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_Wounded,BIS_WP_CarryTarget,3] call BIS_isInDistance2D"; call BIS_AdvHints_showHint; //delete arrow & ball marker call BIS_deleteGArrow; call BIS_deleteGBall; //-------------------------------------------------------------------------------------------------- // CARRYING COMPLETED //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf44_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf45_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf46_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf47_0",{'Crouch' call BIS_getKeyBind}]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(animationState BIS_Wounded != 'ainjpfalmstpsnonwnondnon_carried_up') && (animationState BIS_Wounded != 'ainjppnemstpsnonwnondb_grab')"; call BIS_AdvHints_showHint; ["BIS_Wounded position",getPos BIS_Wounded] call BIS_debugLog; //fix the 'BIS_Wounded' terminate BIS_fallDownSpawn; BIS_GetUp = true; BIS_Wounded setVariable ["body", 0]; BIS_Wounded setDamage 0; //position fix //BIS_Wounded setPos [getPos BIS_Wounded select 0,getPos BIS_Wounded select 1,(getPos BIS_Wounded select 2) - 0.21]; //['aidlpercmstpsnonwnondnon_idlesteady01','aidlpercmstpsnonwnondnon_idlesteady04','aidlpercmstpsnonwnondnon_idlesteady03','aidlpercmstpsnonwnondnon_idlesteady02','aidlpercmstpsnonwnondnon0s'] //-------------------------------------------------------------------------------------------------- // HEALING AT VEHICLES //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf48_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf49"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 7; call BIS_AdvHints_showHint; //simulate light damage to player player setDamage 0.1; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf52_0"; BIS_AdvHints_TInfo = format[ localize "STR_EP1_mission_flow.sqf53_0", "%1", (["heal",BIS_COLOR_GREEN,"x"] call BIS_getIcon)]; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf54_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf55_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "damage player == 0"; call BIS_AdvHints_showHint; [] spawn { //un-load the medic unassignVehicle BIS_Medic; doGetOut BIS_Medic; sleep 3; //send out the ambulance BIS_CanGoAway = true; BIS_Ambulace setFuel 1; }; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf56_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf57"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; //create a group BIS_grpMedic = group BIS_Wounded; [player,BIS_Medic] joinSilent BIS_grpMedic; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf60_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf61"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf62_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf63_0","Prone" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_KeyPress = "Prone"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // CALLING FOR MEDIC //-------------------------------------------------------------------------------------------------- //simulate heavy leg damage to player player call BIS_fallDownScript; player setDamage 0.5; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState player) == 'Unconscious'"; BIS_AdvHints_Seamless = true; BIS_AdvHints_Silent = true; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf64_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf65_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf66"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState player) != 'Unconscious' && damage player == 0"; call BIS_AdvHints_showHint; sleep 1; BIS_Medic switchMove ""; sleep 2; player setDamage 0.5; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf68"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf69"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf70"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf71",{'ForceCommandingMode' call BIS_getKeyBind}]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "damage player == 0"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // TO END //-------------------------------------------------------------------------------------------------- //unlock the Hummer BIS_Hummer lock false; //send NPC into the Hummer BIS_Wounded forceSpeed 2; BIS_Medic forceSpeed 2; BIS_Wounded setUnitPos "UP"; BIS_Medic setUnitPos "UP"; BIS_Wounded assignAsCargo BIS_Hummer; BIS_Medic assignAsCargo BIS_Hummer; player assignAsDriver BIS_Hummer; [bIS_Wounded,BIS_Medic] orderGetIn true; BIS_Medic switchMove ""; //guide player to start [[bIS_WP_CarryTarget,BIS_WP_DragTarget,BIS_WP_Wounded,BIS_WP_2Car,BIS_WP_2Car_1,BIS_WP_2Car_2,BIS_WP_2Car_3],"SLOW_WALK"] call BIS_guidePlayer; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf72"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf74"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_WP_2Car_3,5] call BIS_checkptReached"; call BIS_AdvHints_showHint; //reposition the GArrow [bIS_Hummer,2.2] call BIS_createGArrow; //hide GBall deleteVehicle(BIS_GBall); BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf76"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf78"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf79", {'Action' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "player in BIS_Hummer"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // END //-------------------------------------------------------------------------------------------------- BIS_Objectives call BIS_endTutorial; Share this post Link to post Share on other sites
seba1976 98 Posted October 2, 2012 I have run into a couple of walls with a mission I'm working on for Lions of Kandahar... My searches have not yielded anything about controlling drag/pickup wounded, only conversation about how to make the modules work.It has to do with the sort of functionality from the First Aid: Simulation and First Aid: Battlefield Clearance modules that would allow the player to drag/pickup an AI. I want to have: 1) A controlled IED explosion which ejects the passengers of a Humvee out onto the ground (this is in-place), 2) I am trying to keep them alive using allowDamage (this is inconsistent, in most cases one of the two AI dies), and setting damage to like 0.7 using setDamage and not setHit (lost the link with the body part translations) 3) The player will run to the first AI and do an action to put out the fire on one AI's body (I know how to make something like this work), 4) The player will have to defend the area for a few minutes 5) This is where I really need some help, then I want him to pickup or drag the two AI's to a nearby casualty collection point, when both of them are within the trigger area, the mission will continue to the next phase. So, I am looking to recreate basically the functionality from the Training portion of Arma2, where the two AI units are injured but not dead, and can be dragged or carried. Can/should this be done using the above-mentioned modules, or is there a function I can use, or some kind of action/playmove combo that would attach the AI to the player? Thanks in advance for any links, explanations, etc. Have you checked and tried the Wiki? http://community.bistudio.com/wiki/First_Aid If you did, what part doesn't work for you? Share this post Link to post Share on other sites
h34dup 148 Posted October 2, 2012 Have you checked and tried the Wiki?http://community.bistudio.com/wiki/First_Aid If you did, what part doesn't work for you? I have referred to that, yes-- that's sort of what I was using as a reference, trying to make sure I had the modules set up properly. I have had this work "in-theory" in prior missions, but only when the player is wounded but not killed. In this case, having allowDamage should prevent this functionality from kicking in...yet if it weren't enabled, the AIs would likely die in the IED explosion. But my observation was that the situation I'm trying to create is too well-defined and I'm having trouble arriving at the exact explosion location/magnitude that would injure the AIs enough that this functionality would kick in. Here's how BIS did it, maybe pull out some parts of this? //-------------------------------------------------------------------------------------------------- // DEFAULTS (FOR ULTRAEDIT HINTING) //-------------------------------------------------------------------------------------------------- BIS_AdvHints_Header = ""; BIS_AdvHints_Text = ""; BIS_AdvHints_Footer = ""; BIS_AdvHints_Duration = -1; BIS_AdvHints_ShowCond = "true"; BIS_AdvHints_ShowCode = ""; BIS_AdvHints_HideCond = ""; BIS_AdvHints_HideCode = ""; BIS_AdvHints_Silent = false; BIS_AdvHints_Seamless = false; BIS_AdvHints_KeyPress = ""; BIS_AdvHints_CanSkip = true; BIS_AdvHints_NoFooter = false; call BIS_AdvHints_setDefaults; //-------------------------------------------------------------------------------------------------- // INTRO //-------------------------------------------------------------------------------------------------- //display welcome hint [bIS_MissionName,BIS_Objectives] call BIS_AdvHints_createWelcome; //-------------------------------------------------------------------------------------------------- // APPLYING FIRST AID //-------------------------------------------------------------------------------------------------- //navigate to area of action [bIS_WP_Wounded] call BIS_guidePlayer; //apply agony on the assistant BIS_GetUp = false; BIS_fallDownScript = { ["BIS_fallDownScript ------------------------------"] call BIS_debugLog; ["> body",BIS_Wounded getVariable "body"] call BIS_debugLog; ["> damage",BIS_Wounded getVariable "body"] call BIS_debugLog; _this setVariable ["body", 5]; _this setDamage 0; }; BIS_fallDownSpawn = BIS_Wounded spawn { while {!BIS_GetUp} do { waitUntil {(BIS_Wounded getVariable "body") < 5}; ["HEALING.."] call BIS_debugLog; waitUntil {(BIS_Wounded getVariable "body") <= 0.5}; ["HEALED!"] call BIS_debugLog; BIS_Wounded call BIS_fallDownScript; }; }; _nic = BIS_Wounded spawn { while {!BIS_GetUp} do { sleep 0.01; _this setDamage 0; }; }; //apply agony on the assistant BIS_Wounded setVariable ["body", 5]; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf0_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf1_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf2_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_WP_Wounded,4] call BIS_checkptReached"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf4_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf5_0"+BIS_GFX_FirstAid+ localize "STR_EP1_tool.txt3" + (["heal"] call BIS_getIcon) + localize "STR_EP1_tool.txt1"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf6_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "player distance BIS_Wounded < 2.2 && cursorTarget == BIS_Wounded"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf8_0"; BIS_AdvHints_TInfo = format[ localize "STR_EP1_mission_flow.sqf9_0" + (["heal"] call BIS_getIcon) + localize "STR_EP1_tool.txt10", "Action" call BIS_getKeyBind]; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf10_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "BIS_Wounded getVariable 'body' < 5"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf12_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf14"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState BIS_Wounded) != 'Unconscious'"; BIS_AdvHints_HideCode = "BIS_Wounded setDamage 0"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // DRAGGING //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf16"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf17"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf20_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf21_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf22_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf23_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "animationState(player) in ['acinpknlmstpsraswrfldnon', 'acinpknlmwlksraswrfldb', 'acinpknlmstpsnonwnondnon', 'acinpknlmwlksnonwnondb']"; call BIS_AdvHints_showHint; //navigate from start to target area [bIS_WP_Wounded,BIS_WP_DragTarget] call BIS_guidePlayer; //create WP BIS_Objective = BIS_WP_DragTarget; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf24_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf26_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf27_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_Wounded,BIS_WP_DragTarget,4] call BIS_isInDistance2D"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // CARRYING //-------------------------------------------------------------------------------------------------- //hide arrow & ball marker call BIS_deleteGArrow; call BIS_deleteGBall; //apply agony on the assistant //_nic = [] spawn {BIS_Wounded setVariable ["body", 5]; waitUntil {damage BIS_Wounded > 0.5} ; BIS_Wounded setDamage 0;}; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf28"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf29"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 7; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf32_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf33_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf34_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf35", {'NextAction' call BIS_getKeyBind}, {'PrevAction' call BIS_getKeyBind}, {'ActionContext' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "animationState(player) in ['acinpercmstpsnonwnondnon', 'acinpercmrunsnonwnondf', 'acinpercmstpsraswrfldnon', 'acinpercmrunsraswrfldf']"; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf36_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf37_0"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf39_0", {'Stand' call BIS_getKeyBind}, {'Crouch' call BIS_getKeyBind}, {'Prone' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; //navigate from start to target area [bIS_WP_DragTarget,BIS_WP_CarryTarget] call BIS_guidePlayer; //create WP BIS_Objective = BIS_WP_CarryTarget; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf40_0"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf42_0"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_Wounded,BIS_WP_CarryTarget,3] call BIS_isInDistance2D"; call BIS_AdvHints_showHint; //delete arrow & ball marker call BIS_deleteGArrow; call BIS_deleteGBall; //-------------------------------------------------------------------------------------------------- // CARRYING COMPLETED //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf44_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf45_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf46_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf47_0",{'Crouch' call BIS_getKeyBind}]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(animationState BIS_Wounded != 'ainjpfalmstpsnonwnondnon_carried_up') && (animationState BIS_Wounded != 'ainjppnemstpsnonwnondb_grab')"; call BIS_AdvHints_showHint; ["BIS_Wounded position",getPos BIS_Wounded] call BIS_debugLog; //fix the 'BIS_Wounded' terminate BIS_fallDownSpawn; BIS_GetUp = true; BIS_Wounded setVariable ["body", 0]; BIS_Wounded setDamage 0; //position fix //BIS_Wounded setPos [getPos BIS_Wounded select 0,getPos BIS_Wounded select 1,(getPos BIS_Wounded select 2) - 0.21]; //['aidlpercmstpsnonwnondnon_idlesteady01','aidlpercmstpsnonwnondnon_idlesteady04','aidlpercmstpsnonwnondnon_idlesteady03','aidlpercmstpsnonwnondnon_idlesteady02','aidlpercmstpsnonwnondnon0s'] //-------------------------------------------------------------------------------------------------- // HEALING AT VEHICLES //-------------------------------------------------------------------------------------------------- BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf48_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf49"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 7; call BIS_AdvHints_showHint; //simulate light damage to player player setDamage 0.1; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf52_0"; BIS_AdvHints_TInfo = format[ localize "STR_EP1_mission_flow.sqf53_0", "%1", (["heal",BIS_COLOR_GREEN,"x"] call BIS_getIcon)]; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf54_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf55_0","Action" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "damage player == 0"; call BIS_AdvHints_showHint; [] spawn { //un-load the medic unassignVehicle BIS_Medic; doGetOut BIS_Medic; sleep 3; //send out the ambulance BIS_CanGoAway = true; BIS_Ambulace setFuel 1; }; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf56_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf57"; BIS_AdvHints_TAction = ""; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_Duration = 5; call BIS_AdvHints_showHint; //create a group BIS_grpMedic = group BIS_Wounded; [player,BIS_Medic] joinSilent BIS_grpMedic; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf60_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf61"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf62_0"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf63_0","Prone" call BIS_getKeyBind]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_KeyPress = "Prone"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // CALLING FOR MEDIC //-------------------------------------------------------------------------------------------------- //simulate heavy leg damage to player player call BIS_fallDownScript; player setDamage 0.5; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState player) == 'Unconscious'"; BIS_AdvHints_Seamless = true; BIS_AdvHints_Silent = true; call BIS_AdvHints_showHint; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf64_0"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf65_0"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf66"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "(lifeState player) != 'Unconscious' && damage player == 0"; call BIS_AdvHints_showHint; sleep 1; BIS_Medic switchMove ""; sleep 2; player setDamage 0.5; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf68"; BIS_AdvHints_TInfo = localize "STR_EP1_mission_flow.sqf69"; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf70"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf71",{'ForceCommandingMode' call BIS_getKeyBind}]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "damage player == 0"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // TO END //-------------------------------------------------------------------------------------------------- //unlock the Hummer BIS_Hummer lock false; //send NPC into the Hummer BIS_Wounded forceSpeed 2; BIS_Medic forceSpeed 2; BIS_Wounded setUnitPos "UP"; BIS_Medic setUnitPos "UP"; BIS_Wounded assignAsCargo BIS_Hummer; BIS_Medic assignAsCargo BIS_Hummer; player assignAsDriver BIS_Hummer; [bIS_Wounded,BIS_Medic] orderGetIn true; BIS_Medic switchMove ""; //guide player to start [[bIS_WP_CarryTarget,BIS_WP_DragTarget,BIS_WP_Wounded,BIS_WP_2Car,BIS_WP_2Car_1,BIS_WP_2Car_2,BIS_WP_2Car_3],"SLOW_WALK"] call BIS_guidePlayer; BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf72"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf74"; BIS_AdvHints_TBinds = ""; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "[bIS_WP_2Car_3,5] call BIS_checkptReached"; call BIS_AdvHints_showHint; //reposition the GArrow [bIS_Hummer,2.2] call BIS_createGArrow; //hide GBall deleteVehicle(BIS_GBall); BIS_AdvHints_THeader = localize "STR_EP1_mission_flow.sqf76"; BIS_AdvHints_TInfo = ""; BIS_AdvHints_TAction = localize "STR_EP1_mission_flow.sqf78"; BIS_AdvHints_TBinds = [ localize "STR_EP1_mission_flow.sqf79", {'Action' call BIS_getKeyBind} ]; BIS_AdvHints_Text = call BIS_AdvHints_formatText; BIS_AdvHints_HideCond = "player in BIS_Hummer"; call BIS_AdvHints_showHint; //-------------------------------------------------------------------------------------------------- // END //-------------------------------------------------------------------------------------------------- BIS_Objectives call BIS_endTutorial; Thanks Kylania, I was hoping to have a look through something like this. I'll have to poke around and see if anything sticks later today and this week. It seems like the solution will be to call certain functions in order to simulate a wounded soldier without risking any actual injury to the AI from the IED itself. Share this post Link to post Share on other sites
seba1976 98 Posted October 2, 2012 (edited) I have referred to that, yes-- that's sort of what I was using as a reference, trying to make sure I had the modules set up properly. I have had this work "in-theory" in prior missions, but only when the player is wounded but not killed. In this case, having allowDamage should prevent this functionality from kicking in...yet if it weren't enabled, the AIs would likely die in the IED explosion. But my observation was that the situation I'm trying to create is too well-defined and I'm having trouble arriving at the exact explosion location/magnitude that would injure the AIs enough that this functionality would kick in. Good then. It wasn't clear how much you knew about the module. The problem is probably what you say, the module kicks in when the injuries are "real", and not artificial. This probably saved me some headaches because I was just about to start testing the First Aid module myself :). Edited October 2, 2012 by seba1976 Typo. Share this post Link to post Share on other sites
h34dup 148 Posted October 2, 2012 Good then. It wasn't clear how much you knew about the module. The problem is probably what you say, the module kicks in when the injuries are "real", and not artificial. This probably saved me some headaches because I was just about to start testing the First Aid module myself :). Ah yes, it helps because it seems to prevent your squad mates from being killed so easily, your player character included, but it also presents a range of challenges: for example, even though the module is supposed to allow you to pull wounded squadmates from vehicles, your AI squadmates aren't intelligent enough to do it if you are the one who ends up getting wounded, so you are forced to revert...unless of course the other squadmates are playable (which in-turn presents issues as well when it comes to resuming control over the squad leader and then trying to issue commands to the unit you were just controlling before). The non-simple First Aid modules really tend to change things up a bit in terms of gameplay and how you have to deal with casualties. This is another reason I'd prefer to find a way to simulate the functionality than try to approximate the actual explosion and hope it doesn't kill the AIs outright. We'll see if what Kylania kindly extracted from the training content can be of use, it's a bit cryptic but I can get a sense of what's doing what. Share this post Link to post Share on other sites
h34dup 148 Posted October 3, 2012 Alright, I had a little bit of time to play with the script above posted by Kylania. Looks like a lot of it has to do with hints and does not concern what I'm looking for. I still don't fully understand what's going on, but I did find the following: //apply agony on the assistant _nic = [] spawn {BIS_Wounded setVariable ["body", 5]; waitUntil {damage BIS_Wounded > 0.5} ; BIS_Wounded setDamage 0;}; When the AIs and the player are synced to First Aid: Simulation and First Aid: Battlefield Clearance, coupled with this allowDamage false, I was able to use the above to make sure that the AIs would not die, and they would be in the wounded position in their designated "landing spots". This allows me to drag and pick up, though carry seems to get stuck trying to move. Now, I want to remove the First Aid action that is added by the module by default, or disable the player from using this action. I may just be able to do a player removeAction 0 or something, but is there a more precise way to remove the First Aid action? Once I remove it, I might add a "fake First Aid action" that does the animation but doesn't change the AIs health. The idea though is that the only way the player will be able to get these two AIs to safety is by dragging or carrying them. Share this post Link to post Share on other sites
h34dup 148 Posted October 4, 2012 So I've spent the better part of the evening wrangling with this thread trying to figure it out. Looks like it does exactly what I want, provided I can make the proper edits to Big Dawg's script. Sure enough, it pastes into the init without errors, but the unit just lies there... At first I thought he was dead, but he isn't dead...but he isn't wounded either (if shot, you get the drag option). http://forums.bistudio.com/showthread.php?82597-First-aid-thing-can-I-disable-quot-First-Aid-quot-while-keeping-quot-Drag-quot&highlight=aid You ready for this? this setCaptive true; this disableAI "ANIM"; this setHit ["body",0.7]; this setHit ["legs",0.9]; this setHit ["arms",0.6]; this setHit ["head_hit",0.3]; this setVariable ["BIS_noCoreConversations", true, true]; injuredAnim = this 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 = this 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]; } You will need to modify the "injuredAnim" part to remove where it waits for a medic to stop "treating" him. You will also need to sync the unit to a BC module, but don't sync him to any first aid modules. Btw, this is all init field code... I know I'm really lazy aren't I? Any help would be appreciated. Share this post Link to post Share on other sites
seba1976 98 Posted October 4, 2012 This allows me to drag and pick up, though carry seems to get stuck trying to move. Be aware that I had the exact same problem with non vanilla units. If you're trying to make all this complexity work, I think you better try it out with stock BIS units. Share this post Link to post Share on other sites
h34dup 148 Posted October 4, 2012 Alright, I've got something here. I tried messing with a few more things to no avail, setting health in the unit's window in the editor really low, trying to tweak code I still don't fully understand, I have found something that appears to be stable enough to work. First Aid: BC module only, no other First Aid modules. Set the unit's health low in the editor and sync him to the FA:BC module. Also, I'm not sure if he could actually sustain more damage from the IED itself, so I'm gonna do a little magic trick that places the body in the landing spot while the "stunt doubles" caught in the explosion either go away or are deleted. This goes in the init field of the unit to be wounded and dragged (sorry for the wonky line breaks and lack of proper indentation, it got lost in transition): this setCaptive true; this disableAI "ANIM"; this setVariable ["body",0.7]; this setVariable ["legs",0.9]; this setVariable ["arms",0.6]; this setVariable ["head_hit",0.3]; injuredAnim = this spawn { _this switchMove "AinjPpneMstpSnonWnonDnon"; _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 = this 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) }; } The major change is that instead of using setHit, I use setVariable (same syntax) from the original code kylania posted. This ensures the unit is wounded and thus meets the condition to be dragged or carried. I tried based on my limited understanding of the script to disable the waitUntil medic is finished healing part as suggested by Dawg, not sure if it's out there. Only bugs of this so far (5 mins ago) are the animation gets wierd and the units collide and fall a little while carrying him on your back, dragging appears to be fine. Also, the animation is really not that obvious, the wounded AI looks more like he's lying unconscious or in shock, not jerking about violently like normal. This is actually not a bad thing, it will make searching for them among the bodies of the enemy more intense. Share this post Link to post Share on other sites