Maffine 4 Posted June 15, 2020 Hello guys, I'm working on a script and need to identify the object info of the player's weapon (that in the format 11111: dummyweapon.p3d). I have already tried using lineIntersectsSurface but it does not respond to human units. I also tried using cursorObject for Biki says it will return the p3d info when pointing at other units' weapons, but no result so far. I remember that there is a line of command that can return that info of player's backpack and vest (backpackContainer and so), but no counterpart for other proxy. So I am currently out of options. Does anyone know whether the weapon's object info can ever be retrieved by someone other than the engine itself? Thanks Share this post Link to post Share on other sites
gc8 977 Posted June 15, 2020 You can get the weapon config that has all the data of the weapon like this: _weaponConfig = configfile >> "CfgWeapons" >> (primaryWeapon player); hint (getText (_weaponConfig >> "displayname")); So to get info of the weapon config you need to use getText, getNumber, getArray commands Hope I didn't typo anything 🙂 Share this post Link to post Share on other sites
Maffine 4 Posted June 15, 2020 1 hour ago, gc8 said: You can get the weapon config that has all the data of the weapon like this: _weaponConfig = configfile >> "CfgWeapons" >> (primaryWeapon player); hint (getText (_weaponConfig >> "displayname")); So to get info of the weapon config you need to use getText, getNumber, getArray commands Hope I didn't typo anything 🙂 Thanks gc8😄Sorry that maybe I'm not expressing myself very precisely, what I want to do is to get the instance instead of the class, or put it another way, the piece of code that represents "the" exact gun held by player like for example a chair spawn in a mission, instead of the class name telling all the attributes about the gun. Hope I am anywhere close to saying something meaningful, for I am really not good at describing something so nuanced. Thanks again for your help! Share this post Link to post Share on other sites
Von Quest 1163 Posted June 15, 2020 currentWeapon player; https://community.bistudio.com/wiki/currentWeapon Share this post Link to post Share on other sites
Maffine 4 Posted June 15, 2020 29 minutes ago, Von Quest said: currentWeapon player; https://community.bistudio.com/wiki/currentWeapon The tricky part is that I need to get an object as a return, not a string or array or so. Share this post Link to post Share on other sites
Von Quest 1163 Posted June 15, 2020 If you name something, like an in-game Object, then that's its name. It's then a Global Variable. You can set Names in the Field in the Editor. Also you may be interested in setVariable and getVariable, etc https://community.bistudio.com/wiki/setVariable (guessing there is a translation issue here?) Share this post Link to post Share on other sites
Maffine 4 Posted June 15, 2020 36 minutes ago, Von Quest said: If you name something, like an in-game Object, then that's its name. It's then a Global Variable. You can set Names in the Field in the Editor. Also you may be interested in setVariable and getVariable, etc https://community.bistudio.com/wiki/setVariable (guessing there is a translation issue here?) Well, I want to assign a handle to the weapon player is holding. Is it possible that way? Share this post Link to post Share on other sites