Jump to content
CoolSpy

Need help to create a task to pickup a particular enemy backpack?

Recommended Posts

Hi guys,

 

I am working on a mission where the players need to pickup a backpack named "B_Messenger_Coyote_F" on one of the enemies but could not find the right commands to use in the condition box.

Also, is there some way to put the "Land_Money_F" item in the backpacks ? (it's a cosmetic item, a stack of dollars, not meant to be used by players)

 

I need help, thanks in advance ;)

Share this post


Link to post
Share on other sites

Try this:

 

//init field of player or wherever you seem fit:
this addEventHandler ["Take", {

	params ["_unit", "_container", "_item"];
	if (_container isEqualTo YourBackPackUnit AND _item isEqualTo "B_Messenger_Coyote_F") then {systemchat "Backpack taken!"};	

}];

Place a unit holding the respective backpack and name it YourBackPackUnit.

Should do the trick.

 

Adding the money pile as item isn't possible without a mod, as far as I know.

 

Cheers

  • Like 3

Share this post


Link to post
Share on other sites
30 minutes ago, Grumpy Old Man said:

Try this:

 


//init field of player or wherever you seem fit:
this addEventHandler ["Take", {

	params ["_unit", "_container", "_item"];
	if (_container isEqualTo YourBackPackUnit AND _item isEqualTo "B_Messenger_Coyote_F") then {systemchat "Backpack taken!"};	

}];

Place a unit holding the respective backpack and name it YourBackPackUnit.

Should do the trick.

 

Adding the money pile as item isn't possible without a mod, as far as I know.

 

Cheers

 

This worked, thanks so much! I got the message "Backpack taken" as soon as I pick it up. Now, how do I make it complete a task once this is done please ? :)

Share this post


Link to post
Share on other sites
9 hours ago, coolspy said:

 

This worked, thanks so much! I got the message "Backpack taken" as soon as I pick it up. Now, how do I make it complete a task once this is done please ? :)

There's multiple ways.

How are you handling your tasks? Via script or editor modules?

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Editor modules. I am still a newbie in mission editing so, I have still alot to learn! Sorry if the implementation should be obvious :)

Share this post


Link to post
Share on other sites
3 hours ago, coolspy said:

Editor modules. I am still a newbie in mission editing so, I have still alot to learn! Sorry if the implementation should be obvious :)

 

Set it up like this:

//initPlayerLocal.sqf

player addEventHandler ["Take", {

 params ["_unit", "_container", "_item"];
 if (_container isEqualTo YourBackPackUnit AND _item isEqualTo "B_Messenger_Coyote_F") then {missionNamespace setVariable ["GOM_fnc_backpackTaken",true,true]};

}];

Trigger condition that changes task state:

time > 3 AND missionNamespace getVariable ["GOM_fnc_backpackTaken",false]

Demo mission.

 

Cheers

  • Thanks 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

×