Jump to content

iben

Member
  • Posts

    100
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by iben

  1. 2 hours ago, S4M said:

    If I tried to cut the grass but no, that grass does not go :biggrin::biggrin:

    Sometimes you need to use more then one cutter... but if it's not big deal, leave it... it's not worth to put extra objects...

  2. 17 minutes ago, juandayz said:

    @iben i dont know why, but i feel you gonna made awesome mods for all of us in a short time. and with the respect in which you talk with others....

    you  gonna be a great member here. hat off! for you mate.

    and are you sure youre not zupa with another nikname? :laugh:

    Oh mate, you are so kind to me... :) But there are two basic facts: 1) I wish I were, but I'm not zupa :)) 2) There are so many great and skilled guys like for example You, that brings us these great addons for long time! I'm thinking right now which way I could contribute to community right now... :) 

  3. 9 minutes ago, harcosgoogle said:

    It is activated but I can not see it

    I remember time I had similar problem... later I found out, I loaded script inside (!isDedicated) section in init... just in case... @harcosgoogle, make sure you loading file at very bottom of your init.sqf outside any (is...) section...

  4. 1 minute ago, S4M said:

    If it's true, I try to make it look pretty and sometimes I do not think about performance. I will try to make them lighter.

    yeah... I know this feeling when you're working in editor after couple ten hours... :))))) And I also now hot it hurts to remove something what tooks so long time to position correctly :)))

  5. 12 minutes ago, DAmNRelentless said:

     

    I like how it looks like except of all the spikes next to street. Keep your work up!

     

    And @S4M,

    I agree with @DAmNRelentless ... looks so great, but these dragon teeth are unneccessary IMO ... no function for them, just visual that cost a lot (remember, each object globally spawn counts to server performance...). Consider this again...

    Anyway, great work buddy!!!

  6. Hello mate,

    thx for this! :)

    If you want, I reworked zupas dev functions to fnc_SC_uniCoins for 1.0.6.1+. You can grab it from here, then use in your code:

    // @parameters:
    //   [_player,_amount,_action,_target] call fnc_SC_uniCoins;
    //   '_player' : object : player, _killer...etc
    //   '_amount' : number : 1000
    //   '_action' : string : 'add'   / 'remove'
    //   '_target' : string : 'cache' / 'bank'
    
    if (Z_SingleCurrency) then {
      if !([player,5000,'remove','cache'] call fnc_SC_uniCoins) then {... }; // or exitWith...
    };

    Cheers...

  7. 4 minutes ago, DuMa said:

     if you save a lot of variables it might cause some performance issues, and in this example we used only 1 variable we are just changing it continuously. And to be honest I haven't used this a lot.  But I did use this to save player's view distance. So they don't have to change it every time they die or relog. Also if you are really concerned about it, keep in mind the old Group System from 1.0.5.1 used this technic to save player group data. It's your choice as long as you don't offload all the variables to profile data then your fine. Also this might be unsafe to do it. Not sure. 

    Make sense to me... thx for your time. Cheers

  8. On 10. 5. 2017 at 2:43 PM, DuMa said:

    Here is an example, XP System I used to work on before.

    In init.sqf,

    I would do this.

    
    if (isNil{profileNamespace getVariable["PlayerXP",0]}) then {		//Player have not played atleast once in the server, So create a new data profile for him.
    	profileNamespace setVariable ["PlayerXP",0];	//Set PlayerXP = 0 in the proflename space since hes new.
    	saveProfileNamespace;	//Save PlayerXP = 0.
    	PlayerXP = profileNamespace getVariable ["PlayerXP",0];	//Set global Variable PlayerXP = 0 , so we dont have to use define the variable in each scripts.
    }else{
    	PlayerXP = profileNamespace getVariable ["PlayerXP",0];			//Player Is regular, so get data from the data profiel.
    };

    And to add and delete XP, I would do this in add_xp.sqf

    
    private ["_xptoadd"];
    _xptoadd = 5;
    
    profileNamespace setVariable["PlayerXP",(PlayerXP+_xptoadd)];	//Add 5 to PlayerXP
    
    saveProfileNamespace; 	//Save it again to the file.

     

    Really nice idea!

    Iit's file operation so it could be expensive. @DuMa, what's your experience with saving vars this way? Any problems or craching game?

     

     

     

  9. 6 minutes ago, Hooty said:

    Very nice!!! I know myself doing roads is a real pain. I dont like to download other map edits as i feel most are just thrown together. This one I can tell you put heart into it. I now have this running in my sever. Thanks for great ArmA 2 editor work. GREAT JOB 

    Hi Hooty,

    OMG, that's all S4M's work, all credits goes to him. He did all that hard work!

    I just optimized code and gave opportunity to change the way, how to load map (step by step is in spoiler in my post)...

    :))

    Cheers

  10. Hi S4M,
    thx for sharing... OMG, everyone who worked with Arma editor knows how much time it takes... well done!

    I was recently experimenting with some map optimization and because I used your map for tests, I can share my outputs with you:

    Here is your map, but reworked (link to gist): 14.380 lines of code reduced to 1.693 lines (same content of course).

    Here is reworked function (link to gist) for map loading based on original Epoch core function 'fnc_spawnObjects' -
     (I just added some stuff that I used - for example setVectorUp [0,0,1];, BUT - you can add whatever
      you need... is there problem with building or rock which you want to stay straight on? Find the class,
      and change first 'false' to 'true' - this will add setVectorUp into code...)

    To make this work see in spoiler if you want to...

    Cheers... keep doing such a good stuff!

     

     
    • create in 'dayz_server' custom folder for map addons: let's say 'map_addons',
    • inside this folder create file 'init.sqf' - place content:
    
    {
      call compile preprocessFileLineNumbers ("\z\addons\dayz_server\map_addons\" + _x + ".sqf");
    } forEach [
      "City_S4M" // + add all your extra addons here to array
    ];
    • grab function that I linked above and place it to custom compiles folder,
    • insert bellow (!isDedicated):
    
    fnc_spawnCustomMap = compile preprocessFileLineNumbers "DAYZ_CODE\compile\fnc_spawnCustomMap.sqf";
    • go to init, find section 'if (isServer)' and place as a first line:
    
    call compile preprocessFileLineNumbers "\z\addons\dayz_server\map_addons\init.sqf";
    • Done

    Try it... it worked very well for me :)

  11. On 3. 5. 2017 at 2:34 AM, Voltan said:

    @juandayz Thanks for sharing this script,I have adapted it for Sauerland, but I am having issues with DZAI patrolling helicopters attacking players and their vehicles inside a safe zone, sometimes resulting in people's vehicles being blown up if they aren't in it. Is there any way I can fix this? 

    Maybe if I can despawn Ai vehicles within a certain range from traders? Not sure best method for avoiding this problem?

    @Voltan ... as I remember, you can set blacklist area in your config. This prevents patrols attacking player at all. Default blacklist range around traders is 200m (I gues) which is not enough for heli patrols - you need adjust it.

  12. EDIT: Do not used code from this post, it's outdated. See dedicated thread with updates.

    ===

    Hello guys,
    first: @salival I'm regular visitor of this forum for almost a year and this is my very first post. I'd like to say... it's incredible how well you're doing with community support. Hat off!
    second: ...the same is valid of course for @juandayz, @theduke and many other awesome guys!

    Now, I'm studying new changes to epoch 1.0.6.1 and preparing some addon for fun. That's why i reworked a little bit former @zupas dev functions and want to share it here. Maybe it will be usefull for someone. It's tested and working but I have to admit - I haven't time to test it well! If there will be problem, I will adjust code or... someone will come with better version.
    All credits goes to @zupa and @salival.

    1. Check the code bellow: it's just one file. You can use it for adding/removing players coins to/from wallet/bank account.

    2. How to use it:

    •    in your custom compiles folder create file named 'fnc_SC_uniCoins.sqf';
    •    in your custom compiles file add following line: 'fnc_SC_uniCoins = compile preprocessFileLineNumbers "path\to\custom\compiles\fnc_SC_uniCoins.sqf"';
    •    in your code use: [_player,_amount,_action,_target] call fnc_SC_uniCoins;
    •    parameters are described in code bellow
    •    you can copy code or download from gist: here is the link

    3. How to test it:

    •    if you're working on some addon, you don't need my advice :)
    •    if you don't know how to test it, you can use my example created just for you:
      • Example scenario is just for test (but...)
      •  Scenario: Player is awarded for killing local zombies by coins (random amount from 0 to 250 Coins)
      •  Modelling:
        •  (1) Add money to wallet for kill
        •  (2) Remove money from wallet for kill
        •  (3) Add money to bank account for kill
        •  (4) Remove money from bank account for kill
      •  - for test we're using file from Epoch 'dayz_code\compiles' named 'local_eventKill.sqf'
      •  + original src: here is the link
      •  - repeate common workflow (custom compiles, variables...) + Read comments in code header!
      •  - again, you can copy code or download from gist: here is the link

    Again, thank you guys for your awesome work!!!
    cy, @iben

    PS: well, inserting snippets seems to be harder that I thought :) Sorry for merging two spoilers into one layer!

     
    
    // ===========================================================================
    // SINGLE CURRENCY (@money: universal dev function: add/remove cache/bank coins)
    // ===========================================================================
    // @credits:
    //   - DayZ Epoch developers, collaborators and contributors
    //     (thank you guys for your excellent work!)
    //   - @Zupa: original SC concept creator and author of Universal Dev functions
    //     for 1.0.5 version.
    //     (see https://epochmod.com/forum/topic/15463-devs-universal-removeadd-coins-function/)
    //   - @salival for adapting @Zupa's concept to 1.0.6+ version and great community support
    //     (see: https://epochmod.com/forum/topic/43331-zsc-for-epoch-106-and-overwatch-025/)
    // ===========================================================================
    // Reworked for DayZ Epoch 1.0.6.1+ by @iben+
    // ===========================================================================
    // @parameters:
    //   [_player,_amount,_action,_target] call fnc_SC_uniCoins;
    //   '_player' : object : player, _killer...etc
    //   '_amount' : number : 1000
    //   '_action' : string : 'add'   / 'remove'
    //   '_target' : string : 'cache' / 'bank'
    // @usage:
    //   === Example 01: Remove 5.000 Coins from player's wallet:
    //   [player,5000,'remove','cache'] call fnc_SC_uniCoins;
    //   === Example 02: Add 1.000 Coins to playe's bank account
    //   [player,1000,'add','bank'] call fnc_SC_uniCoins;
    // ===========================================================================
    //  @important:
    //   + DayZ Epoch 'local_eventKill.sqf' with code for testing is available:
    //     https://gist.github.com/infobeny/0fa8ff0f0a50ca7877a26e0951ac358e
    // ===========================================================================
    private ["_player","_amount","_action","_target","_gvar","_result",
             "_fnc_previewCoins","_fnc_removeCoins","_fnc_addCoins"];
    
    _player = _this select 0;
    _amount = _this select 1;
    _action = _this select 2;
    _target = _this select 3;
    
    _gvar = [Z_bankVariable, Z_moneyVariable] select (_target == "cache");
    _result = false;
    
    _fnc_previewCoins = {
      private ["_money"];
      _money = 0;
      _money = _player getVariable [_gvar, 0];
      _money
    };
    
    _fnc_removeCoins = {
      private ["_wealth","_removed"];
      _wealth = call _fnc_previewCoins;
      _removed = false;
      if (_amount > 0) then {
        if (_wealth < _amount) then {
          _removed = false;
        } else {
          _player setVariable [_gvar, _wealth - _amount, true];
          _removed = true;
          call player_forceSave;
        };
      } else {
        _removed = true;
      };
      _removed
    };
    
    _fnc_addCoins = {
      private ["_wealth","_added","_newWealth"];
      _wealth = call _fnc_previewCoins;
      _added = false;
      _player setVariable [_gvar, _wealth + _amount, true];
      call player_forceSave;
      _newWealth = call _fnc_previewCoins;
      if (_newWealth >= _wealth) then {_added = true;};
      _added
    };
    
    if ((!isNil "_action") && (!isNil "_target")) then {
      call {
        if (_action == "remove") exitWith {
          if (call _fnc_removeCoins) then {_result = true;} else {_result = false;};
        };
        if (_action == "add") exitWith {
          if (call _fnc_addCoins) then {_result = true;} else {_result = false;};
        };
        _result = false; // default
      };
    };
    
    _result

     

     
    
    
    // ===========================================================================
    // SINGLE CURRENCY (@money: universal dev function: local_eventKill debug test
    // ===========================================================================
    // @credits:
    //   - DayZ Epoch developers, collaborators and contributors
    //     (thank you guys for your excellent work!)
    //   - @Zupa: original SC concept creator and author of Universal Dev functions
    //     for 1.0.5 version.
    //     (see https://epochmod.com/forum/topic/15463-devs-universal-removeadd-coins-function/)
    //   - @salival for adapting @Zupa's concept to 1.0.6+ version and great community support
    //     (see: https://epochmod.com/forum/topic/43331-zsc-for-epoch-106-and-overwatch-025/)
    // ===========================================================================
    // Reworked for DayZ Epoch 1.0.6.1+ by @iben+
    // ===========================================================================
    // @testing example scenario:
    //   - Player is awarded for killing local zombies by coins (from 0 to 250)
    //   - We want to test all scenarios for fnc_SC_uniCoins function:
    //     + Add money to wallet for kill.
    //     + Remove money from wallet for kill.
    //     + Add money to bank account for kill.
    //     + Remove money from bank account for kill.
    //  @how to use this file:
    //   - Use usuall workflow:
    //     + custom compiles,
    //     + custom variables (for ibenDBG_zedAward),
    //     + don't forget to get fnc_SC_uniCoins.sqf file from:
    //       https://gist.github.com/infobeny/cd250b83617b5a86f0c9c156e7c8713e
    //     + update code to your needs (see @update tag bellow!)
    // ===========================================================================
    
    // ===========================================================================
    // ORIGINAL CODE FROM DAYZ_CODE
    // ===========================================================================
    //[unit, selectionName, damage, source, projectile]
    //will only run when local to the created object
    //record any key hits to the required selection
    private["_killer","_fnc_uniCoinsTest"];
    
    _array = _this select 0;
    _zed = _array select 0;
    _killer = _array select 1;
    _type = _this select 1;
    
    if (local _zed) then {
      _kills = _killer getVariable[_type,0];
      _killer setVariable[_type,(_kills + 1),true];
    
      //increase players humanity when zed killed
      _humanity = _killer getVariable["humanity",0];
      _humanity = _humanity + 5;
      _killer setVariable["humanity",_humanity,true];
    
    // ===========================================================================
    // FNC_SC_UNICOINS TEST
    // ===========================================================================
    
      _fnc_uniCoinsTest = {
        private ["_action","_target","_money","_curWep"];
    
        _action = _this select 0;
        _target = _this select 1;
        _money = (round(random 5) * 50); // @update: now from 0 to 250 Coins
        _curWep = getText (configFile >> 'CfgWeapons' >> currentWeapon _killer >> 'displayName');
    
        if !([_killer,_money,_action,_target] call fnc_SC_uniCoins) then {
          hintSilent format ["Error!\nNot enough Coins for %1 from/to %2 procedure OR wrong settings (check RPT)",_action,_target];
        } else {
          hintSilent format ["Success!\nweapon: [%1]\naction: [%2]\ntarget: [%3]\nmoney: [%4 %5]",_curWep,_action,_target,_money,CurrencyName];
        };
      };
    
      if (ibenDBG_zedAward) then {
        call {
          // @update: Change weapons classes bellow to your taste
          if ((currentWeapon _killer) == 'M110_NVG_EP1') exitWith {
            ["add","cache"] call _fnc_uniCoinsTest;
          };
          if ((currentWeapon _killer) == 'M9_SD_DZ') exitWith {
            ["remove","cache"] call _fnc_uniCoinsTest;
          };
          if ((currentWeapon _killer) == 'DMR_DZ') exitWith {
            ["add","bank"] call _fnc_uniCoinsTest;
          };
          if ((currentWeapon _killer) == 'M9_DZ') exitWith {
            ["remove","bank"] call _fnc_uniCoinsTest;
          };
          hintSilent "Error! Check your weapon className!"; // Default
        };
      };
    
    // ===========================================================================
    };

     

×
×
  • Create New...