C.Ritter 16 Posted March 29, 2018 I want to try and add a billboard or any object with a script Example, "Click here to join our discord server" and then when you click it then you get onto the discord but i simple dont know how or if its possible, if so then i dont know how you do it, can anybody help me please? :i Share this post Link to post Share on other sites
pierremgi 4906 Posted March 31, 2018 Why not scripting a simple addAction for the billboard to trigger what you want? Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 I have 0 skillz in scripting, but forgot about this thread sorry, already have it sorted :) Share this post Link to post Share on other sites
Harzach 2518 Posted March 31, 2018 2 hours ago, C.Ritter said: I have 0 skillz in scripting, but forgot about this thread sorry, already have it sorted :) It is best practice to share your solutions, so that others with the same question will find something other than an empty topic. 2 Share this post Link to post Share on other sites
beno_83au 1369 Posted March 31, 2018 In lieu of the OPs solution: Two examples of how to achieve this at the end (mine and larrows). I think mine might be the simplest to implement, but larrows is probably the better solution no doubt. 2 Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 Got a better and easier solution, this template mission teach you something or two Download: https://www.dropbox.com/s/umfv7j6nkrmm1ix/concept_recruitmentBoard.VR.rar?dl=0 (WinRar file.) Put the recruitment_action.sqf into you're mission then copy and paste this line " call{0=[this] execVM "recruitment_action.sqf"} " into any object you may want to link the script to. I wrote // on one or more of them in recruitment_action.sqf to help you understand what they do. The mission.sqm is just for show, you will not need this for you're own missions, only the script (.sqf) Would have done it earlier but forgot about it right after, my bad. XianGrim helped me for this script, not that this is needed but some credits is better than nothing. If you dont want to download the mission "tutorial" then. Make a recruitment_action.sqf in you're mission. copy and paste this into it: Quote _recruitmentApparatus = _this select 0; [ _recruitmentApparatus, "join our discord channel!", //use lower case becaues its prefaces with "Hold Space to" "", "", "_this distance _target < 5", "_caller distance _target < 5", {}, {}, { _string = ""; // Paste you're link inside the "" _callNamed = (name _caller); hint format ["Hey %2!\n--------\nA link to our discord has been copied to your clipboard! Come hang out with us!\n\nLink = %1",_string,_callNamed]; // You can edit this line " link to our discord has been copied to your clipboard! Come hang out with us! " copyToClipboard _string; // This makes the link copy to your clipboard }, {}, [], 1, 0, false, false ] remoteExec ["BIS_fnc_holdActionAdd",0,_recruitmentApparatus]; // Do NOT delete any of these "//" in this script. (Helping Purposes). // 0 = [this] execVM "recruitment_action.sqf"; place that in any of the objects you might wanna use. (Init of the object) Then inside the object paste in the init: Quote 0 = [this] execVM "recruitment_action.sqf"; (Same line says in the recruitment_action.sqf) Share this post Link to post Share on other sites
HazJ 1289 Posted March 31, 2018 Why: call{0=[this] execVM "recruitment_action.sqf"} Just wondering if there is a specific reason? Never seen that. I just use execVM, call or spawn but not together. 0 = [this] execVM "recruitment_action.sqf"; Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 Script was first made to make me able to do it in one object only, then i asked him how i could have it in multiple objects at once and this is the final. Why i dunno, as said 0 skillz, but that is how i got it, and works just fine either way :) Share this post Link to post Share on other sites
HazJ 1289 Posted March 31, 2018 What??? Why not just: 0 = [this] execVM "recruitment_action.sqf"; I don't see why you added call there too hence why I asked if there was a specific reason. Share this post Link to post Share on other sites
Harzach 2518 Posted March 31, 2018 It is great to supply an example mission, but it would be ideal to post the contents of the script here, so those seeking help don't have to download a mission that might not be there in a month. 1 Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 I understood that, and i asnwered mate, i dunno, got the script like this, cant really say, the script works as it is. Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 Am never deleting my files in dropbox so no worries. Share this post Link to post Share on other sites
XianGrim 73 Posted March 31, 2018 Had to be a typo, 0 = [this] execVM "recruitment_action.sqf"; is all you need 1 Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 Well thats what you gave me mate xD Works aswell as the other, updating with this then. Share this post Link to post Share on other sites
Harzach 2518 Posted March 31, 2018 7 minutes ago, C.Ritter said: Am never deleting my files in dropbox so no worries. Sometimes things change. Regardless, there is no reason not to post the code here, and you are still forcing a download where one is not necessary. 1 Share this post Link to post Share on other sites
HazJ 1289 Posted March 31, 2018 @XianGrim - Yeah, I guess. I was just making sure. Edit: Ah, he copied it from mission.sqm directly. @XianGrim class Attributes { init="call{0=[this] execVM ""recruitment_action.sqf""}"; }; I downloaded the archive and looked at the code, made a few tweaks for anyone else that comes here for help. Original version: _recruitmentApparatus = _this select 0; [ _recruitmentApparatus, "join our discord channel!", //use lower case becaues its prefaces with "Hold Space to" "", "", "_this distance _target < 5", "_caller distance _target < 5", {}, {}, { _string = ""; // Paste you're link inside the "" _callNamed = (name _caller); hint format ["Hey %2!\n--------\nA link to our discord has been copied to your clipboard! Come hang out with us!\n\nLink = %1",_string,_callNamed]; // You can edit this line " link to our discord has been copied to your clipboard! Come hang out with us! " copyToClipboard _string; // This makes the link copy to your clipboard }, {}, [], 1, 0, false, false ] remoteExec ["BIS_fnc_holdActionAdd",0,_recruitmentApparatus]; // Do NOT delete any of these "//" in this script. (Helping Purposes). // call{0=[this] execVM "recruitment_action.sqf"} place that in any of the objects you might wanna use. (Init of the object) Tweaked version: params ["_target", "_title", "_idleIcon", "_progressIcon", "_condShow", "_condProgress", "_codeStart", "_codeProgress", "_codeCompleted", "_codeInterupted", "_arguments", "_duration", "_priority", "_removeCompleted", "_showUncon"]; // you can also set default for these if you wish // https://community.bistudio.com/wiki/params // see https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd for arguments [ _target, _title _idleIcon _progressIcon, _condShow, _condProgress, _codeStart, _codeProgress, _codeCompleted, _codeInterupted, _codeInterupted, _arguments, _duration, _priority, _removeCompleted, _showUncon ] remoteExec ["BIS_fnc_holdActionAdd", [0, -2] select isDedicated, _target]; [player, "Some action", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 3", "_caller distance _target < 3", {}, {}, {hintSilent "Hello!";}, {}, [], 12, 0, true, false] call TAG_fnc_addHoldAction; Don't forget to compile function, I use CfgFunctions but you can also do it like: TAG_fnc_addHoldAction = compile preprocessFileLineNumbers "fn_addHoldAction.sqf"; This way you don't need to duplicate code/files. 1 Share this post Link to post Share on other sites
C.Ritter 16 Posted March 31, 2018 I put in the mission link and wrote the whole script. Btw i didnt get it from the mission.sqm. Share this post Link to post Share on other sites
XianGrim 73 Posted March 31, 2018 Yeah I'm a big fan of the hold actions as well. He didn't want them lol Share this post Link to post Share on other sites
HazJ 1289 Posted March 31, 2018 2 minutes ago, C.Ritter said: I put in the mission link and wrote the whole script, not sure why your still posting on a solved thread tho. What is your problem lol? I am posting in a solved because: 1) I shared the code and not just a download link. 2) I improved the code and clearly stated why. 3) Because I can. Quote This way you don't need to duplicate code/files. Share this post Link to post Share on other sites
HazJ 1289 Posted March 31, 2018 Cool. I didn't do it just for your sake. It is community forums, other people may benefit from it as well which is what @Harzach was saying. 2 Share this post Link to post Share on other sites
pierremgi 4906 Posted April 1, 2018 5 hours ago, HazJ said: Why: call{0=[this] execVM "recruitment_action.sqf"} Just wondering if there is a specific reason? Never seen that. I just use execVM, call or spawn but not together. 0 = [this] execVM "recruitment_action.sqf"; The call is just automatically added by the trigger code in mission.sqm. You don't see it in Editor but it exists in mission.sqm. This is implemented since Apex if I'm right. I don't know the exact reason, probably more consistent in case of error. So, in on activation field, I confirm, You don't need that.. Share this post Link to post Share on other sites
HazJ 1289 Posted April 1, 2018 5 hours ago, HazJ said: @XianGrim - Yeah, I guess. I was just making sure. Edit: Ah, he copied it from mission.sqm directly. @XianGrim class Attributes { init="call{0=[this] execVM ""recruitment_action.sqf""}"; }; @pierremgi - Yeah, already figured. Share this post Link to post Share on other sites
Harzach 2518 Posted April 1, 2018 It's not an accusation. They are just trying to figure out why the call and other unnecessary formatting is there. And I'll point out that the code is absolutely copied from a mission.sqm, just not by you. 1 Share this post Link to post Share on other sites