DiaZ35 4 Posted December 12, 2020 I ran into a problem where the missions don't even start. https://imgur.com/a/pCDrAJ9 This is what this code looks like for me. https://imgur.com/a/xZJVbyz Do you know the solution to this problem? Edit1. The translation of "Error Niepoprawna liczba w wyra eniu" is "Error Invalid number in expression" Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 27 minutes ago, DiaZ35 said: I ran into a problem where the missions don't even start. https://imgur.com/a/pCDrAJ9 This is what this code looks like for me. https://imgur.com/a/xZJVbyz Do you know the solution to this problem? Edit1. The translation of "Error Niepoprawna liczba w wyra eniu" is "Error Invalid number in expression" hard to say what's the problem but the params is grayed out, something wrong there... you can also post code in pastebin.com Share this post Link to post Share on other sites
DiaZ35 4 Posted December 12, 2020 Look https://pastebin.com/prsX6G2c Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 3 minutes ago, DiaZ35 said: Look https://pastebin.com/prsX6G2c are you running that script on dedi? is HG_fnc_addOrSubCash defined? Share this post Link to post Share on other sites
DiaZ35 4 Posted December 12, 2020 2 minutes ago, gc8 said: are you running that script on dedi? Im runing this scirpt on the host. 2 minutes ago, gc8 said: is HG_fnc_addOrSubCash defined? I guess so Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 Just now, DiaZ35 said: Im runing this scirpt on the host. I guess so you can comment out / remove the globalchat line, that was just for debugging that line wouldn't work on dedicated server Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 you can put HG_fnc_addOrSubCash in console to see if it's defined Share this post Link to post Share on other sites
DiaZ35 4 Posted December 12, 2020 I found this on script wiki Quote Add or sub cash Case #1 - Local execution [500,0] call HG_fnc_addOrSubCash; // Add 500 to cash [500,1] call HG_fnc_addOrSubCash; // Sub 500 from cash [500,0,1] call HG_fnc_addOrSubCash; // Add 500 to bank [500,1,1] call HG_fnc_addOrSubCash; // Sub 500 from bank Case #2 - Remote execution (_unit refers to a player) [500,0] remoteExecCall ["HG_fnc_addOrSubCash",_unit,false]; // Add 500 to cash [500,1] remoteExecCall ["HG_fnc_addOrSubCash",_unit,false]; // Sub 500 from cash [500,0,1] remoteExecCall ["HG_fnc_addOrSubCash",_unit,false]; // Add 500 to bank [500,1,1] remoteExecCall ["HG_fnc_addOrSubCash",_unit,false]; // Sub 500 from bank But _unit and _completers doesn't work Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 12 minutes ago, DiaZ35 said: I found this on script wiki But _unit and _completers doesn't work can I get the link? Share this post Link to post Share on other sites
DiaZ35 4 Posted December 12, 2020 https://github.com/Ppgtjmad/SimpleShops/wiki/Useful-Functions Share this post Link to post Share on other sites
gc8 977 Posted December 12, 2020 Ok This script should send the money to the player. it should be run from server // modify this function for reward on completing mission onSideMissionComplete = { params ["_misConf","_reward","_completers","_helpers"]; { // give money/XP to _x (player) _unit = _x; [500,0] remoteExecCall ["HG_fnc_addOrSubCash",_unit,false]; // Add 500 to cash [500,0] remoteExecCall ["HG_fnc_addOrSubXP",_unit,false]; // XP } foreach _completers; }; 1 Share this post Link to post Share on other sites
DiaZ35 4 Posted December 12, 2020 Thanks a lot, I will test and tell if it works Share this post Link to post Share on other sites
DiaZ35 4 Posted December 13, 2020 Unfortunately it does not work ;c Share this post Link to post Share on other sites
gc8 977 Posted December 14, 2020 9 hours ago, DiaZ35 said: Unfortunately it does not work ;c well you need to check if the HG_fnc_addOrSubCash function is defined/exists . this function is coming from some code library so those files need to be loaded Edit: The code works for me but I don't have the HG_fnc_addOrSubCash etc functions so I commented those lines out and it works Share this post Link to post Share on other sites
DiaZ35 4 Posted December 20, 2020 I found a working bounty hunt mission that gives money and exp, but I don't know how I can implement this function in your script. Can you help me with that? https://pastebin.com/A24iaQXz https://pastebin.com/yyJBRVLy Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 @DiaZ35 I can't see those scripts using my sideMissions script but someone else's code. The code uses function calls such as "BIS_fnc_taskCreate" which my sideMissions script also uses Share this post Link to post Share on other sites
DiaZ35 4 Posted December 20, 2020 Yes, this script doesn't use your side missions script and is made by someone else, but it does use HG_fnc_addOrSubCash; and HG_fnc_addOrSubXP; which actually work and give the player and his team money and exp, this is what I would like to achieve in your script, but I don't know how I could implement it for your script Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 13 minutes ago, DiaZ35 said: Yes, this script doesn't use your side missions script and is made by someone else, but it does use HG_fnc_addOrSubCash; and HG_fnc_addOrSubXP; which actually work and give the player and his team money and exp, this is what I would like to achieve in your script, but I don't know how I could implement it for your script Ok I updated the side mission scripts in case there was bug (same download: https://drive.google.com/file/d/1b9fYl8BA1gIQyfFPYvghQ5yNlFY2JH6C/view?usp=sharing) However the code In this post should work: https://forums.bohemia.net/forums/topic/227211-release-side-missions-script/?do=findComment&comment=3425408 Share this post Link to post Share on other sites
Jnr4817 215 Posted December 20, 2020 On 12/7/2020 at 8:38 AM, gc8 said: I uploaded new version where I have cleared the init.sqf from unnecessary code that I forgot there which probably just confused you To learn how to start the side missions look at this code in init.sqf: [getmarkerpos "misCap",west,"FreeCaptives"] call startSideMission; [getmarkerpos "misLaptop",west,"AccessComputer"] call startSideMission; [getmarkerpos "misRadar",west,"DestroyRadar"] call startSideMission; [getmarkerpos "tmis",west,"EliminateEnemy"] call startSideMission; [getmarkerpos "off",west,"CaptureOfficer"] call startSideMission; Those five lines create five missions for west side in the given marker position Where are you putting this code? In a mission file or in the editor? Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 19 minutes ago, Jnr4817 said: Where are you putting this code? In a mission file or in the editor? init.sqf , for example. that code starts 5 missions for west Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 @DiaZ35 make sure you have only one onSideMissionComplete defined and it's in misImplement.sqf Share this post Link to post Share on other sites
Jnr4817 215 Posted December 20, 2020 6 hours ago, gc8 said: init.sqf , for example. that code starts 5 missions for west Ok. I don’t need to place anything in the editor do I. Haven't been able to run mission yet. Share this post Link to post Share on other sites
gc8 977 Posted December 21, 2020 12 hours ago, Jnr4817 said: Ok. I don’t need to place anything in the editor do I. Haven't been able to run mission yet. no nothing needs to be placed in editor. Just look at init.sqf in the demo mission you downloaded, that's all the code to get the mission system running. Then in misImplement.sqf you can customize the functions there for your purposes Share this post Link to post Share on other sites
Jnr4817 215 Posted December 21, 2020 Getting this error. 14:24:08 Error in expression <rams ["_side","_pos"]; _pos distance2D heli < 5 }; [] spawn { while { true } > 14:24:08 Error position: <heli < 5 }; [] spawn { while { true } > 14:24:08 Error Undefined variable in expression: heli 14:24:08 File C:\Users\jnr48\Documents\Arma 3\mpmissions\H-60%20Side%20Missions.Malden\sideMissions\misImplement.sqf..., line 54 14:24:22 EPE manager release (0|16|0) Share this post Link to post Share on other sites
gc8 977 Posted December 22, 2020 @Jnr4817 The reason you get error is because the heli is not defined. you should check the misImplement.sqf file and make sure it only has code that works in your mission. In this case you need to modify the isBaseNear function so that the script knows where your base is and where the captives needs to be transported Share this post Link to post Share on other sites