Jump to content

heros

Member
  • Content Count

    72
  • Joined

  • Last visited

  • Medals

Posts posted by heros


  1. Hello,

     

    File: ... \ Heros World \ Her_Survive.sqf


    Objects: If an object is not clearly defined in a 'Config', then the name of the 3D model must be described in a Lister.

    Example: Object = 'CUP_sink'. Here the name 'sink' must be entered in the array (Her_L_WellList). Model = sink.p3d

    Gasoline / Diesel: Great apology.
    The 'Her_L_GasList' array has been changed.
    The parameters are redefined. I forgot to describe it. Sorry.
    Array 'Her_L_GasList':
    // --- >>
    // --- >> ------------------------------------------- ----------------------------
    // --- >>
    // --- >>
    // --- >> List of objects to refill a canister of disel / petrol
    // --- >>
    // --- >> No gas to object = 'object setVariable ["Her_L_NoGas", true];'
    // --- >>
    //                                                                      (4) Maximum distance from the vehicle/object for refueling canister.
    //                                                                      |     (6) Refill canister with diesel (0 = no / 1 = yes)
    //                                                                      |     |   (7) Refill canister with petrol (0 = no / 1 = yes)
    //                                                                      |     |   |
    Her_L_GasList = [
       [ "Land_fuelstation_w"                    ,0,0,0,6,0,1,1]
       [ "Land_FuelStation_01_pump_F" ,0,0,0,6,0,1,1]
       [ "Land_FuelStation_Feed_F"         ,0,0,0,6,0,1,1]
       [ "Land_RailwayCar_01_tank_F"    ,0,0,0,6,0,1,1]
    ];

    • Like 2
    • Thanks 1

  2. @tourist
    OK. There was a little problem.
    I installed and tested the 'Ravage-Mod'.
    The items are defined as magazines in Ravage-Mod.
    Here is the new 'eat_custom_food.sqf'. I tested the file like this.

    ----------
    if (!hasInterface) exitWith {};

    private ["_Item","_Remove","_WithCanOpener","_Objects","_HasCanOpener","_UpHunger","_UpThirst","_UseTime","_UseSound","_ObjeName","_Txt"];

    _Item = _this select 0;                // Used food
    _Remove = _this select 1;            // Remove after use?
    _WithCanOpener = _this select 2;    // With can opener?

    _HasCanOpener=false;                // No can opener

    // Check if the player has a can opener
    _Objects = items player;            // All items of the player
    if ("herl_copener" in _Objects) then {_HasCanOpener=true;};
    if ("herl_u_Knife" in _Objects) then {_HasCanOpener=true;};
    _Objects = magazines player;            // All items of the player
    if ("rvg_canOpener" in _Objects) then {_HasCanOpener=true;};

    if (!_HasCanOpener && _WithCanOpener) exitWith {
        hint format ["Out\n%1\n%2\n\n%3",_HasCanOpener,_WithCanOpener,_Objects]
    };    // Leave script if a can opener is needed but not available

    // Use food
    _UpHunger = 0;                        // Values to increase hunger
    _UpThirst = 0;                        // Values to increase thirst
    _UseTime = 10;                        // Time required for food / drink
    _UseSound = ["",0,0,0];                // Sound (Sound Parameters:  ->  Category: Scripting Commands Arma 3)

    // Check item and adjust parameters
    switch (_Item) do {
        case "rvg_beans":    {_UpHunger=15; _UpThirst=0; _UseTime = 12; _UseSound = ["her_a3w_survive\Sound\EatA.ogg",8,1,10];};
    };

    _ObjeName = getText (configFile >> "CfgWeapons" >> _Item >> "displayName");        // Name of the food
    if (format ["%1",_ObjeName] == "") then {
        _ObjeName = getText (configFile >> "CfgMagazines" >> _Item >> "displayName");
    };

    // Text to display
    _Txt = "";
    if (_UpHunger > 0) then {
        _Txt = format ["%1 %2",localize "STR_Her_Modul_Survive_DoEat",_ObjeName];
    } else {
        _Txt = format ["%1 %2",localize "STR_Her_Modul_Survive_DoDrink",_ObjeName];
    };

    // Sound play when indicated
    if (format ["%1",_UseSound select 0] != "") then {
        playSound3D [_UseSound select 0, player, false, getPosASL player, _UseSound select 1, _UseSound select 2, _UseSound select 3];
    };

    // Progressbar
    Her_L_Progress=0;
    if (_UseTime > 0) then {
        Her_L_Progress=0;
        if (isClass(configFile >> "CfgPatches" >> "ace_main")) then {
            // Use ACE
            [_UseTime, [], {Her_L_Progress=1}, {Her_L_Progress=2}, _Txt] call ace_common_fnc_progressBar;
        } else {
            // Without using ACE
            hintSilent format ["%1", _Txt];
            [_UseTime] call Her_Fnc_ProgressBar;
        };
        waitUntil {Her_L_Progress != 0};
    };

    // Check the returned parameter (1 = successful / 2 = canceled)
    if (Her_L_Progress != 1) exitWith {};    // Leave script if not successful

    // Remove item?
    if (_Remove) then {
        player removeItem _Item;
    };

    // Adjust parameters for hunger
    if ((Her_L_Hunger + _UpHunger) > 100) then {
        Her_L_Hunger = 100;
    } else {
        Her_L_Hunger = Her_L_Hunger + _UpHunger;
    };

    // Adjust parameters for thirst
    if ((Her_L_Thirst + _UpThirst) > 100) then {
        Her_L_Thirst = 100;
    } else {
        Her_L_Thirst = Her_L_Thirst + _UpThirst;
    };

    ----------

    • Like 1

  3. Hello
    here's an example

     

    File: Her_Survive_UseItems.sqf
    case "rvg_beans":                {nul=[_Item,true,true] execVM "use\eat_custom_food.sqf";};

     

    File: use\eat_custom_food.sqf

     

    ------ This file can now be used for all foreign food. (I did not test it) --

     

    if (!hasInterface) exitWith {};

    private ["_Item","_Remove","_WithCanOpener","_Objects","_HasCanOpener","_UpHunger","_UpThirst","_UseTime","_UseSound","_ObjeName","Txt"];

    _Item = _this select 0;                // Used food
    _Remove = _this select 1;            // Remove after use?
    _WithCanOpener = _this select 2;    // With can opener?

     

    _Objects = items player;            // All items of the player

    _HasCanOpener=false;                // No can opener

     

    // Check if the player has a can opener
    if ("herl_copener" in _Objects) then {_HasCanOpener=true;};
    if ("herl_u_Knife" in _Objects) then {_HasCanOpener=true;};


    if ((!_HasCanOpener) && _WithCanOpener) exitWith {};    // Leave script if a can opener is needed but not available

     

    // Use food
    _UpHunger = 0;                        // Values to increase hunger
    _UpThirst = 0;                        // Values to increase thirst
    _UseTime = 10;                        // Time required for food / drink
    _UseSound = ["",0,0,0];                // Sound (Sound Parameters:  ->  Category: Scripting Commands Arma 3)

     

    // Check item and adjust parameters
    switch (_Item) do {
        case "rvg_beans":    {_UpHunger=15; _UseTime = 12; _UseSound = ["her_a3w_survive\Sound\EatA.ogg",8,1,10];};
    };

    _ObjeName = getText (configFile >> "CfgWeapons" >> _Item >> "displayName");        // Name of the food

     

    // Text to display
    _Txt = "";
    if (_UpHunger > 0) then {
        _Txt = format ["%1 %2",localize "STR_Her_Modul_Survive_DoEat",_ObjeName];
    } else {
        _Txt = format ["%1 %2",localize "STR_Her_Modul_Survive_DoDrink",_ObjeName];
    };

     

    // Sound play when indicated
    if (format ["%1",_UseSound select 0] != "") then {
        playSound3D [_UseSound select 0, player, false, getPosASL player, _UseSound select 1, _UseSound select 2, _UseSound select 3];
    };

     

    // Progressbar
    Her_L_Progress=0;
    if (_UseTime > 0) then {
        Her_L_Progress=0;
        if (isClass(configFile >> "CfgPatches" >> "ace_main")) then {
            // Use ACE
            [_UseTime, [], {Her_L_Progress=1}, {Her_L_Progress=2}, _Txt] call ace_common_fnc_progressBar;
        } else {
            // Without using ACE
            hintSilent format ["%1", _Txt];
            [_UseTime] call Her_Fnc_ProgressBar;
        };
        waitUntil {Her_L_Progress != 0};
    };

    // Check the returned parameter (1 = successful / 2 = canceled)
    if (Her_L_Progress != 1) exitWith {};    // Leave script if not successful

     

    // Remove item?
    if (_Remove) then {
        player removeItem _Item;
    };

     

    // Adjust parameters for hunger
    if ((Her_L_Hunger + _UpHunger) > 100) then {
        Her_L_Hunger = 100;
    } else {
        Her_L_Hunger = Her_L_Hunger + _UpHunger;
    };

     

    // Adjust parameters for thirst
    if ((Her_L_Thirst + _UpThirst) > 100) then {
        Her_L_Thirst = 100;
    } else {
        Her_L_Thirst = Her_L_Thirst + _UpThirst;
    };

    ------

     

     

    Sounds in Heros-Survive:

    her_a3w_survive\Sound\EatA.ogg
    her_a3w_survive\Sound\EatB.ogg
    her_a3w_survive\Sound\DrinkA.ogg

     

    • Thanks 1

  4. Hello. I have not been online for some time.


    @ katane

    BUYSELL system: This will not be adjusted. It is an example at this stage.


    @ tourist

    Any object recognized by this addon can also be defined. (See and test example mission. Exactly: ... \ HerosWorld \ Her_Survive_UseItems.sqf). Programming skills are required for this. I can not evaluate all possible possibilities.
    To update hunger, thirst ... see the readme.txt. At the end of the file are the parameters that can be customized locally (client).

     

    @Crielaard

    Each icon can be hidden. Then there is no function available. (See and test sample mission)

    • Like 1

  5. @hcpookie
    Fishing is not possible. Animals can be hunted and slaughtered. The meat must be grilled.
    Animals from another addon: See the parameter 'Her_L_AnimalCutList' (File: ...\HerosWorld\Her_Survive.sqf). Requires the classame and the amount of meat.

    You need a knife in your equipment. If you shot an animal, you can slaughter it with the knife.

    • Like 1

  6. Update

     

    Version 3.0 (02.10.2017)

    IMPROVED:   - Solar and climatological functions
                              This only worked with the current day temperature.
                              With a new setting, the temperature can be recalculated with the height position of the player.
                            - Effect when hunger or thirst less than 10.

    • Like 5

  7. @ katipo66: Yes. That is correct. I've tried to adjust it.
    @ Realthinged: How does it work with RHS or CUP? If I use CUP it works with me. In all buildings that have a house position. (Must be present in the building model). However, not all buildings have a house position.
    @ tourist: The integration of the functions is correct and works. In the new version, 3.0, the height position of the player can now also be calculated. This was not so before. (2.9)

     

    Info:
    Her_L_HouseClassListMain = []; // Empty array
    All buildings with a house position are considered. I use it just like that.

    • Like 3

  8. @ sonsalt6: Thank you
    @ foxhound: Thank you
    @ hotzenplotz: Even old bag ... But you're right. At our age you may forget something.
    @ lv1234: I'm sorry. Yes, some missions will not work properly. The missions may be adjusted. I dont know. There will be no regression from my side.
    @ tourist: 1. Hm ... I believe there is no website where such data are provided. You can create this data yourself. See the statement of the 'Climate-Script'.
    @ tourist: 2. 'Body Temperature' in the RAVAGE mod. Ask 'haleks' if he incorporates such a thing. It makes no sense to use a mod like 'Heros-Survive' for this one function. (My opinion)
    @ Realthinged: I do not know exactly 'RHS', 'NiArsenal'. 'CUP' is known to me and I use it sometimes. I will take a look at it.
    @ iV - Ghost: Yes. Thats how it works.
    @ SnakeDocc: Just this one script from a complete mod? It makes no sense to load this mod. Write your own little script. There are some templates.


  9. Update

     

    Version 2.9 (24.09.2017)

    ADDED:      -
    Script for fuel consumption. See example mission.

                - New calculation of the daily temperature. (Solar and climatological functions)

                   - The functions of Matthijs are required for the calculation.

                   - https://forums.bistudio.com/forums/topic/188051-solar-and-climatological-functions/#entry2980227

                   - If this option is selected, the original functions of the script are required by Matthijs.

    IMPROVED:   - The GUI to buy and sell items.

    • Like 5

  10. License: Of course, the addon can be used normally. Noncommercial.


    Parameters: These parameters are globally readable and writable on the client. Thus, this data can be adapted to any situation. Normally, none of these parameters need to be adjusted.

    Set parameters on the client: Example:
    Her_L_Thirst = 100; // No thirst
    Her_L_FieberRyanZombies = true; // Player was injured by a zombie

    ( Readable: _Thirst = Her_L_Thirst)


    Zombie and Demons (Only for "Ryanzombies"): Internal settings for this addon. If the parameter = 'Yes' then violations will be processed by this addon and only the remedies contained in the addon will help.

    • Like 1

  11. Update

     

    Version 2.8 (01.05.2017)

    ADDED:      -
    The saw can now be used. See example mission.

                - Parameters 'Her_L_UseSaw'. Objects that can be sawn.

                - Parameters 'Her_L_UseSawOk'. After using the saw: true = has sawn / false = has not sawn. See example mission.

    FIXED:      - Animation when filling canisters.
    IMPROVED:   -

    • Like 3

  12. Update

     

    Version 2.7 (09.04.2017)

    ADDED:      - A filled water bottle is placed in the old slot of the empty bottle.

                - Water from a river, pond or the sea is now dirty water.

                - New items: See '_ClassList.txt'.

    FIXED:      - Only people who have a lighter or matches can create a camping fire.
    IMPROVED:   -

    • Like 1

  13. Update

     

    Version 2.5 (12.03.2017)

    ADDED:      - New Items: See '_ClassList.txt'
                - All objects can be userd in the 3d editor.

    FIXED:      - Other player can now be cured.

                - Fixed errors when using items. (Toolbox S)

                - Fill empty water bottles / water canisters

                  Objects on an island have not been detected. Unfortunatly the variable 'Her_L_WellList' has to be adapted. See example mission.
    IMPROVED:   -

    • Like 2

  14. Update

     

    Version 2.4 (04.01.2016)

    ADDED:         - Parameters 'Her_L_GasList'. On these objects, gasoline or diesel can be filled into a canister. (See example mission)
    FIXED:           - Fixed errors when using items. (Gasoline canister)
                          - Masse kleinerer Gegenstände angepasst
                          - Mass of smaller items
    IMPROVED:   - Antivirus pills and vitamine pills only take effect after one minute. The respective injection acts immediately.

    • Like 2
×