Jump to content

Chuc

Member
  • Content Count

    202
  • Joined

  • Last visited

  • Medals

Posts posted by Chuc


  1. I use a rating system that gives you rating or takes it away depending on who you kill. not sure where i got it from.

     

    Rating.sqf

    Spoiler

    // Rating System to improve your standings within the world.

     

    null =
     [] spawn {
      while {true} do {
        sleep 2;
        {
          if (isNil {_x getVariable "oldSide"}) then {
            _x setVariable ["oldSide",side _x];
          }
        } forEach allUnits;
      }
    };


    if (isServer) then {
    addMissionEventHandler  ["Entitykilled", {
       params ["_victim","_killer","_zombie"];


       if (!isPlayer _killer or _victim == _killer) exitWith {};

       if (_victim getVariable "oldSide" == west) exitWith {
          [_killer,{_this addRating -3000}] remoteExec ["call",_killer];
          parseText "<t color = '#ff9900'>You just killed a friendly unit!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == civilian) exitWith {
          [_killer,{_this addRating -1000}] remoteExec ["call",_killer];
          parseText "<t color = '#A990D4'>You just killed an innocent!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == east) exitWith {
          [_killer,{_this addRating 50}] remoteExec ["call",_killer];
          parseText "<t color = '#ff0000'>You just killed an Enemy Man<t/>" remoteExec ["hintsilent",_killer];
        };
        if ((_this select 2) isEqualTo player) then {
          [_killer,{_this addRating 10}] remoteExec ["call",_killer];
    //      parseText "<t color = '#ff0000'>You just killed a Zombie<t/>" remoteExec ["hintsilent",_killer];
        };
    }];
    };
     

     

    Added the zombie part with help form Haleks. Ravage mod.

     

    Added with one a couple i have made. A script that checks your rating and promotes or demotes you depending on your rating

     

    Rank.sqf

    Spoiler


    [] spawn {
    while {alive player} do {

    waitUntil {sleep .5; (rating player == 1000)};
    if (rating player == 1000) then {[]execVM "Scripts\Rank\Promoted.sqf";};

     

    waitUntil {sleep .5; (rating player == -1000)};
    if (rating player == -1000) then {[]execVM "Scripts\Rank\demoted.sqf";};

    }forEach allUnits;
    };
     

     

    Promoted.sqf

    Spoiler

    PromoteUnit = {
        private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
        private _old = rankId _this;
        if (count _rks - _old > 1) then {
            _this setUnitRank (_rks select _old + 1);
            systemChat format ["Unit %1 promoted to %2", _this, rank _this];
        }
    };
    player call PromoteUnit;
     

     

    Demoted.sqf

    Spoiler

    DemoteUnit = {
        private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
        private _old = rankId _this;
        if (count _rks - _old > 1) then {
            _this setUnitRank (_rks select _old - 1);
            systemChat format ["Unit %1 demoted to %2", _this, rank _this];
        }
    };
    player call DemoteUnit;

     

    Now the problem i have encounted and cant seem to fix is that the rank.sqf only fires one time. As in you will be promoted one rank or demoted one rank. So you can go form private to corporal but not any higher. Then you can go back from corporal to private. If you get demoted back to private you can still get promoted up to corporal again.

     

    The problem may lie in the fact that if you get promoted or demoted your rating goes back to 0. You can also start the game as a Sargent and get promoted once and demoted once.

    Not sure what is going on. The promote and demote scripts work fine one there own but the rank.sqf is what im having problems with.

     

    Any help would be awesome thank you

    • Like 1
    • Thanks 1

  2. got an ai to drive once. Straight into the ocean. Not sure why he did that. He didnt even try and get out of the car. I swam back to the shore and waited. He never came out. I put it down to he just couldnt handle living in a world full of zombies and decided to end it, would of been nice if he did it without me.

     

    Other than that they seem to shoot through me to get to there target. So i dont group with Ai much anymore and i definitely dont let them drive me,

    • Haha 2

  3. very nice scripts. Been looking for years for a loot spawner that spawns loot around player then deletes it. Loot spawning was always something i could never figure out. 

     

    Quick question. With the class names in your script, this bit

     

    Spoiler

    class CfgLootTables
    {
        class Military
        {
            ratio[] = 

     

    The class military. Is it possible that after all that code we could put in a new class with a different loot list? Then if we use your #Positions Creator Tool on buildings define them with the new class name?

     

    If that makes any sense at all.

     

    Like this

    Spoiler

    class CfgLootTables
    {
        class Military
        {
            ratio[] = 
            {
            };

     

            weapons[] = 
            {
            };

     

            backpacks[] = 
            {
            };      

     

            items[] = 
            {
            };

     

            uniforms[] = 
            {
            };

     

    class Civilian
        {
            ratio[] = 
            {
            };
            
            weapons[] = 
            {
            };

     

            backpacks[] = 
            {
            };        

     

            items[] = 
            {
            };

     

            uniforms[] = 
            {
            };    
        };

    Would be handy to know because one of the maps i like to make missions on doesnt have loot positions inside 90% of its buildings, one of the reasons i stopped using it. This would make that map a heap more useful. Also its to big to have loot always on the map anyway so your script will improve it even more


  4. On 1/7/2019 at 11:21 AM, GEORGE FLOROS GR said:

     

    I don't remember if there is an eventhandler for damage , if there is just add the code from the EH , else :

    
    GF_HandleDamage_List = [
    	"B_RangeMaster_F"	// test		
    ];
    
    
    GF_HandleDamage = {
    
    _this addEventHandler ["HandleDamage", {
    	params ["_unit", "_selection", "_damage","_source","","_index"];
    		
    	if ( _index > -1 ) then {
    		private _selectionDamage = _unit getHit _selection;
    		private _damageRecieved = (_damage - _selectionDamage) max 0;
    		_damageRecieved = _damageRecieved / 10;	// test	change this	
    		_damage = _damageRecieved + _selectionDamage;
    	};	
    _damage	
    }];
    };
    
    
    [] spawn {
    	while {true} do {	
    		{	
    		if (
    			(!(_x getVariable ["Var_GF_HandleDamage",false])) 
    			&& (typeOf _x in GF_HandleDamage_List)
    														
    			) then {		
    			_x call GF_HandleDamage;
    			};				
    				
    			{waitUntil ((damage _x == 1));
    			_x setVariable ["Var_GF_HandleDamage",false]; 
    			};			
    			
    		}forEach allunits;	
    		sleep 3;	// test		
    	};
    };

     

    So where does this go? I've gotten a little lost with it

    • Like 1

  5. hello everyone. long time since ive been here. 

     

    Got a quick question about the equipment pool module. I have added my own guns and things into it and they are working quite well with traders and bandit but for some reason the module doesnt work with 0 = [this] call rvg_fnc_equip;. Is this suppose to happen or is it just something that may have been over looked.

     

     


  6. i noticed this in the setting sqf at the bottom

     

    /*dont change*/
    if (DynSimDistManual) then {"Group" setDynamicSimulationDistance DynSimDistManualRange;};

    if (!DynSimDistManual) then {while {true} do {
            if (cameraView isEqualTo "GUNNER") then {
                    "Group" setDynamicSimulationDistance (viewDistance - (viewDi

     


    Is it suppose to just end like that or is it missing something?

    • Like 1

  7. 1 hour ago, haleks said:

    @Chuc : The "killed" EH has an instigator parameter, you can check if the killer is the player :

    
    if ((_this select 2) isEqualTo player) then {blablabla};

     

    that worked perfectly. Didnt even think of it like that. learnt something new Thank you.

     

    here is the working script. 

    Spoiler

    // created by pierremgi edited by Chuc with help from haleks

     

    null =
     [] spawn {
      while {true} do {
        sleep 2;
        {
          if (isNil {_x getVariable "oldSide"}) then {
            _x setVariable ["oldSide",side _x];
          }
        } forEach allUnits;
      }
    };
    //*/

    if (isServer) then {
    addMissionEventHandler  ["Entitykilled", {
       params ["_victim","_killer","_zombie"];


       if (!isPlayer _killer or _victim == _killer) exitWith {};

       if (_victim getVariable "oldSide" == west) exitWith {
          [_killer,{_this addRating -3000}] remoteExec ["call",_killer];
          parseText "<t color = '#ff9900'>You just killed a friendly unit!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == civilian) exitWith {
          [_killer,{_this addRating -2000}] remoteExec ["call",_killer];
          parseText "<t color = '#ffff00'>You just killed an innocent!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == east) exitWith {
          [_killer,{_this addRating 50}] remoteExec ["call",_killer];
          parseText "<t color = '#ffff00'>You just killed an Enemy<t/>" remoteExec ["hintsilent",_killer];
        };
        if ((_this select 2) isEqualTo player) then {
          [_killer,{_this addRating 10}] remoteExec ["call",_killer];
          parseText "<t color = '#ffff00'>You just killed an Enemy<t/>" remoteExec ["hintsilent",_killer];
        };
    }];
    };

     


  8. 9 minutes ago, haleks said:

    @Chuc: Try using "ENEMY" instead of 'sideEnemy". ;)

    didnt help. 

     

    For a work around im just adding into the zombie on killed init. but that means any AI that kill zombies will give me rating. Was trying to get it to work with player score but couldnt  figure it out. Did work out how to promote someone once there rating got high enough but with every new rank comes a rating of 0 for some reason instead of the set number. So atm its every 1000 rating you lvl up. With the code i found before i can set east kills up to a low number and zombies atm are set to give 10 rating.

     

    rank.sqf

    Spoiler

    [] spawn {
    while {alive player} do {

    waitUntil {sleep .5; (rating player == 1000)};
    if (rating player == 1000) then {[]execVM "Scripts\Rank\Promoted.sqf";};

    }forEach allUnits;
    };

     

    Promoted.sqf

    Spoiler

    PromoteUnit = {
        private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
        private _old = rankId _this;
        if (count _rks - _old > 1) then {
            _this setRank (_rks select _old + 1);
            systemChat format ["Unit %1 promoted to %2", _this, rank _this];
        }
    };
    player call PromoteUnit;
     

     

    made that promoted scripts a little over a year ago with help from @serena


  9. 2 hours ago, GEORGE FLOROS GR said:

     

     

     

    Hello there Chuc!

    Check here:

     

    yep thats where i got that code from and it works grerat on west, civ and east but i cant get it working on zombies as sideEnemy does not register as a side


  10. need some help guys. Trying to add Rating to player ever time you kill a zombie but am having no luck i found this

    Spoiler

     [] spawn {
      while {true} do {
        sleep 2;
        {
          if (isNil {_x getVariable "oldSide"}) then {
            _x setVariable ["oldSide",side _x];
          }
        } forEach allUnits;
      }
    };

     

     

    if (isServer) then {
    addMissionEventHandler  ["Entitykilled", {
       params ["_victim","_killer"];

       if (!isPlayer _killer or _victim == _killer) exitWith {};

       if (_victim getVariable "oldSide" == west) exitWith {
          [_killer,{_this addRating -3000}] remoteExec ["call",_killer];
          parseText "<t color = '#ff9900'>You just killed a friendly unit!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == civilian) exitWith {
          [_killer,{_this addRating -2000}] remoteExec ["call",_killer];
          parseText "<t color = '#ffff00'>You just killed an innocent!<t/>" remoteExec ["hintsilent",_killer];
        };
        if (_victim getVariable "oldSide" == east) exitWith {
          [_killer,{_this addRating 500}] remoteExec ["call",_killer];
          parseText "<t color = '#ffff00'>You just killed an Enemy<t/>" remoteExec ["hintsilent",_killer];
        };
    }];
    };

     

    But cant get it to work for zombies. Tried changing east to sideEnemy but didnt work.

     

    Any help would be great

    thank you

    • Like 1

  11. here is a check ammo count and type in hint if you are playing with no hud for the weapon in your hand

     

    Spoiler

    player addAction ["Ammo Count",
    "_count_PW = player ammo currentWeapon player;
    _magazineClass = currentMagazine player;
    hint format ['Ammo = %1\n Type = %2', _count_PW, _magazineClass];",
    [], 1, false, true, "", "true"];

     

    • Like 1

  12. 48 minutes ago, haleks said:

     

    NPCs going through doors without opening them is something I've seen too recently.

    It is yet another AI glitch with Arma3, it has nothing to do with zombies.

     

    BTW, I love how @crazy mike opened pretty much every door on Chernarus2035, makes things a lot simpler!

    Yeah i thought it was but i just wanted to add that little bit coz i thought it was funny


  13. So awhile ago i asked for a feature to be added. That was make it so zombies cant open doors. To my surprise last night i ran into a house on Altis and closed the door behind me not realising it was the only way in or out so i turned around to see a couple zombies just clip through the door.

     

    I know i asked for them not being able to open the doors but that is not what i had in mind.


  14. Radiation_Zone.sqf

    Spoiler

    //Spawns over Kavala in Altis. To move it just change the grid numbers to wear you want  [3753.826, 12999.547,0].

     

    _Rad_Zone_1 = createTrigger ["EmptyDetector", [3753.826, 12999.547,0]];
    _Rad_Zone_1 setTriggerArea [1100, 1100, 0, false];  // this is the area the radiation will be
    _Rad_Zone_1 setTriggerActivation ["ANY", "PRESENT", true];

    _Rad_Zone_1 setTriggerStatements

        [
          "this",
          "
          {
                     [_x,thisTrigger] spawn
                    {
                      _unit = _this select 0;
                      _trg  = _this select 1;             

      

                      private ['_timer','_dmg','_GasMask'];

                      _GasMask = ['Mask_M40_OD','Mask_M40','Mask_M50'];

     

                      while {alive _unit && local _unit} do
                      {
                          waitUntil {sleep 0.5; _unit inArea _trg && !(goggles _unit in _GasMask)};

                           if (isPlayer _unit) then
                             {
                                 hint parseText format['<t size=""1.10"" font=""PuristaMedium"" color=""#F0133C"">Radiation hazard! Check your equipment</t>'];
                                  _unit setVariable ['radiat', ppEffectCreate ['ChromAberration', 200]];
                                  (_unit getVariable 'radiat') ppEffectEnable true;
                                  (_unit getVariable 'radiat') ppEffectAdjust [0.03, 0.03, true];
                                  (_unit getVariable 'radiat') ppEffectCommit 10;

                                  _unit setVariable ['radiat2', ppEffectCreate ['ColorInversion', 500]];
                                  (_unit getVariable 'radiat2') ppEffectEnable true;
                                  (_unit getVariable 'radiat2') ppEffectAdjust [0.0, 0.0, 0.2];
                                  (_unit getVariable 'radiat2') ppEffectCommit 10;
                             };

                        _dmg   = getDammage _unit;
                        _timer = diag_tickTime;

                        _dmgTick = 0.2;


                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 3 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 6 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 9 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 12 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 15 or (goggles _unit in _GasMask)};
                       if (diag_tickTime > _timer + 15) exitWith {_unit setDamage 1};

                       if (isPlayer _unit) then
                       {
                          hint parseText format['<t size=""1.10"" font=""PuristaMedium"" color=""#13F03C"">You are out of contamination</t>'];
                                  _unit setVariable ['noradiat', ppEffectCreate ['ChromAberration', 200]];
                                  (_unit getVariable 'noradiat') ppEffectEnable true;
                                  (_unit getVariable 'noradiat') ppEffectAdjust [0.0, 0.0, true];
                                  (_unit getVariable 'noradiat') ppEffectCommit 10;

                                  _unit setVariable ['noradiat2', ppEffectCreate ['ColorInversion', 500]];
                                  (_unit getVariable 'noradiat2') ppEffectEnable true;
                                  (_unit getVariable 'noradiat2') ppEffectAdjust [0, 0, 0];
                                  (_unit getVariable 'noradiat2') ppEffectCommit 10;
                       };
                      }
                    }
                 } forEach allUnits;",
            ""
         ];

    _Radiation = _Rad_Zone_1 getRelPos [0,0];
    _Rad_Obj_1 = "Land_HelipadEmpty_F" createVehicle _Radiation;

    _Warning_Marker = createMarker ["Warning_Marker_1", getPos _Rad_Obj_1];
    _Warning_Marker setMarkerShape "ELLIPSE";
    _Warning_Marker setMarkerColor "ColorRed";
    _Warning_Marker setMarkerSize [1100, 1100];
    _Warning_Marker setMarkerBrush "DIAGGRID";

     

    //Change [3753.826, 12999.547,0] to where ever you want the radiation to be

    _City_marker = createMarker ["Kavala", [3753.826, 12999.547,0]]; 
    _City_marker setMarkerType "hd_warning";
    _City_marker setMarkerSize [1,1];
    _City_marker setMarkerColor "ColorYellow";
    _City_marker setMarkerText "Warning";

    Change _GasMask = ['Mask_M40_OD','Mask_M40','Mask_M50']; To what ever you want to not get effected by the radiation

     

    Or if you want you can place a trigger on the map then add this in the onAct

    Spoiler

    {
                     [_x,thisTrigger] spawn
                    {
                      _unit = _this select 0;
                      _trg  = _this select 1;             

      

                      private ['_timer','_dmg','_GasMask'];

                      _GasMask = ['Mask_M40_OD','Mask_M40','Mask_M50'];

     

                      while {alive _unit && local _unit} do
                      {
                          waitUntil {sleep 0.5; _unit inArea _trg && !(goggles _unit in _GasMask)};

                           if (isPlayer _unit) then
                             {
                                 hint parseText format['<t size=""1.10"" font=""PuristaMedium"" color=""#F0133C"">Radiation hazard! Check your equipment</t>'];
                                  _unit setVariable ['radiat', ppEffectCreate ['ChromAberration', 200]];
                                  (_unit getVariable 'radiat') ppEffectEnable true;
                                  (_unit getVariable 'radiat') ppEffectAdjust [0.03, 0.03, true];
                                  (_unit getVariable 'radiat') ppEffectCommit 10;

                                  _unit setVariable ['radiat2', ppEffectCreate ['ColorInversion', 500]];
                                  (_unit getVariable 'radiat2') ppEffectEnable true;
                                  (_unit getVariable 'radiat2') ppEffectAdjust [0.0, 0.0, 0.2];
                                  (_unit getVariable 'radiat2') ppEffectCommit 10;
                             };

                        _dmg   = getDammage _unit;
                        _timer = diag_tickTime;

                        _dmgTick = 0.2;


                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 3 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 6 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 9 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 12 or (goggles _unit in _GasMask)};
                      if (diag_tickTime > _timer + 3) then {_unit setDamage ((damage _unit) + _dmgTick)};

                       waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 15 or (goggles _unit in _GasMask)};
                       if (diag_tickTime > _timer + 15) exitWith {_unit setDamage 1};

                       if (isPlayer _unit) then
                       {
                          hint parseText format['<t size=""1.10"" font=""PuristaMedium"" color=""#13F03C"">You are out of contamination</t>'];
                                  _unit setVariable ['noradiat', ppEffectCreate ['ChromAberration', 200]];
                                  (_unit getVariable 'noradiat') ppEffectEnable true;
                                  (_unit getVariable 'noradiat') ppEffectAdjust [0.0, 0.0, true];
                                  (_unit getVariable 'noradiat') ppEffectCommit 10;

                                  _unit setVariable ['noradiat2', ppEffectCreate ['ColorInversion', 500]];
                                  (_unit getVariable 'noradiat2') ppEffectEnable true;
                                  (_unit getVariable 'noradiat2') ppEffectAdjust [0, 0, 0];
                                  (_unit getVariable 'noradiat2') ppEffectCommit 10;
                       };
                      }
                    }
                 } forEach allUnits;

    You can even make multiple Radiation Zones by just copy and pasting the trigger around your map

     

    This will cause abit of lag when loaded but it destroys all buildings and removes trees and bushed from the area. It also kills cars and helicoptors engines when entering the zone.

    Spoiler


    // Kill Altis Town Kavala

    _City_Trig_1 = createTrigger ["EmptyDetector", [3753.826, 12999.547,0]];
    _City_Trig_1 setTriggerArea [1100, 1100, 0, false];
    _City_Trig_1 setTriggerActivation ["ANY", "PRESENT", true];

    _City_Trig_1 setTriggerStatements

                [
                    "this",
                     "",
                     ""
                ];

    _City = _City_Trig_1 getRelPos [0,0];
    _City_Object = "Land_File_F" createVehicle _City;

    if (isServer) then
    {
        {
            _x hideObject true;
        }
        forEach nearestTerrainObjects
        [
            [3753.826, 12999.547],  // Change this to where you want it
            ["Tree","Bush"],
            1000,
            true
        ];
    };

    sleep 1;

    _buildings = (getPos _City_Object) nearObjects ["Building",1000];
    {_x setDamage 1} forEach _buildings;


    damageEngine = {
                       {
    //                       _x setHitPointDamage ["HitEngine",1];
                           _x setHitPointDamage ["HitBatteries",1];   // Forgot to test this but the HitEngine works
                       }
                       forEach nearestObjects
                       [
                           [3753.826, 12999.547], // Make sure same as above
                           ["Car","Air"],
                           1000
                       ];
                   };

    []spawn{
    while {true} do {
        {
            if ( (!(_x getVariable ["damag_veh_engine",false])) && ((_x isKindOf "Car")) || ((_x isKindOf "Air")) ) then {
                _x call damageEngine};
                _x setVariable ["damag_veh_engine",true];

                {waitUntil (damage _x == 0 || {canMove _x});
                _x setVariable ["damag_veh_engine",false];
            };
        }forEach vehicles;
      }
    };

    This one looks like it could be cleaned up abit but it works. Must of forgot to clean it once i got it working

     

    Feel free to edit any part of the scripts and use them as you please. Credit would be nice as well. Thank you

     

    If you can make any of it better please let me know as i am still learning and these are really my first scripts i have done.

     

    Radiation script idea came form a post last year by @pierremgi. Thank you.

    • Like 2
    • Thanks 4
×