Jump to content

hydrobull3t

Member
  • Content Count

    167
  • Joined

  • Last visited

  • Medals

Posts posted by hydrobull3t


  1. Hello guys!

    Not long ago I had posted a topic with a problem in my loadout.

    I have tried long ago to fix it, but I forgot all of the scripting I have learned so there wasn't much to do...

     

    Unit today I had tried again as I am currently in a vacation from my military services (got injured).

    Well, I figured out that the loadout script and everything is ok, but the problem is much more small than I thought it is.

    I am using Mission Parameters to choose between Night or Day loadout, Add or Remove NVG according to mission time, as well as Silencer and Map Nav Aids.

     

    As the updates started to come the code was outdated, But I have tried couple of time to fix it with no luck..

    If someone done it or Know how to fix it, Please reply here, As I want to regroup my old friends to start play again in this awesome MilSim.

     

    Loadout

    Description

    RPT Log

    fn_processParamsArray

     

    Huge Thanks Guys!!!

     


  2. 45 minutes ago, Tajin said:

     

    By breaking the unit-names appart.

     

    This:

    "Bravo_EOD_3"

     

    gets split into

    "Bravo"

    "EOD"

    "3"

     

    The middle part of it is then used as function name, resulting in this "FNC_EOD".

    The function then gets fetched from missionNamespace and called. (if the function doesn't exist, it'll run a default function instead, which in my case simply logs an error)

     

    So its just a question of naming your units correctly.

    Hello again,

    I have tried your suggestion without luck :(


  3. 12 minutes ago, Tajin said:

     

    By breaking the unit-names appart.

     

    This:

    "Bravo_EOD_3"

     

    gets split into

    "Bravo"

    "EOD"

    "3"

     

    The middle part of it is then used as function name, resulting in this "FNC_EOD".

    The function then gets fetched from missionNamespace and called. (if the function doesn't exist, it'll run a default function instead, which in my case simply logs an error)

     

    So its just a question of naming your units correctly.

    Thanks again for the help,

     

    So as I understand,

     

    1. Edit the client.sqf with the script you have added

    2. the loadout_bluefor.sqf is ok, so no need to touch

    3. rename in game the var name of each character to something else but that will include the name after FNC_X.. for example. 

    Loadout_bluefor.sqf has FNC_SL

    So i rename in game the character to Command_SL_1?

    • Like 1

  4. 21 minutes ago, belbo said:

    No. These are the calls for the scripts that YOU posted. Why... what... why would you even put it in there AFTER I explained that you screw up your whole syntax when you put random code into a switch?

     

    You first call loadouts_blufor.sqf -> There you define the fnc_XYZ-variables as your loadouts.

    Then you call your client.sqf -> The one with the switch that calls the fnc_XYZ-codes depending on str player.

    You put that in your initPlayerLocal.sqf:

    [] call compile preprocessFileLineNumbers "f\gear_setup\loadouts_bluefor.sqf";

    [] call compile preprocessFileLineNumbers "f\gear_setup\client.sqf";

     

    The first one is https://pastebin.com/YfS7ZbTv

    and the second one is https://pastebin.com/MjjhvDBm, provided you fix it according to either Tajin's suggestion or mine.

    Thank you for your reply, Sorry for my mistakes..

     

    So as I understand.

    1. need to create initPlayerLocal.sqf in root mission file, and put 

    [] call compile preprocessFileLineNumbers "f\gear_setup\loadouts_bluefor.sqf";

    [] call compile preprocessFileLineNumbers "f\gear_setup\client.sqf";

    in it.

     

    2. loadout_bluefor.sqf, rename each role to something like Command_SL_1

     

    3. Fix the client.sqf with 

    switch (faction player) do {
    	case "OPF_F": { };
    	case "BLUF_F": {
    		switch (str player) do {
    			case "Command_SL_1": { [player] call fnc_sl };
    			case "Alpha_SL_1": { [player] call fnc_sl };
    			case "Bravo_SL_1": { [player] call fnc_sl };
    			default { [player] call fnc_op };
    		};
    	};
    	default {};
    };

    and continue to add the names of the Roles and The variables names. 


  5. 7 minutes ago, belbo said:

    You have to define your fnc_whatever variables before executing the switch that calls these variables of course.

    
    [] call compile preprocessFileLineNumbers "scripts\loadouts.sqf";
    [] call compile preprocessFileLineNumbers "scripts\client.sqf";

     

    So something Like that?

    /*scripts\client.sqf*/
    
    if !(isDedicated) then {
    diag_log format ["client :1"];
      waitUntil { !IsNull Player };
          if (local player) then {
            
            waitUntil { time > 1 };
            
            // Factions
        diag_log format ["client :%1 %2", faction player, time];
            switch (faction player) do {
    	case "OPF_F": { };
    	case "BLUF_F": {
    		switch (str player) do {
    			case "MHQ_Commander": { [player] call fnc_sl };
    			case "MHQ_Medic": { [player] call fnc_med };
    			case "MHQ_UAVO": { [player] call fnc_uavo };
    			default { [player] call fnc_op };
    		};
            [] call compile preprocessFileLineNumbers "f\gear_setup\loadouts_bluefor.sqf";
            [] call compile preprocessFileLineNumbers "f\gear_setup\client.sqf";
    	};
    	default {};
    };

     


  6. 1 minute ago, Tajin said:

    Don't mix two completely different scripts together.

    Especially not like that.

     

    What I posted was supposed to be the complete file. ;)

    Thanks for the reply,

    ohhh, I see..

    If I may ask, How is your script will know what to call?

    I need some sort of function that will order to get the loadout from like this: [] call compile preprocessFile "f\gear_setup\loadouts_bluefor.sqf";}; // Bluefor Set ?? 

    Or Im not getting it 0-0


  7. 13 minutes ago, belbo said:

    In that case you must have removed lines that were previously there.

    And with your current version you check for the player variable directly. That will go awry if not ALL of the listed players are present.

    You have to check for (str player) and then refer to the strings of the player units.

    The most simple way to apply your loadouts would be:

    Or you could even just use ["_SL", str player] call BIS_fnc_inString to create a case for all player units with _SL in their name:

     

    If I choose this (looks easier)

    Than how for example, the "case "MHQ_Commander": { [player] call fnc_sl };" will know what loadout to call?

    I need some sort of function that will order to get the loadout from like this: [] call compile preprocessFile "f\gear_setup\loadouts_bluefor.sqf";}; // Bluefor Set ??

    switch (faction player) do {
    	case "OPF_F": { };
    	case "BLUF_F": {
    		switch (str player) do {
    			case "MHQ_Commander": { [player] call fnc_sl };
    			case "MHQ_Medic": { [player] call fnc_med };
    			case "MHQ_UAVO": { [player] call fnc_uavo };
    			default { [player] call fnc_op };
    		};
    	};
    	default {};
    };

  8. 3 minutes ago, belbo said:

    In that case you must have removed lines that were previously there.

    And with your current version you check for the player variable directly. That will go awry if not ALL of the listed players are present.

    You have to check for (str player) and then refer to the strings of the player units.

    Thanks for the reply,

    I left it while it worked (year ago) and didn't touched it...

    Can you show me please example of 

     (str player)

    As im trying to figure things on the go (I don't remember lot of stuff)


  9. 31 minutes ago, Tajin said:

    Here is an example:

    
    /*scripts\client.sqf*/
    
    if !(isDedicated) then {
        diag_log format ["client :1"];
        waitUntil { !IsNull Player };
        if (local player) then {
            waitUntil { time > 1 };
            
            // Factions
            diag_log format ["client :%1 %2", faction player, time];
            _name = vehicleVarName player;
            _arr = _name splitString "_";
            _arr params ["_group","_class","_num"];
    
            [player] call (missionNamespace getVariable [format["FNC_%1",_class],{
                diag_log format ["%1 - %2 : Loadout not found", player, vehicleVarName player];
            }]);
        };
    };

     

    This would just require you to name your units in a certain way, so that the name of the loadout is included in the unitname.

    Like this (note the underscores):

     

    Bravo_EOD_1
    Bravo_EOD_2
    Bravo_EOD_3

    Charlie_SNIP_1
    Charlie_OP_1

     

    The second part of the name has to match the names of your loadout-functions. Simple as that.

     

     

     

     

    Changed the script to this:

    /*scripts\client.sqf*/
    
    if !(isDedicated) then {
        diag_log format ["client :1"];
        waitUntil { !IsNull Player };
        if (local player) then {
            waitUntil { time > 1 };
    		
    		// Factions
    	    diag_log format ["client :%1 %2", faction player, time];
            _name = vehicleVarName player;
            _arr = _name splitString "_";
            _arr params ["_group","_class","_num"];
    
    
            [player] call (missionNamespace getVariable [format["FNC_%1",_class],{
                diag_log format ["%1 - %2 : Loadout not found", player, vehicleVarName player];
    		}]);
    
                case MHQ_Commander: {[MHQ_Commander] call FNC_SL;};
                case MHQ_Medic: {[MHQ_Medic] call FNC_MED;};
                case MHQ_UAVO: {[MHQ_UAVO] call FNC_UAVO;};
    			case MHQ_Engineer: {[MHQ_Engineer] call FNC_EOD;};
    
    			case Alpha_SL: {[Alpha_SL] call FNC_SL;};
    			case Alpha_TL: {[Alpha_TL] call FNC_TL;};
                case Alpha_Marksman: {[Alpha_Marksman] call FNC_MARK;};
    			case Alpha_EOD: {[Alpha_EOD] call FNC_EOD;};
    			case Alpha_Medic: {[Alpha_Medic] call FNC_MED;};
    			case Alpha_AT: {[Alpha_AT] call FNC_AT;};
                case Alpha_AR: {[Alpha_AR] call FNC_AR;};
    			case Alpha_Operator: {[Alpha_Operator] call FNC_OP;};
    
    			case Bravo_SL: {[Bravo_SL] call FNC_SL;};
    			case Bravo_TL: {[Bravo_TL] call FNC_TL;};
                case Bravo_Marksman: {[Bravo_Marksman] call FNC_MARK;};
    			case Bravo_EOD: {[Bravo_EOD] call FNC_EOD;};
    			case Bravo_Medic: {[Bravo_Medic] call FNC_MED;};
    			case Bravo_AT: {[Bravo_AT] call FNC_AT;};
                case Bravo_AR: {[Bravo_AR] call FNC_AR;};
    			case Bravo_Operator: {[Bravo_Operator] call FNC_OP;};
    
                case Charlie_Sniper: {[Charlie_Sniper] call FNC_SNIP;};
    			case Charlie_Spotter: {[Charlie_Spotter] call FNC_SPOT;};
                case Charlie_Operator: {[Charlie_Operator] call FNC_OP;};
    			case Charlie_Sniper1: {[Charlie_Sniper1] call FNC_SNIP;};
    			case Charlie_Spotter1: {[Charlie_Spotter1] call FNC_SPOT;};
    			case Charlie_Operator1: {[Charlie_Operator1] call FNC_OP;};
    
    			case AF_Pilot: {[AF_Pilot] call FNC_AFP;};
    			case AF_Pilot1: {[AF_Pilot1] call FNC_AFP;};
                case AF_Pilot2: {[AF_Pilot2] call FNC_AFP;};
    			case AF_TL: {[AF_TL] call FNC_AFTL;};
    			case AF_JTAC: {[AF_JTAC] call FNC_AFJ;};
    			case AF_Medic: {[AF_Medic] call FNC_AFMED;};
    
                };
           };
    
    };  

    Thank you for your reply!

    And to check for example the MHQ Commander: I have assigned him the FNC_SL and as in the loadout file.

    Also named him in game as MHQ_Commander.. Still not working..


  10. 11 minutes ago, Tajin said:

    Depends on how you want to define what unit gets which loadout and there are a lot of ways how that can be done.

     

    - You could place area markers for each loadout and use a script that applies loadouts depending on what marker a unit is in.

     

    - You could sync them to triggers.

     

    - You could use tags in the names of each unit and detect these.

     

    - You could have seperate arrays for each type of loadout and simply add the unit-names to these arrays.

     

    - You could assign loadouts based on the classnames of units.

     

    - You could use the roleDescription and insert the name of the loadout there.

     

    - ....

     

     

    and probably some other creative ways that I forgot

    Thank you for your reply.

    Its really funny and true, if you didn't practice in something for long time, you forget it although you really like it.

    Unfortunately I don't remember how to do all of that stuff.. Perhaps Ill wait to BI Wiki to come back, and try to google your suggestion.


  11. 8 minutes ago, Tajin said:

    It seems like your script will not work if any of the classes you've defined are not existant in the mission (due to the way the switch is set up).

     

    Checking the vehiclevarnames instead of the actual objects should help to avoid that.

    
    /*scripts\client.sqf*/
    
    if !(isDedicated) then {
    diag_log format ["client :1"];
      waitUntil { !IsNull Player };
          if (local player) then {
            
            waitUntil { time > 1 };
            
            // Factions
        diag_log format ["client :%1 %2", faction player, time];
            switch (faction player) do {
                   case "BLU_F":
                   {
                   [] call compile preprocessFile "f\gear_setup\loadouts_bluefor.sqf";}; // Bluefor Set
                  };
    
                switch (vehicleVarName player) do {
    
                case "MHQ_Commander": {[player] call FNC_SL;};
                case "MHQ_Medic": {[player] call FNC_MED;};
                case "MHQ_UAVO": {[player] call FNC_UAVO;};
                case "MHQ_Engineer": {[player] call FNC_EOD;};
    
                case "Alpha_SL": {[player] call FNC_SL;};
                case "Alpha_TL": {[player] call FNC_TL;};
                case "Alpha_Marksman": {[player] call FNC_MARK;};
                case "Alpha_EOD": {[player] call FNC_EOD;};
                case "Alpha_Medic": {[player] call FNC_MED;};
                case "Alpha_AT": {[player] call FNC_AT;};
                case "Alpha_AR": {[player] call FNC_AR;};
                case "Alpha_Operator": {[player] call FNC_OP;};
    
                case "Bravo_SL": {[player] call FNC_SL;};
                case "Bravo_TL": {[player] call FNC_TL;};
                case "Bravo_Marksman": {[player] call FNC_MARK;};
                case "Bravo_EOD": {[player] call FNC_EOD;};
                case "Bravo_Medic": {[player] call FNC_MED;};
                case "Bravo_AT": {[player] call FNC_AT;};
                case "Bravo_AR": {[player] call FNC_AR;};
                case "Bravo_Operator": {[player] call FNC_OP;};
    
                case "Charlie_Sniper": {[player] call FNC_SNIP;};
                case "Charlie_Spotter": {[player] call FNC_SPOT;};
                case "Charlie_Operator": {[player] call FNC_OP;};
                case "Charlie_Sniper1": {[player] call FNC_SNIP;};
                case "Charlie_Spotter1": {[player] call FNC_SPOT;};
                case "Charlie_Operator1": {[player] call FNC_OP;};
    
                case "AF_Pilot": {[player] call FNC_AFP;};
                case "AF_Pilot1": {[player] call FNC_AFP;};
                case "AF_Pilot2": {[player] call FNC_AFP;};
                case "AF_TL": {[player] call FNC_AFTL;};
                case "AF_JTAC": {[player] call FNC_AFJ;};
                case "AF_Medic": {[player] call FNC_AFMED;};
    
                };
           };
    
    };

     

    Or just use a different setup with an array instead of a switch.

     

     

    First of all, Thank you very much for the help.

    Unfortunately, The suggestion with 

    (vehicleVarName player)

    Didn't Worked.

     

    Maybe its because the original code is outdated? (I haven't scripted for about Year).

    Also, I don't remember how the array setup needed to be done, And the BI Wiki is down for Maintenance :( :(.

     

    Do you have a suggestion?


  12. Hey Guys,

    First of all, Thank you for wasting time to read this issue, Im really appreciate your effort for trying to help me and to others.

     

    I am trying to create a template with a costume loadout, and I have encountered in issue.

    The loadout won't start, I have tried to fix it by myself, but I can't find the issue somewhy.

     

    I will Add to here the links for the Class define, Loadout Script, And RPT Log.

    (I know I can make it simple through EDEN. But I want to add some functions like Parameters to the Loadout.)

     

    RPT LogClass

    Define / Clients
    Loadout Script

    Thank You! 


  13. Hello There,

     

    Im trying to create Load out Template for my unit for the missions.

     

    1. Different Camo for Different Map

    2. Different Camo For Different Mission Time (For example: 01:00AM - Black Camo)

    3. Clean and understandable

    4. TF-Radio, RHS, , Alive, ACE are obviously Used.

    5. also include > Uniforms, Rifles, Items and accessories, ACE items and so on.

     

    *** I remember that the ^ *2nd* sentence ^ can be used with defined parameters, **example: choose yes to deploy with night load out (in the param dialog).**

     

    Can someone explain me how it is could be done?

     

    Sincerely,

    HydroBull3T.


  14. don't think so, once you can access it remotely so you can administer the repo. Just make sure you have FTP or HTTP access to the specific share and it's set up for public anonymous usage. Lock down (read only)  that one directory the repo is in so no one but you can make changes to it. 

     

    When i first did it, this was a mistake i made and within days some F**k-knuckle had uploaded a virus which was being propagated out when players downloaded the repo. 

     

    Gav

    Ohh so in conclusion:

    1. Upload desired mods and userconfig to public ftp folder with read only.

    2. Connect the arma3sync with that folder

    3. Build the repo

    4. Paste the autoconfig among my guys.

    Thats right or i need to do something more?


  15. Really you could probably do it on either. A server is a server, it has a hard drive and a networking card and a CPU/mobo/ram then it can act as an FTP server as well. You'll need to throw whatever arma3 sync uses for FTP on the server then run it and you should be able to connect with a client.

     

    This is assuming you have full remote control over the servers in question. If its a GSP with a web UI then you'll need to go through them to get anything like this set up.

     

     

    Yes your mods need to be on there, otherwise how does the server know what files to send and what the contents of said files are?

    Do i need to install arma3sync on the server?

  16. Try this thread: https://forums.bistudio.com/topic/152942-arma3sync-launcher-and-addons-synchronization-software-for-arma-3/

    There's instructions in the wiki and ppl to ask there if there still are questions after reading it.1

    1 question,

     

    Should I do all the stuff on my website host or server host? both unlimited space (don't ask, got really lucky)..

    And do I need to upload the mods where my repo will be?

×