Jun Xiao 3 Posted September 14, 2018 HI, I'm novice,As I said. I want to know how to get the muzzle and magazine name of RHS PFM-1 mine. AI placement RHS pfm-1 mine: unit fire ["Rhs_SmallMine_Muzzle", "Rhs_SmallMine_Muzzle", "rhs_mag_mine_pfm1"]; I was told that "Rhs_SmallMine_Muzzle", "Rhs_SmallMine_Muzzle" is Muzzle and magazine name. But I don't know how to get the other mines Muzzle and magazine name. I'll thank you anyway. Share this post Link to post Share on other sites
Mr H. 400 Posted September 14, 2018 Try browsing the config files maybe? 1 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 6 minutes ago, Mr H. said: Try browsing the config files maybe? Mr H. Thank you for your quick answer. You mean, "Esc" config files? Share this post Link to post Share on other sites
Janez 507 Posted September 14, 2018 As Mr H. suggested, use config viewer in 3d editor. Of course, you have to have relevant addons loaded. Alternatively, in editor, place down a unit, right click on it and Edit Loadout. Equip desired gear and click OK. Then right click on unit, select Attributes and insert the following into unit's init field. You will get a hint about weapons and magazines carried when you preview scenario in editor. hint format ["%1 \n\n %2",weapons this,magazines this] 2 2 Share this post Link to post Share on other sites
Harzach 2507 Posted September 14, 2018 Or a "Fired" EH: player addEventhandler ["fired",{copyToClipboard format["%1",_this]}]; Output is: Quote [C Alpha 1-1:1 (Harzach),"Put","Rhs_SmallMine_Muzzle","Rhs_SmallMine_Muzzle","rhs_ammo_pfm1","rhs_mag_mine_pfm1",7: rhs_m_pfm1_d.p3d,C Alpha 1-1:1 (Harzach)] 2 1 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 6 minutes ago, Janez said: As Mr H. suggested, use config viewer in 3d editor. Of course, you have to have relevant addons loaded. Alternatively, in editor, place down a unit, right click on it and Edit Loadout. Equip desired gear and click OK. Then right click on unit, select Attributes and insert the following into unit's init field. You will get a hint about weapons and magazines carried when you preview scenario in editor. hint format ["%1 \n\n %2",weapons this,magazines this] Ok, I'll try,Thank you mate Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 8 minutes ago, Harzach said: Or a "Fired" EH: player addEventhandler ["fired",{copyToClipboard format["%1",_this]}]; Output is: Harzach Thank you,I will try. Share this post Link to post Share on other sites
Harzach 2507 Posted September 14, 2018 Janez's code gives you exactly what you need, while mine gives you all info about the weapon/magazine/ammo (though it can be edited to return only relevant data, of course). 2 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 23 minutes ago, Mr H. said: Try browsing the config files maybe? Mr H. Thank you for your help. Thank you for responding so quickly. Share this post Link to post Share on other sites
Janez 507 Posted September 14, 2018 12 minutes ago, Jun Xiao said: Ok, I'll try,Thank you mate Yeah just make sure that unit is player, meaning you (attributes >> object: control >> tick player - red circle appears around unit on map). @Harzach, the ones you posted are probably even more appropriate. These are basics but I still have a compilation of @w0lle old one liners, just like yours. :) 1 1 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 5 minutes ago, Janez said: Yeah just make sure that unit is player, meaning you (attributes >> object: control >> tick player - red circle appears around unit on map). Harzach, that one is probably even more appropriate. These are basics but I still have a compilation of W0lle's old one liners, just like yours. :) I will try your method. Thank you,Janez. Also, thank you Mr. H. and Harzach. 1 Share this post Link to post Share on other sites
Harzach 2507 Posted September 14, 2018 player addEventhandler ["fired",{copyToClipboard format["[""%1"",""%2"",""%3""]",_this select 2,_this select 3,_this select 5]}]; That will return the array you need for any weapon. 3 Share this post Link to post Share on other sites
Janez 507 Posted September 14, 2018 5 minutes ago, Harzach said: player addEventhandler ["fired",{copyToClipboard format["["%1","%2","%3"]",_this select 2,_this select 3,_this select 5]}]; That will return the array you need for any weapon. And it copies it to clipboard, so you just open Notepad (preferably Notepad++) and press CTRL + V. Just brilliant. Another one added to the compilation. :) 1 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 7 minutes ago, Harzach said: player addEventhandler ["fired",{copyToClipboard format["["%1","%2","%3"]",_this select 2,_this select 3,_this select 5]}]; That will return the array you need for any weapon. This is great.. It looks cool. Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 3 minutes ago, Janez said: And it copies it to clipboard, so you just open Notepad (preferably Notepad++) and press CTRL + V. Just brilliant. Another one added to the compilation. :) Roger that,I'm trying, hopefully I understand. Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 1 hour ago, Harzach said: Share this post Link to post Share on other sites
Janez 507 Posted September 14, 2018 EH stands for Event Handler. In this case, when you fire a weapon, relevant information you are looking for, such as classname will be copied to clipboard. He meant, you can use either the code I poster or the one he posted. If you use player instead of this, then you can insert his code into init.sqf instead, for example. To learn what init.sqf is and a lot more, go trough Basic SQF-Scripting guide for example. The guide is for Arma 2 and it's 2D editor but same principles apply. As I posted already Eden Editor page has most of the information, from Scripting Commands to Functions. Here is also a list of vanilla Arma 3 Assets, from weapons to vehicles. So, go carefully trough all these links I posted and you will start connecting the dots. Be sure to search YouTube for relevant videos, such as this Arma Scripting Tutorials. Finally, if you are going to spend any amount of time with scripts, I would strongly recommend Notepad++ and SQF Syntax Highlighting and Auto Completion plugin for it. 1 2 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 14, 2018 45 minutes ago, Janez said: EH stands for Event Handler. In this case, when you fire a weapon, relevant information you are looking for, such as classname will be copied to clipboard. He meant, you can use either the code I poster or the one he posted. If you use player instead of this, then you can insert his code into init.sqf. To learn what init.sqf is or a lot more, go trough Basic SQF-Scripting guide for example. The guide is for Arma 2 and it's 2D editor but same principles apply. Here is a list of vanilla Arma 3 Assets, from weapons to vehicles. As I posted already Eden Editor page has most of the information, from Scripting Commands to Functions. So, go carefully trough all these links I posted and you will start connecting the dots. Be sure to search YouTube for relevant videos, such as this Arma Scripting Tutorials. Finally, if you are going to spend any amount of time with scripts, I would strongly recommend Notepad++ and SQF Syntax Highlighting and Auto Completion plugin for it. I'm going to ask you for help, but I'm really embarrassed. I didn't expect your reply. According to the detailed method you told me, I know how to get the Muzzle and magazine name. Thanks for your patience, Janez. Although my ability is not enough, what you said will be of great help to my future. I'll do my best Share this post Link to post Share on other sites
Harzach 2507 Posted September 14, 2018 For my code, the easiest thing to do is to place a unit in the editor, give them the weapon/ammo you are interested in, start the mission, then paste/execute the code in the debug console. Then you just need to fire the weapon/throw the grenade/place the mine, and the event handler will fire, copying the information to your clipboard. Super easy. Also, I fixed my code above, I forgot to double up my quotes inside the format block. 1 2 Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 15, 2018 1 hour ago, Harzach said: For my code, the easiest thing to do is to place a unit in the editor, give them the weapon/ammo you are interested in, start the mission, then paste/execute the code in the debug console. Then you just need to fire the weapon/throw the grenade/place the mine, and the event handler will fire, copying the information to your clipboard. Super easy. Also, I fixed my code above, I forgot to double up my quotes inside the format block. Thank you, I get it. Share this post Link to post Share on other sites
HazJ 1288 Posted September 15, 2018 @Jun Xiao - Little advice/tip... Use descriptive thread titles. Share this post Link to post Share on other sites
Jun Xiao 3 Posted September 15, 2018 1 hour ago, HazJ said: @Jun Xiao - Little advice/tip... Use descriptive thread titles. OK. Share this post Link to post Share on other sites