Jump to content

jshock

Member
  • Content Count

    3059
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by jshock


  1. Unless I misunderstand it, yes it does take the time since the game started, but the time difference between the time it saves it into the _start variable will be different from each iteration of the waitUntil loop. Therefore, since diag_tickTime is called and saved again in the _thing variable, making it possible to calculate a difference between the two times.

     

    Again, I may be mistaken, someone can correct me otherwise. Unless you're saying it's not currently working.

     

    EDIT: Actually just realized an error on my part. Move the _convert function to the top of the script and the _start variable below that. Then change it to [diag_tickTime] call _convert instead of just diag_tickTime.

     

     

    EDIT 2: And yes, your scripts are called over and over, but these variables are local to the script and therefore, each new call to the script means a new start time saved.


  2. private _start = diag_tickTime;
    
    private _convert =
    
    {
    
        params ["_num"];
    
        _num/1000;
    
    };
    
    private _dif =
    
    {
    
        params ["_num1","_num2"];
    
        abs(_num1 - _num2);
    
    };
    
    private _timeout = 30; //in seconds	waitUntil 	{	    private _thing = [diag_TickTime] call _convert;	    private _thing2 = [_start,_thing] call _dif;	 	    (count (allPlayers select {_x getVariable ["resetDone",false]}) isEqualTo (count allPlayers)) || _thing2 >= _timeout	};


  3. 5 minutes ago, Muzzleflash said:

    That will work. But if you know how long script1 takes, then I would just wait that amount of time and then start script2 on the server. It avoids issues like having to handle disconnecting/timeout players, otherwise the server will wait forever.

    Fair point. That would be an issue with the first solution. But I don't think that would be the case with the second (setVariable solution):

     

    //script1
    _unit setVariable ["myVariable",true,true];
    
    //script2
    waitUntil {count (allPlayers select {_x getVariable ["myVariable",false]}) isEqualTo (count allPlayers)};

    Since the allPlayers array would change on timeout/disconnected players, it should be fine.


  4. Then you will probably need a flag at the top of script2 (some waitUntil condition) that will only be true if all the clients have completed script1. Which you could have each client send a message to the server and the server waitUntil messages from all clients have been received, then run script2. OR you could set a variable on each client's character with setVariable and have script2 waitUntil allPlayers have that variable defined/true.


  5. {
    	//@@@//
    	hint format["slick = %1",_x];
    	sleep _debugTime;
    	//@@@//
    	if (!isNull _x) then
    	{
    		_slkhold = getpos _x;
    		_slkdist = _slkhold distance _slkzero;
    		if ( _slkdist != 0 ) then
    		{
    			_slkarr pushBack _x;
    		};
    	};
    } foreach _slkname;

    Firstly, I recommend the pushBack command, used above, instead of the BIS function. Secondly, I think you switch statement was redundant. Thirdly, the !isNull at the top checks if each object exists before running any code on it.

    • Like 2

  6. 6 hours ago, Rawshark said:

    Is there an option to change the sounds made by the detector? The current sounds work fine but I think an .ogg or .wss of a Geiger counter might just be the pièce de résistance of the mod.

    Since I was going for general purpose I strayed away from the classic Geiger sound because contaminated doesn't necessarily mean irradiated. I had thought about adding in some modularity for the sound of the detector way back when I first started making this mod. I can look into it I suppose.

    • Like 1

  7. Here are some macros I'm using for a config for a near future release of mine:

     

    #define UNIFORM_MODEL "\JSHK_contam_suits\uniforms\models\jshk_contam_nbc_suit.p3d"
    #define UNIFORM_CONTAINER_CLASS "Supply10"
    #define UNIFORM_MASS 80
    #define UNIFORM_PICTURE "\JSHK_contam_suits\uniforms\data\jshk_contam_suit_invIcon.paa"
    
    #define UNIFORM_DISPLAY_NAME(CAMO) *JSHK* NBC Suit (##CAMO##)
    #define Q_UNI_DN(CAMO) QUOTE(UNIFORM_DISPLAY_NAME(CAMO))
    
    #define UNIFORM_CLASS(NAME) JSHK_contam_soldier_##NAME
    #define Q_UNI_UC(NAME) QUOTE(UNIFORM_CLASS(NAME))
    
    #define UNIFORM_TEXTURE(CAMO) \JSHK_contam_suits\uniforms\data\jshk_contam_nbc_suit_##CAMO##_co.paa
    #define Q_UNI_UT(CAMO) QUOTE(UNIFORM_TEXTURE(CAMO))
    
    #define NEW_UNIFORM(CAMO,NAME) \
    	class JSHK_contam_suit_##CAMO##: JSHK_contam_suit_mtp \
    	{ \
    		scope = 2; \
    		scopeCurator = 2; \
    		displayName = Q_UNI_DN(NAME); \
    		hiddenSelectionsTextures[] = { Q_UNI_UT(CAMO) }; \
    		class ItemInfo: UniformItem	\
    		{ \
    			uniformClass = Q_UNI_UC(CAMO); \
    			containerClass = UNIFORM_CONTAINER_CLASS; \
                mass = UNIFORM_MASS; \
    		}; \
    	};
    
    class UniformItem;
    class Uniform_Base;
    class JSHK_contam_suit_mtp: Uniform_Base
    {
    	author = AUTHOR;
    	scope = 2;
    	scopeCurator = 2;
    	displayName = Q_UNI_DN(MTP);
    	picture = UNIFORM_PICTURE;
    	model = UNIFORM_MODEL;
    	hiddenSelections[] = {"camo"};
    	hiddenSelectionsTextures[] = { Q_UNI_UT(mtp) };
    	class ItemInfo: UniformItem
    	{
    		uniformClass = Q_UNI_UC(mtp);
    		containerClass = UNIFORM_CONTAINER_CLASS;
    		mass = UNIFORM_MASS;
    	};
    };
    
    NEW_UNIFORM(m81,M81);
    NEW_UNIFORM(mc,MC);
    //etc...


    Basically allows me to add a whole new uniform with a new texture without having to write out another class. I follow some naming conventions with my texture files to accomplish this as well.


  8. Ok....sooo....I promise the video is on the way. However, I'm working on a big(ish) update that will bring a full set of accessory functions along with the ability to exclude AI/unit classnames/factions from being affected. Fixes a couple issues too, as per normal :smile_o:. So I'm going to try and push that, the video, and a scenario mission (separate release from the mod) all at the same time.

     

    I've got some time for the next couple days, so I want to make the most of it :smileee:.

    • Like 1

  9. 15 minutes ago, Mynock said:

    I was dumb for assuming BIS_fnc_selectRandom was the only solution because I see a lot of people using it for randomly generated missions

    A lot of the threads that have helped people setup those randomly generated missions where created well before the command solution to BIS_fnc_selectRandom existed. A solution is a solution though, just like in early math classes where they teach you the long way and force you to master the concept before showing you a shortcut that takes all of 2 seconds. You just learned of the shortcut, no need to go at yourself for it :thumb:.


  10. 12 minutes ago, TheLimbo365 said:

     

    The Achilles zeus expansion has some great multi selection options

     

    I'd suggest having a look at the AI patrol or add items to zeus options as they both have several secondary selections!

     

    Hope this helps

    Yea I've looked into that one as well as looked into Chessmasters42's Curator Presets Modules. It's really more of taking the time to really sit down and sort it all out and figure out wtf I'm doing.....but I'm struggling to get a usage video out atm so....


  11. 7 hours ago, loopdk said:

    Are you planing a Zeus modul? 

    Yes. My only issue is my lack of knowledge with in-game GUI setups, otherwise that would have already been completed a long time ago. Also there isn't a whole lot of documentation on Zeus modules themselves so I'm having to piggyback (to some extent) on other mods to see how the configuration works.

    • Like 2
×