Jump to content

wyattwic

Member
  • Content Count

    275
  • Joined

  • Last visited

  • Medals

Posts posted by wyattwic


  1. Hello,

     

    Ive been messing around with this addaction and I am having one heck of a time placing an sleep into the condition of this addaction without error.   Any ideas?

    _unit addAction [
        "Holster Weapons",
        "client/holster.sqf",
        true,   //EDIT - This line should return (_this select 3) as "true" am I right?
        1,
        false,
        false,
        "",
        "(!(currentWeapon _target == '') && (_target == _this))"
        ];

    Any help would be appricated!


  2. I have tried two variants of code via debug console to see if it will work, with no luck.

    Heres what I have tried. With no success.

    marker = createmarker ["markername",[14162.6,16187.9]]; 
    marker setMarkerType "group_1"; 
    mrkText = str (composeText [parseText "<size='2'>Marker Text>"]);
    marker setmarkertext mrkTest;
    

    setmarkertext works if there as long as mrkText is a pain old string like "test".

    Help is very appreciated!


  3. Hey everyone, I have two problems I need help in solving.

    First off, smaller map text.

    I need to write the position of where things spawn in small text, similar or smaller in size to the altitude indicators you will find on hills and humps. After lots and lots of back and fourth, I'm stumped.

    Last off, Have you ever noticed some of the vehicles pop up in odd places in the map shown before game start? Is there any way to set an awareness or something to make this accurate for all vehicles of choice during startup and gameplay? Im only concerned about empty vehicles, not ones in use.

    I know I have been doing a lot of question threads like this lately, and sorry, just trying to learn.


  4. Here is my neat little snipplet that will open ghosthawk doors based on altitude.

    I couldn't find one already out there, so here it is.

    Somewhere in the vehicle init

    null = [this] execvm "ghosthawkdoors.sqf";

    ghosthawkdoors.sqf

    	
    _unit = _this select 0; 
    
    
    _doorstate = false;
    while {alive _unit} do {
    	_alt = getposatl _unit select 2;
    
    
    	// If under 10 altitude and doors are already closed, open them.
    	if ((_alt <= 10) && !(_doorstate)) then {
    		_unit animateDoor ['door_R', 1]; 
    		_unit animateDoor ['door_L', 1];
    		_doorstate = true;
    		};
    
    
    	// If over 10 altitude and doors are open then close them.
    	if ((_alt > 10) && (_doorstate)) then {
    		_unit animateDoor ['door_R', 0]; 
    		_unit animateDoor ['door_L', 0]; 
    		_doorstate = false;
    		};
    
    	//Slow the script down some.  This is not a critical loop.
    	sleep 7;
    };

    This setup assumes that the doors are closed on start by default, as BIS had them set.

    If anyone sees an error, it would be a big help.


  5. Winters, the moon is not visible globally on the same night, to the best of my knowledge as a farmer.

    tryteyker, I am aware that they use a very good simulator to do just that, but I need to know the coordnates as to where Altis is based from. Lemnos does not have identical lunar patterns to Altis, despite the fact that it looks almost exactly like the real deal.

    Athens is very close to Lemnos, this is the data I get - http://www.timeanddate.com/moon/greece/athens

    ---------- Post added at 22:41 ---------- Previous post was at 22:34 ----------

    Here is something!!!

    Altis is exactly half a cycle diffrent than Athens. I am working on finer calculations now.


  6. Its a good thought, but here was my goal in better detail.

    Lets say this is a 128 slot server and we just started it. As players come in, they will always want to take things like pilot, AT or sniper first. My goal is to force them to fill the partial squad before a new squad is made available.

    Seeing as how setplayable does not work, do we know any other way to funnel players into certain slots based on player count?


  7. Script updated. Currently working out the bugs involving reduced day/night cycles.

    Edit, this script currently is functioning in regards to accelerating time.

    ---------- Post added at 17:18 ---------- Previous post was at 15:23 ----------

    This version has not been tested yet, but should sync players and server time more accurately. In the previous versions there was a 1 in 10 chance that the player would jump backwards 10 minutes and be brought back to the correct time on the next sync.

    This version utilizes a EH to update the moment it receives an update to the server time.

    //[AWG] Wyatt's time management script
    /*    Disambiguation:
           This script is made to manage a few key game play features.
               - Game starting time
               - Fast time (We will use setdate to avoid clouds skipping around)
    
           Start time:  I want to keep this option simple.   I will give them the options of 
           sunrise, noon, sunset, midnight.
    
           Fast time: I know there has to be over a dozen different published ways to forward
           through time.  This script uses the more complex setdate wich in contrast to skiptime, advances players through time 
           without the lower clouds jumping around.   Forecast and clouds stay the same.
    
       Important notes and operation methodology:
           This script must be started via the global init file as it must be ran on the
           server as well as the client.
           Clients will check with the server every 10 minutes to make sure that the client
           time is correct and to avoid dsync.
    */
    private ["_date","_tm","_ct","_min","_hour","_day","_month","_year"];//Set game time in accordance to parameters.  JIP ready! XD
    if (isDedicated && isServer) then {
       PublicServerTime = date; 
       PublicServerTime set [3,starttime];
       publicvariable "PublicServerTime"; 
       setdate PublicServerTime;
       if (rundebug) then {diag_log text format["timekeeper.sqf - Server - Initial time sync has been pushed to clients as hour %1.",PublicServerTime select 3];};
       };
    
    
    if (!isDedicated && !isServer) then {
       waituntil {!isnil "PublicServerTime"};
       setdate PublicServerTime;
    "PublicServerTime" addPublicVariableEventHandler {
    setdate PublicServerTime; if (rundebug) then {diag_log text format["timekeeper.sqf - Client - Time sync completed with server"];};
    };
      if (rundebug) then {diag_log text format["timekeeper.sqf - Client - Initial time sync completed with server - %1", PublicServerTime];};
       };
    
    
    
    _ct = 0;                /*loop counter.  Used for counting the minutes since last server sync.*/
    //Fast time and skiptime below
    if (fasttime == 0) then {  /*Parameters requested no fast time.   24 hours in real life, 24 hours in game.  This if statement is here for good coding practices and debug log purposes.*/
    
     if (rundebug) then {diag_log text format["timekeeper.sqf - Fasttime parameter returned %1.  Fast time will not run.",fasttime];};
      			if (shorttime == 0) then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1.  Short days and nights will not run.",shorttime];};
    		};
    
    		if (shorttime == 1) then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1.  Daytime will be cut in half.",shorttime];};
    			while {true} do {
               sleep 60;                 /*Sleep one minute*/
               _date = date;            /*Get the date/time*/
    
               _min = _date select 4;    /*Turn the date array into something we can easily manipulate.*/
               _hour = _date select 3;
               _day = _date select 2;
               _month = _date select 1;
               _year = _date select 0;
    
    
    			if (_hour >= 5 && _hour < 19)   then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1 and it is %2 hour.  Daytime will be cut in half.",shorttime,_hour];};
    			_min = _min + 1; //daytime - If the sun is up and I am enabled, fast time is doubled during this period.
    
    
    
    
               //The following are setdate syntax checks.
               if (_min > 59) then {_min = _min - 60; _hour = _hour + 1;/*If minutes added go out of date range, modify hours as needed.*/
                   if (_hour > 23) then {_hour = _hour - 24; _day = _day + 1;/*If hours go out of date range, modify days as needed.*/
                       if (_day > 31) then {_day = _day - 30;_month = _month + 1;/*If days go out of date range, modify months as needed.*/
                           if (_month > 12) then {_month = _month - 12; _year = _year + 1;/*If months go out of range, modify year as needed.*/
               };    };    };    };   /*If statement, inside if statement, etc.   Thought process is, if we don't have to fix minutes, we don't have to fix hours and so on.*/
    
               setdate [_year,_month,_day,_hour,_min]; /*Use setdate to set the manipulated date.*/
    
    		};
               /*everything from this point on is to prevent clients from dsyncing too much.*/
               _ct=_ct+1; /*This is the master sync control counter.  Adds 1 every cycle.*/
               if (_ct >= 10) then {  
                   if (isDedicated && isServer) then {PublicServerTime = date; publicvariable "PublicServerTime"; if (rundebug) then {diag_log text format["timekeeper.sqf - Server - Time sync has been pushed to clients."];};};
                   _ct = 0;
               };
           };/////////////////////////////////////////////////
    
    
    
    		};
    		if (shorttime == 2) then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1.  Night time will be cut in half.",shorttime];};
    		while {true} do {
               sleep 60;                 /*Sleep one minute*/
               _date = date;            /*Get the date/time*/
    
               _min = _date select 4;    /*Turn the date array into something we can easily manipulate.*/
               _hour = _date select 3;
               _day = _date select 2;
               _month = _date select 1;
               _year = _date select 0;
    
    
    
    			if !(_hour >= 5 && _hour < 19) then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1 and it is %2 hour.  Nighttime will be cut in half.",shorttime,_hour];};
    			_min = _min + 1; //nighttime - If the sun is down and I am enabled, fast time is doubled during this period.
    
    
    
    
               //The following are setdate syntax checks.
               if (_min > 59) then {_min = _min - 60; _hour = _hour + 1;/*If minutes added go out of date range, modify hours as needed.*/
                   if (_hour > 23) then {_hour = _hour - 24; _day = _day + 1;/*If hours go out of date range, modify days as needed.*/
                       if (_day > 31) then {_day = _day - 30;_month = _month + 1;/*If days go out of date range, modify months as needed.*/
                           if (_month > 12) then {_month = _month - 12; _year = _year + 1;/*If months go out of range, modify year as needed.*/
               };    };    };    };   /*If statement, inside if statement, etc.   Thought process is, if we don't have to fix minutes, we don't have to fix hours and so on.*/
    
               setdate [_year,_month,_day,_hour,_min]; /*Use setdate to set the manipulated date.*/
           };
               /*everything from this point on is to prevent clients from dsyncing too much.*/
               _ct=_ct+1; /*This is the master sync control counter.  Adds 1 every cycle.*/
               if (_ct >= 10) then {  
                   if (isDedicated && isServer) then {PublicServerTime = date; publicvariable "PublicServerTime"; if (rundebug) then {diag_log text format["timekeeper.sqf - Server - Time sync has been pushed to clients."];};};
                   _ct = 0;
               };
           };
    
    		};
    
    
      } else {
       if (rundebug) then {diag_log text format["timekeeper.sqf - Fast time is running with a modifier of 1 to %1.",fasttime];};
       _tm = fasttime;    /*Set time multiplier into local variable.*/
           while {true} do {
               sleep 60;                 /*Sleep one minute*/
               _date = date;            /*Get the date/time*/
    
               _min = _date select 4;    /*Turn the date array into something we can easily manipulate.*/
               _hour = _date select 3;
               _day = _date select 2;
               _month = _date select 1;
               _year = _date select 0;
    
    		_min = _min + _tm;
    
    		/*This section enables the half day/night setting*/
    		if (shorttime == 0) then {
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1.  Short days and nights will not run.",shorttime];};
    		};
    		if (shorttime == 1) then { 
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1 and it is %2 hour.  Daytime will be cut in half.",shorttime,_hour];};
    			if (_hour >= 5 && _hour < 19)   then {_min = _min + _tm}; //daytime - If the sun is up and I am enabled, fast time is doubled during this period.
    			};
    		if (shorttime == 2) then { 
    			if (rundebug) then {diag_log text format["timekeeper.sqf - Shorttime parameter returned %1 and it is %2 hour.  Nighttime will be cut in half.",shorttime,_hour];};
    			if !(_hour >= 5 && _hour < 19) then {_min = _min + _tm}; //nighttime - If the sun is down and I am enabled, fast time is doubled during this period.
    			};
    
    
    
               //The following are setdate syntax checks.
               if (_min > 59) then {_min = _min - 60; _hour = _hour + 1;/*If minutes added go out of date range, modify hours as needed.*/
                   if (_hour > 23) then {_hour = _hour - 24; _day = _day + 1;/*If hours go out of date range, modify days as needed.*/
                       if (_day > 31) then {_day = _day - 30;_month = _month + 1;/*If days go out of date range, modify months as needed.*/
                           if (_month > 12) then {_month = _month - 12; _year = _year + 1;/*If months go out of range, modify year as needed.*/
               };    };    };    };   /*If statement, inside if statement, etc.   Thought process is, if we don't have to fix minutes, we don't have to fix hours and so on.*/
    
               setdate [_year,_month,_day,_hour,_min]; /*Use setdate to set the manipulated date.*/
    
               /*everything from this point on is to prevent clients from dsyncing too much.*/
               _ct=_ct+1; /*This is the master sync control counter.  Adds 1 every cycle.*/
               if (_ct >= 10) then {  
                   if (isDedicated && isServer) then {PublicServerTime = date; publicvariable "PublicServerTime"; if (rundebug) then {diag_log text format["timekeeper.sqf - Server - Time sync has been pushed to clients."];};};
                   _ct = 0;
               };
           };
       };  


  8. I need a bit of help here guys, Im rusty as hell on this.

    I have an array that contains 80 or so arrays.

    I need to filter these arrays down to what would be, this select 2.

    How would I go about this?

    Example

    Targets = [
    ["Kalochori",[21369.516,19.15225,16317.723],2,0],
    ["Sofia",[25646.361,19.538486,21299.168],1,0],
    ["The Dome",[20940.111,13.698113,19251.389],2,0]];

    I would like the output to only return arrays that have 2 as the second to the last index.

    Help would be very appreciated!


  9. My timekeeper link above should be updated soon. Right now everything but the short days/nights are functioning.

    ---------- Post added at 15:37 ---------- Previous post was at 15:20 ----------

    If you want to keep it simple, here is the portion you need to accelerate time by hardwiring it into the code.

    Look for _tm. This tells the script how many minutes to skip every minute. If you were to replace it with 1, your day is cut in half.

    _tm can only accept whole numbers.

    while {true} do {
               sleep 60;                 /*Sleep one minute*/
               _date = date;            /*Get the date/time*/
    
               _min = _date select 4;    /*Turn the date array into something we can easily manipulate.*/
               _hour = _date select 3;
               _day = _date select 2;
               _month = _date select 1;
               _year = _date select 0;
    
    
    
    
    
    		_min = _min + _tm;
    
    
    
    
               //The following are setdate syntax checks.
               if (_min > 59) then {_min = _min - 60; _hour = _hour + 1;/*If minutes added go out of date range, modify hours as needed.*/
                   if (_hour > 23) then {_hour = _hour - 24; _day = _day + 1;/*If hours go out of date range, modify days as needed.*/
                       if (_day > 31) then {_day = _day - 30;_month = _month + 1;/*If days go out of date range, modify months as needed.*/
                           if (_month > 12) then {_month = _month - 12; _year = _year + 1;/*If months go out of range, modify year as needed.*/
               };    };    };    };   /*If statement, inside if statement, etc.   Thought process is, if we don't have to fix minutes, we don't have to fix hours and so on.*/
    
               setdate [_year,_month,_day,_hour,_min]; /*Use setdate to set the manipulated date.*/
    
               /*everything from this point on is to prevent clients from dsyncing too much.*/
               _ct=_ct+1; /*This is the master sync control counter.  Adds 1 every cycle.*/
               if (_ct >= 10) then {  
                   if (isDedicated && isServer) then {PublicServerTime = date; publicvariable "PublicServerTime"; if (rundebug) then {diag_log text format["timekeeper.sqf - Server - Time sync has been pushed to clients."];};};
                   sleep (random 15);
                   if (!isDedicated && !isServer) then {setdate PublicServerTime; if (rundebug) then {diag_log text format["timekeeper.sqf - Client - Time sync completed with server"];};};
                   _ct = 0;
               };
           };


  10. No success.

    Error in expression <this addaction ["Get in Pilot Seat",{(_this s>

    Error position: <addaction ["Get in Pilot Seat",{(_this s>

    Error Type String, expected Bool

    This is a bit confusing.

    ---------- Post added at 07:16 ---------- Previous post was at 07:05 ----------

    Figured it out!

    this addaction ["Get in Pilot Seat","(_this select 1) action [""getInDriver"", (_this select 0)]","",6,false,true,"","(typeOf player == ""B_Helipilot_F"")"];  


  11. Here is my idea.

    1. Spawn regular AI, handle damage via event handeler, setdamage 0.9

    You now have an AI limping around covered in blood and using the eventhandel you can adjust how much damage it can take.

    2. Set the AI to move at the fastest speed to the closest player. This should cause him to limp around to the player.

    3. if ((_target distance _zombie) < 1) then {Animation; _target damage; etc}

    Thats my rough idea. You could probably craft some particle effects and attach to the zombie to make it more death like.


  12. No matter what I do, I am unable to get the formatting on this correct. Would someone tell me what I am doing wrong?

    this addaction ["Get in Pilot Seat",{_this select 1 action ["getInDriver", _this select 0]},9,true,false,"","_this iskindof "B_Helipilot_F""];

    This line is being ran from the init of a helicopter. In most cases it simply does not return true, even though I am using a helipilot to approach.

    Thank you very much!

×