-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
Is this mission broken for you too?
jshock replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
To add to HazJ's recommendation, if the mission is binarized, simply follow my instruction on a similar topic here: -
Double check your mods that you load in with, that they don't add some unwanted dependency. Then merge your mission over into a new, empty mission, re-save, move over all the scripts and such into the new mission folder, and you should be good to go.
-
I was lazy and read past most of these posts, but as Grumpy covered, a script by itself or script in mod form does little to change it's performance. I think without a proper configuration knowledge ALiVE can be a beast and eat performance for breakfast, lunch, and dinner. If you set it up properly and tune it where necessary, it can be an amazing tool. Where I think the people say ALiVE is shit is because ALiVE is majorly modular, it is not taylormade for every person's mission. So in some sense, when you don't need the full functionality of ALiVE, either using a simpler system or some script of your own could be better, not to mention using a standalone script you won't have the dependency. People just think that since ALiVE is a "big name" mod that it should work with everything and make certain things possible that are not.
-
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.
-
Limit the number of characters in a string
jshock replied to ColonelKernel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/BIS_fnc_trimString private _myShortString = [typeOf myVehicle,0,4] call BIS_fnc_trimString; -
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____~><____
-
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.
-
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.
-
Simple test to see if asset exists ?
jshock replied to scottb613's topic in ARMA 3 - MISSION EDITING & SCRIPTING
{ //@@@// 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. -
Selecting player object from server
jshock replied to Midnighters's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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}; -
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.
- 152 replies
-
- 1
-
- contamination
- gas mask
-
(and 8 more)
Tagged with:
-
Sound Loop/TriggerActivation
jshock replied to ironhawx's topic in ARMA 3 - MISSION EDITING & SCRIPTING
{ 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 reply
-
- 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 .
- 152 replies
-
- 1
-
- contamination
- gas mask
-
(and 8 more)
Tagged with:
-
trigger to fire when campfire as turned off
jshock replied to PSYKO_nz's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Trigger condition: !inflamed myFireplaceName https://community.bistudio.com/wiki/inflamed EDIT: Forgot the '!'..... -
BIS_fnc_selectRandom picks same one every time. Why?
jshock replied to Mynock's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 . -
BIS_fnc_selectRandom picks same one every time. Why?
jshock replied to Mynock's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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);