Jump to content

blckeagls

Member
  • Posts

    182
  • Joined

  • Last visited

Posts posted by blckeagls

  1. Use this for respawn:

    player addEventHandler ["Respawn", {INSERT_CODE_HERE}];
    

    To get an array of all alive players use:

    _players = [];
    {
      if (alive _x) then {
         _players = _players + [_x];
      };
    } foreach playableUnits;
    
    //_players will be an array of all alive players
    
    

    You can also use this to select an alive player at random:

    _selectedPlayer = _players call BIS_fnc_selectRandom;
    
  2. Assign a Variable to each vehicle:

    _veh setVariable ["TEMP",true,true];  //[Var_Name,Var_Value,Public_to_all_players]
    

    In Mission Folder, init.sqf add:
     

    WarnPlayer_Veh = {
       [] spawn {
          while {true} do {
             waituntil{vehicle player != player};
             if ((vehicle player != player) && ((vehicle player) getVariable "TEMP")) then {
                systemchat("Warning: This vehicle will disappear on restart!");
             };
             waituntil{vehicle player == player};
          };
       };
    };
    
    call WarnPlayer_Veh;
    player addEventHandler ["Respawn", {call WarnPlayer_Veh;}];
    
    //Have not tested.. but you get the gist
    
    
  3. Hello All,

    I am looking to add new features to my server...  Wanted to see what the community is looking for..  What could make this more fun and enjoyable..

    What would you all like to see?  Don't worry on the complexity, I have made many custom scripts, including custom database stuff to save information...

    Currently have:
    AI Missions
    Zombies in Cities
    Service Stations
    5 Crypto/5Minute paychecks...
    Alternate Currency to get cooler stuff.  Earned through doing missions and spending time in server....
    Currently working on AI Base Guards

  4. My guess would be add -mod:@mod1;@mod2;@mod3;@Bornholm to your server start parameters..

    then in your config.cfg change:

     

    class Missions
    {
    	class Epoch {
    		template = epoch.Altis; // DO NOT CHANGE THIS, IT WILL BREAK YOUR SERVER
    		difficulty = "veteran";    // difficulty settings: veteran == NORMAL, mercenary == HARDCORE
    	};
    };
    

    to:

     

    class Missions
    {
    	class Epoch {
    		template = epoch.Bornholm; // DO NOT CHANGE THIS, IT WILL BREAK YOUR SERVER
    		difficulty = "veteran";    // difficulty settings: veteran == NORMAL, mercenary == HARDCORE
    	};
    };
    

    then make sure your mission folder is called epoch.bornholm and the bornholm mission.sqm file is in there

  5. Here is a script that I use to add after spawning each AI to spread the load out across all players on the server...  This will allow people to be damaged by AI when a fresh spawn...

     

    while {true} do {
    	_players = [];
    	{
    		_players = _players + [_x];
    	} foreach playableunits;
    	_owner = _players call BIS_fnc_selectRandom;
    	_ai1 setOwner (owner _owner);
    	_ownerOnline = true;
    	while {_ownerOnline} do {
                    _players = [];
    		{
    			_players = _players + [_x];
    		} foreach playableunits;
    		if (!(_owner in _players)) then {
    			_ownerOnline = false;
    		};
    		sleep 10;
    	};
    };
    
  6. I have compiled some code from multiple authors and edited them.  Most of this being from Arma 2, since I have been running this script for over a year, I don't remember the authors.

     

    Thanks to GhostRider for taking this and improving it.  You can see his improvements on his GitHub: https://github.com/G...v-2.0.2-updated

     

     

    Current Version Number: 2.0.2

     

    AI Features:
    4 AI Missions (Each Different Color)

    Each mission individually configurable
    New Improved AI setOwner to enable JIP and new spawn damage
    4 Crates at each mission (You can edit each one individually)

    Variable amount of AI at each location, you can choose the range. (Default 5-15)

     

     

    If anyone has any other cool ideas they would like me to make..  Personal Message me...  I'll work on them and post them on forum when completed if I like them...

     

    NOTE: DO NOT USE CUSTOM @MOD FOLDERS, WILL PREVENT SERVER FROM SHOWING ON LAUNCHERS(Like A3LAUNCHER)

     

    Instructions:

    1. Download the attached files.

    2. Add custom_server.pbo in your @EpochHive/Addons/ folder.

    3. In your Mission Folder or PBO , if you have an init.sqf go to step 5.

    4. Create a file called "init.sqf" in your mission folder or PBO (init.sqf provided in .zip)

    5. Add the following Lines:

    //If server execute this script
    if (isServer) then {
    	execVM "\q\addons\custom_server\init.sqf";
    //If anything but server execute this script
    } else {
    	[] spawn {
    		//This is to spawn the markers when players enter after server has started
    		[] execVM "debug\addmarkers.sqf";
    		[] execVM "debug\addmarkers2.sqf";
    		[] execVM "debug\addmarkers75.sqf";
    		[] execVM "debug\addmarkers752.sqf";
    		//Event handler to show messages to players // this can be used for other scripts to send messages to players -- see AIM.sqf
    		"blck_Message" addPublicVariableEventHandler {titleText[format["%1",_this select 1],"PLAIN DOWN",1];};
    	};
    }; 

    6. Unzip the mission.zip file and add the debug folder into your mission folder or PBO. (init.sqf is provided only needed if step 6 was not completed)

     

    You are complete!  Enjoy!
     

     

    ATTACHED IN THE ZIP ARE THE BE FILTERS THAT I AM USING..  IF THEY DON'T WORK FOR YOU, NOT SURE WHY.  Due to too many people having different BE Filters issues, I will not provide BE Filter Support.  Use mine if you have issues (make a backup of your old ones in case of further issues)

     

     

    AI Damaging players was configured by the following code added to the end of the AI.sqf and AI1.sqf files.

    //Prevents players from having AI God Mode
    while {true} do {
    	_players = [];
    	_nearEntities = count (_ai1 nearEntities [["MAN"],1000]);
    	//diag_log format["_nearEntities: %1",_nearEntities];  //Used for testing
    	{
    		if (isPlayer _x) then {
    		 _players = _players + [_x];
    		};
    	} foreach (_ai1 nearEntities [["MAN"],1000]);
    	//diag_log format["Nearplayers: %1",_players]; //Used for testing
    	if ((count _players) > 0) then {
    		_owner = _players call BIS_fnc_selectRandom;
    		_ai1 setOwner (owner _owner);
    	};
    	//diag_log format["_ai1 %2 Owner: %1",owner _ai1, _ai1]; //Used for testing
    	waitUntil{_nearEntities != count (_ai1 nearEntities [["MAN"],1000])};
    };
    

    AI Cleanup was completed by adding the following:

    _ai1 spawn {
    	waitUntil{!alive _this};
    	_this setOwner 1;
    	sleep blck_aiCleanUpTimer;
    	deleteVehicle _this;
    };
    
    • FILES CAN BE EDITTED. to edit the server files, you need to unpack the custom_server.pbo with PBOMANAGER...  then once your done editting repack the PBO.
    • To edit I would suggest using Notepad++ and the SQF Addon from Armaholics
    • The PBOManager can be downloaded from Armaholics as well

    Change Notes:

    2.0.1 > 2.0.2

    Minor Fixes

     

    2.0.0 > 2.0.1

    Fixed the issue with the AI not getting inside vehicles

     

    1.3.4 > 2.0.0

    You can customize the look, number of AI, AI Weapons at each mission individually (see init.sqf in the server files).

    Provided my BE Filters..

    Changed the way the AI get weapons and magazines (Now specifed in server init.sqf as  ["Weapon","Magazine"] )

    Changed how the AI get their owner to provide player damage.

    Removed all items from AI before adding new items to prevent providing items you dont want..

    Added a section to add FirstAid Packs and other items...

    Added function to make sure AI Missions are a certain distance from each other (Default in init.sqf:  MinDistanceFromMission = 500;)

     

    1.3.3 > 1.3.4

    Added setOwner script to the AI in spawnvehicles.sqf

     

    1.3.2 > 1.3.3

    Commented code to help understand what is happening better

    Removes some Headless Client testing code

     

    1.3.1 > 1.3.2

    Fixed issue where Minor/SM1.sqf wouldn't remove marker (Thanks to ilganna)

    Removed unnecessary code from spawnvehicles.sqf

     

    1.3.0 > 1.3.1

    Added the debug folder to zip file

     

    1.2.0 > 1.3.0
    Updated code for setOwner
    Added removeBackpackGlobal for AI (Some would spawn with unwanted items) to remove the backpacks

    Fixed issue where specified weapons wouldn't be given to AI, rather default weapons.

     

    blck AI Mission v2.0.2.zip

  7. It's not showing the price of each item in the trader GUI...  Any suggestions to fix?

     

    coin%20ss.jpg

    Found the answer:

    I mean not playerHud.sqf. My bad. I wanted to see your gold/init.sqf.

     

    Are you sure you have these functions in your compiles.sqf? :

    BIS_fnc_numberDigits = compile preprocessFileLineNumbers "custom\numberDigits.sqf";

    BIS_fnc_numberText = compile preprocessFileLineNumbers "custom\numberText.sqf";

    And those files actually exist in the given paths? (Might be different paths for you)

×
×
  • Create New...