Jump to content

Recommended Posts

Hello, this doesn't seem to be working

 

{_x == "vn_prop_food_sack_01_gh"} count items player >= 5 AND player distance mkt1_seller_10 < 10;

 

It's not counting (or registering the 5 items when picked), i also tried without the _prop if it's the same as with uniforms (the pickable object has a slightly different name). 

 

Appreciate any help, ty in advance

Share this post


Link to post
Share on other sites
1 hour ago, Casio91Fin said:

 

 

Heya, ty for the reply, on the face of it, it probably can work, but ideally i'd need a solution to track the  bags of rice in player inventory, because i've attached a trigger to it  that counts bags of rice and when it's at 5 that moves the task wp to the quest giver, tells the player to go back where the quest is completed, reward gets rewarded etc etc

Share this post


Link to post
Share on other sites
5 hours ago, Rok Stuhne said:

i also tried without the _prop if it's the same as with uniforms (the pickable object has a slightly different name).

 

So, make sure you are using the correct classname.

copyToClipboard str itemsWithMagazines player;

 

 

  • Like 1

Share this post


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

 

So, make sure you are using the correct classname.


copyToClipboard str itemsWithMagazines player;

 

 

 

tnx for the reply, got the new name "vn_prop_food_sack_01", but somehow it still doesn't work. 

Share this post


Link to post
Share on other sites

It might be a magazine instead of an item, which is why I chose the command itemsWithMagazines.

{_x == "vn_prop_food_sack_01_gh"} count magazines player >= 5 AND player distance mkt1_seller_10 < 10;

 

  • Like 1

Share this post


Link to post
Share on other sites
10 minutes ago, Harzach said:

It might be a magazine instead of an item, which is why I chose the command itemsWithMagazines.


{_x == "vn_prop_food_sack_01_gh"} count magazines player >= 5 AND player distance mkt1_seller_10 < 10;

 

 

 

Good stuff! It worked. 

 

but omg lol, it does feel more like an item than a magazine. Many thanks! :wine:

Share this post


Link to post
Share on other sites

I'm no expert, but I think the magazine class allows modders to imbue their objects with certain properties that they can't otherwise, like stacking.

Share this post


Link to post
Share on other sites
12 minutes ago, Harzach said:

I'm no expert, but I think the magazine class allows modders to imbue their objects with certain properties that they can't otherwise, like stacking.

 

Quick follow up lol, how could i elegantly write the following:

 

{_x == "vn_prop_food_sack_01"} count magazines inArea RiceDropoffArea >= 5;

the idea is that 5kg of rice needs to be disposed of because the character gets tired really quickly and the best way to do that is to tie it into task completion by scripting a dropoff point rather than just proximity to the  questgiver. 

Share this post


Link to post
Share on other sites

That gets even more complicated, as many objects (like weapons and magazines) are placed into parent containers called "weapon holders" when dropped on the ground. So you would need to find all weapon holders in the given area then check their contents. If this is for multiplayer, that might complicate things further, as these objects are not necessarily owned by the player that dropped them. There are a few solutions to this problem, though.

 

Gotta do some work, I'll look into this later if no one else has.

Share this post


Link to post
Share on other sites
1 hour ago, Harzach said:

That gets even more complicated, as many objects (like weapons and magazines) are placed into parent containers called "weapon holders" when dropped on the ground. So you would need to find all weapon holders in the given area then check their contents. If this is for multiplayer, that might complicate things further, as these objects are not necessarily owned by the player that dropped them. There are a few solutions to this problem, though.

 

Gotta do some work, I'll look into this later if no one else has.

 

The class name for the weapon holder is this probably:

 

"vn_prop_food_sack_01_gh"

 

this is the classname of the item you set down in the editor (bag of rice in the field), and if you remove _gh, it is the actual item in the player inventory (bag of rice that gets counted). I think _gh means ground holder, but obv cant be sure, just a hunch.

Share this post


Link to post
Share on other sites
1 hour ago, Rok Stuhne said:

The class name for the weapon holder is this probably:

 

No, it's one of these:

"GroundWeaponHolder",
"GroundWeaponHolder_Scripted",
"Library_WeaponHolder",
"WeaponHolder",
"WeaponHolder_Single_F",
"WeaponHolder_Single_limited_item_F",
"WeaponHolder_Single_limited_magazine_F",
"WeaponHolder_Single_limited_weapon_F",
"WeaponHolderSimulated",
"WeaponHolderSimulated_Scripted"

It's an invisible container.

 

*edit* - It's a "WeaponHolder"

Share this post


Link to post
Share on other sites

OK, so after some research, I have come up with this, but I have a feeling it could be simplified further. In trigger CONDITION:

private _array = [];  
(nearestObjects [thisTrigger, ["WeaponHolder"], 5]) inAreaArray thisTrigger apply { _array append (magazineCargo _x)};  
{_x == "vn_prop_food_sack_01"} count _array >= 5

 

External script:

private _area = RiceDropoffArea;
private _array = [];  
(nearestObjects [_area, ["WeaponHolder"], 5]) inAreaArray _area apply { _array append (magazineCargo _x)};  
if ({_x == "vn_prop_food_sack_01"} count _array >= 5) then {
	//CODE HERE
};

 

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

×