-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Posts posted by jshock
-
-
https://community.bistudio.com/wiki/BIS_fnc_trimString
private _myShortString = [typeOf myVehicle,0,4] call BIS_fnc_trimString;
- 1
-
Correct on all fronts. I was getting ahead of myself when typing it out on my phone :P.
-
I give this thread the following rating: __________9;^{\\\||c=E8pS-______|\\gajS____~><____
- 8
-
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.
-
Ok, sorry for the double post. But in regards to the above...I did this on my phone, so it's untested and I'm pretty sure of my conversion on tickTime, but not completely sure.
-
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 };
-
You said script2 was only ran on the server right? You need to run the setVariable code on every player.
{_x setVariable ["deciderDone",nil,true];} forEach allPlayers;
-
Saw your edit:
_unit setVariable ["myVariable",nil,true]
-
You could add a timeout feature to the waitUntil as well to make absolute sure it is executed no matter what.
-
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.
-
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.
-
private _spawnHandle = [] spawn { private _script1Handle = [] execVM "script1.sqf"; waitUntil {scriptDone _script1Handle || isNull _script1Handle}; private _script2Handle = [] execVM "script2.sqf"; };
Recommend you use remoteExec over BIS_fnc_MP as well.
-
{ //@@@// 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.
- 2
-
Another way to skin the cat:
EDIT: Sorry if the format is bad, my phone is being an ass atm...
private _players = allPlayers select { getPlayerUID _x in MY_UID_LIST};
- 1
-
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.
- 1
-
{ private _handle = [_x] spawn { params ["_alarm"]; private _time = 10; while {alive _alarm} do { [_alarm,"Alarm_OPFOR"] remoteExec ["say3D",-2,false]; sleep _time; }; }; } forEach [alarm1,alarm2,alarm3];
Something like this?
- 1
-
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. -
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 . 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 .
- 1
-
Trigger condition:
!inflamed myFireplaceName
https://community.bistudio.com/wiki/inflamed
EDIT: Forgot the '!'.....
-
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 .
-
Hm, I don't see anything wrong with your code, so it's more than likely that it really is randomly picking logic5. I recommend you move to the scripting command version of that function, that may/may not change anything, but better nonetheless.
_loc = selectRandom [logic1, logic2, logic3, logic4, logic5, logic6]; myObject setPos (getPos _loc);
-
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....
-
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.
- 2
-
3 minutes ago, Ltf said:I'm glad you have things to do currently because I still haven't finished opfor textures it'll be ready probably next week
Lol, all good man I still haven't finished configing the blufor uniforms and masks :D.
MP Sidechat Problem
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
https://community.bistudio.com/wiki/sideChat
Make sure you have an ItemRadio assigned to everyone that needs to be able to see the message including the transmitting unit. Which is noted on the wiki page for side chat.
I also recommend you make the final parameter false for remoteExec, as your code is right now the unit will transmit over side chat, to every unit, every time someone joins the server.