Jump to content
XTankKiller

Unable to catch a simple added action on Land_USB_Dongle_01_F or Land_Key_01_F

Recommended Posts

Hello everyone,

 

I've been modding on Arma 3 for a while now and never met an issue like this one. It's completely impossible to catch an action added to Land_USB_Dongle_01_F or Land_Key_01_F. I just wrote

this addAction ["test", {}];

in the init field of these objects in the editor to make a test and it's working on any other object but definitely won't work on Land_USB_Dongle_01_F and Land_Key_01_F.

I keep moving the mouse over and around the object trying to catch the action but it won't show up. The problem is not caused by a script it's like the game is not even detecting when i move the cursor over these two objects. Is it possible to have a fix for this issue ?

Share this post


Link to post
Share on other sites

Some objects do not have simulation (aka "simple objects") and as such addAction does not work with them.

Quote

Parameters:  object: Object - Unit, vehicle or static object. No agents and simple objects!

 

There are a few ways to determine if an object is natively simple, such as:

  • placing it floating in the air in the editor and seeing if it falls when the mission runs (imperfect, as not all simulated objects have physics, like H-barriers and buildings)
  • moving your crosshair over the object to see if it "sees" it - place a "Baseball" (Things > Sports & Recreation) and a "Money (Roll)" (Things > Tools) in the editor then see how your crosshair sees the ball but not the roll.
  • look at configs, I assume
  • use your addAction test code

BIS_fnc_holdActionAdd doesn't work with simple objects, either.

ACE interactions do work with simple objects, but that's probably not relevant here.

 

Just spitballing, but maybe you could add an action to the player dynamically, when they are in proximity to the object and the object is cursorObject.

 

Share this post


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

Some objects do not have simulation (aka "simple objects") and as such addAction does not work with them.

 

There are a few ways to determine if an object is natively simple, such as:

  • placing it floating in the air in the editor and seeing if it falls when the mission runs (imperfect, as not all simulated objects have physics, like H-barriers and buildings)
  • moving your crosshair over the object to see if it "sees" it - place a "Baseball" (Things > Sports & Recreation) and a "Money (Roll)" (Things > Tools) in the editor then see how your crosshair sees the ball but not the roll.
  • look at configs, I assume
  • use your addAction test code

BIS_fnc_holdActionAdd doesn't work with simple objects, either.

ACE interactions do work with simple objects, but that's probably not relevant here.

 

Just spitballing, but maybe you could add an action to the player dynamically, when they are in proximity to the object and the object is cursorObject.

 

Thank you for your reply.

I tried to add an action to the player instead od the object but cursorObject is not detecting Land_USB_Dongle_01_F nor Land_Key_01_F. CursorObject returns <NULL-Object>.

I tried to add an action to buildings and it works very good. I think the problem is coming from the 3d models (dimension parameters), the game is not detecting at all when i move the cursor over these objects.

Share this post


Link to post
Share on other sites

Yeah, I had a quick go at it and wasn't getting results. I'm sure there's a workaround but I don't see it just yet. Hopefully a smarter person will chime in.

Share this post


Link to post
Share on other sites
12 hours ago, XTankKiller said:

Thank you for your reply.

I tried to add an action to the player instead od the object but cursorObject is not detecting Land_USB_Dongle_01_F nor Land_Key_01_F. CursorObject returns <NULL-Object>.

I tried to add an action to buildings and it works very good. I think the problem is coming from the 3d models (dimension parameters), the game is not detecting at all when i move the cursor over these objects.

 

Why don't you use item_keys (things/tools)  They are pickable and you can script what you want on it.

 

For your problem,the fact is the bounding boxes of your items (key or USB key) are too tiny. You can place a bigger object (visible) close to one of them, name the key (or usb), then apply an action on "big" object, and code for the named key.

Share this post


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

For your problem,the fact is the bounding boxes of your items (key or USB key) are too tiny.

 

They are just as big as those of other small objects that are fully "functional", like the box of matches, ID card, can opener, etc.

 

He might not want to pick up the key - he describes two objects that are not pickable.

  • Like 1

Share this post


Link to post
Share on other sites
On 12/31/2021 at 7:46 AM, pierremgi said:

 

Why don't you use item_keys (things/tools)  They are pickable and you can script what you want on it.

 

For your problem,the fact is the bounding boxes of your items (key or USB key) are too tiny. You can place a bigger object (visible) close to one of them, name the key (or usb), then apply an action on "big" object, and code for the named key.

I don't use Item_keys or Item_FlashDisk because when i pick these items, the game deletes all the variables added to the objects using setVariable and i need these variables. I'm also using items like Land_can_V1_F which has a very small bounding box and addAction is working good with them.

I'm trying to make Land_USB_Dongle_01_F and Land_Key_01_F pickable (using a modded inventory system) preserving all variables added with setVariable. When i use Item_keys or Item_FlashDisk i always have the default pick up action (which deletes all the variables), someone could misclick and delete all the variables of the object making it unusable.

Share this post


Link to post
Share on other sites

Yes! depending on what you intend to do with variables... and your final intention!

May I suggest you read this topic? You can manage already pickable items, as said. It's better to set a variable on player rather than objects, especially if you delete them! (you can teleport them instead), but the link I mention could help.

Share this post


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

Yes! depending on what you intend to do with variables... and your final intention!

May I suggest you read this topic? You can manage already pickable items, as said. It's better to set a variable on player rather than objects, especially if you delete them! (you can teleport them instead), but the link I mention could help.

I cannot set the variables on the player i absolutely need to set the variables on the objects. I'm working on a mod to make computer fully functional (bios, OS, network protocols and internet) and for example, i need to use Land_USB_Dongle_01_F to allow players to transfert data from a computer to an other one. I definitely need to store the data on the usb key object to make it work, not on the player.

I created a modded inventory system to teleport objects at [0,0,-100] instead deleting them to store them in the inventory. I tryied to use Item_FlashDisk and it's working but i cant remove the default pick up action and a player could misclick and delete all the variables stored on Item_FlashDisk.

If there is no solution, i think i will create a new usb key object from a 3d model found on internet.

Share this post


Link to post
Share on other sites

In fact, you have, at the end, a player with a key (or a dongle) and, just by condition, you're allowing this player to access, work or else, with a code supposed to be on the key...

Don't follow this real world logic!

Arma is made of lists, class strings, which allow you to "simulate", "think" you have an inventory but there is absolutely no "object" inside ! It's just an update of data with classes, number of items in lists. You can't say there is a named object on ground and you pick this object in inventory (read the link I gave you). So, there is no reason for applying a variable container on this object on ground. You'll lost that, just updating pictures, numbers, lists.

I know it's frustrating, inventory manages rooms on uniform, vest, backpack, adding confusion with real objects. But it's just a token in object's class and a calculation about remaining room.

Teleporting an objet is also frustrating for inventory.

 

Variables set on player(s) stay fine for a lot of work and desired behaviors, because, at the end, you allow the player to do something. The script I linked is worthy for even discriminating several objects (keys) by their names. So, a key can be peculiar for a door, a car, PC... and set on a player.

When you pick the object, the engine delete it and your inventory is updated. You just have to update your player's variable as "history" of the name for this deleted object. On the other hand, you can add the name after putting it on ground (the object container is created, a type of object is added into it). Once the player "owns" this kind of object, you can trigger a code allowing something, til the player put the object back, so update one of his variables.

I hope it's clear. Not my native language. I guess you'll obtain more help sharing your code.

  • 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

×