Jump to content
Gurman01

Trigger activated when item added to players inventory from dead body

Recommended Posts

Hi Guys,

I would like a 'succeed task' when the player takes a specific secondary weapon from a dead enemy soldier....

I have searched for the script I need in relation to this and there are a few posts that are close but I cannot seem to get them to work. I can get this to work when a player picks up a rucksack with the weapon contained within it but not from the body or taking direct from the rucksack.

I am still fairly new to all this but enjoying every minute, if you would be kind enough to write out the full code I need so that I can simply copy and paste into the relevant box, it would be muchly appreciated.

Regards

Gurman

Share this post


Link to post
Share on other sites

Trigger condition of:

"launch_RPG32_F" in weapons player

This condition would also work:

player hasWeapon "launch_RPG32_F"

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for your prompt response... I shall go try this

Share this post


Link to post
Share on other sites

Just make sure that trigger is Synchronized with your setTaskState (Succeeded) intel module and that should complete a "find an AT weapon" task.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks It works (not that I should be surprised),

Its mind boggling that there are so many variations of script('in weapons', 'hasWeapon') , where can I find the lists of these? I know about the kit lists on SIX Config and the new script commands page on BIS..

Share this post


Link to post
Share on other sites

Again, Thank you... Just what I have been looking for!

Share this post


Link to post
Share on other sites

How would you use Item?

"sc_cellphone" in backpack player; ?

There is no hasItem in list.

Keep getting errors.

UPDATE:

--------

Got it!

"sc_cellphone" in UniformItems player;

Working on a system to Hack into Networks, Towers, Cellphones, etc.

Edited by Goblin
Fixed/Found

Share this post


Link to post
Share on other sites

Keep in mind UniformItems only checks for items (and magazines) in the Uniform. If they moved the cellphone to their vest Uniformitems wouldn't pick it up, you'd have to use VestItems instead. Using:

"sc_cellphone" in items player

should work for either (though items doesn't pick up magazines like UniformItems and VestItems and BackpackItems do but it does seem to pick up weapons, odd).

Also remember Conditions have no trailing ;

Edited by kylania

Share this post


Link to post
Share on other sites

As always, you're fantastic. Works. Was just going to use Uniform, Backpack and Vest. All three.

1. What is trailing? oh, you mean the ; ?

2. How do you STOP the Script IF you were to remove that Item?

Share this post


Link to post
Share on other sites

Hate to revive a dead topic, But im trying to do the same thing but with the Mortar gear( i.e. I_Mortar_01_weapon_F and I_MORTAR_01_support_F), would like to trigger the task once both parts of the mortar have been picked up but so far nothing is working. Perhaps mortar pieces fall into some other category in the scripting commands?

 

Thanks!

Share this post


Link to post
Share on other sites

Maybe the mortar parts are items.  To find out, as player pick up the two pieces, then in the console type this and see if you see the mortar parts listed in the output.

assignedItems player

If they  are in the array returned by assignedItems, then use those names in your trigger condition to check if those items are in array returned by unit assignedItems.

Share this post


Link to post
Share on other sites

Thanks for your reply Johnnyboy, picking up the tube and using the assigneditems command only returned items such as gps, NVGs, etc. As an experiment i also tried using additem when the player enters a trigger area, however this proved fruitless. perhaps mortar pieces are classed as a vehicle? in the editor the mortar pieces and other such weapons are classed as dismantled weapons, but ive no idea how to call such items

 

looking in the config viewer, the mortar pieces are in the vehiclecfg folder.

 

EDIT: Got it, its done with *variable* addbackpack "I_Mortar_01_weapon_F"

Edited by OnionTerror
Found a solution

Share this post


Link to post
Share on other sites

Good job.  Way to perservere.  So how will you find the mortars with a trigger condition?  items?  assignedItems? weapons? backpackItems?

Share this post


Link to post
Share on other sites

Sorry for the late reply fellas, after testing the scenario some more it became apparent that my initial plan want going to work, so im in the process of rethinking how i want to do it. the second part of this was to move to a specific position and set the mortar up there and have an area trigger detect when it had been assembled. this presented another problem as i had no idea how to do this, but then someone suggested using the event trigger handle weaponassembled or something. however, im not that good at scripting, and event handlers are an area i have not explored!

 

EDIT: Eventhandler- weaponassembled

Share this post


Link to post
Share on other sites

hi, If I wanted as a condition to have equipped a "V_RebreatherB" I should write Vest or vestitem?  Example:     player vest "V_RebreatherB"   ?

Share this post


Link to post
Share on other sites
2 hours ago, BULLWAR said:

hi

 

Vest. There is no command "vestItem."

vest player isEqualTo "V_RebreatherB";

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, Harzach said:

 

Vest. There is no command "vestItem."


vest player isEqualTo "V_RebreatherB";

 

thx Harzach

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

×