Jump to content
panicsferd

Is there a way to make it so an action is displayed to the player to search a body... but it only displays when the player is near it?

Recommended Posts

I am currently making a mission where you are tasked with finding information where a certain leader is to get your revenge and I would want to know how to make it so that when the player is near a fallen soldier you will get an action to search them... but only have it shown if you are within arms reach of the fallen corpse?

Share this post


Link to post
Share on other sites


fallenSoldier addAction

[

"My Action",

{

hint "My action exectuted";

},

nil,

6,

true,

true,

"",

"_this distance _target < 3"

];

Share this post


Link to post
Share on other sites
fallenSoldier addAction
[
	"My Action",
	{
		hint "My action exectuted";
	},
	nil,
	6,
	true,
	true,
	"",
	"_this distance _target < 3"
];

Where do I put this? and I'm guessing fallensoldier is the name of my soldier that has died?

Share this post


Link to post
Share on other sites

With the info you gave out yea, the action goes on the name of the solider you want the action to be applied to. You can put it in the init of that unit (change "fallenSoldier" to "this").

Share this post


Link to post
Share on other sites

Or more simply

fallenSoldier addAction
[
	"My Action",
	{
		hint "My action exectuted";
	},
	nil,
	6,
	true,
	true,
	"",
	"",
        3
];

Share this post


Link to post
Share on other sites

With the info you gave out yea, the action goes on the name of the solider you want the action to be applied to. You can put it in the init of that unit (change "fallenSoldier" to "this").

It works now... now I have to figure out how to make it where when you activate that action, after a while (like 10 seconds or so) it will then activate a trigger.

 

to do this for other things I had a code like this:

p1 addAction ["Plant Explosives",{explos setdamage 1;(_this select 0) removeaction (_this select 2)}];

this code above would have once the action was entered, it would kill a unit and then a trigger that had !alive explos would then be triggered and that would create a new task and complete the previous one.

 

I would like to do something similar to that.

Share this post


Link to post
Share on other sites

 

Or more simply

fallenSoldier addAction
[
	"My Action",
	{
		hint "My action exectuted";
	},
	nil,
	6,
	true,
	true,
	"",
	"",
        3
];

Nice catch, obviously I'm not keeping up with all the changes as of late :P.

Share this post


Link to post
Share on other sites

I managed to figure it out.

search1 addAction 
[ 
 "Search Body", 
 { 
  hint "You are searching the body for intel"; next1 setdamage 1;(_this select 0) removeaction (_this select 2)
 }, 
 nil, 
 6, 
 true, 
 true, 
 "", 
 "", 
 3 
];

Share this post


Link to post
Share on other sites

 

I managed to figure it out.

search1 addAction 
[ 
 "Search Body", 
 { 
  hint "You are searching the body for intel"; next1 setdamage 1;(_this select 0) removeaction (_this select 2)
 }, 
 nil, 
 6, 
 true, 
 true, 
 "", 
 "", 
 3 
];

 

Searching a body for intel looks like a great chance to use https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd

  • Like 1

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

×