-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
Merging five gear load out scripts into one?
jshock replied to vurelo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
With the following you pass in the unit that is being loaded out and the loadout type: //example exec line (in a unit's init line): [this,"RIFLEMAN"] execVM "chooseLoadout.sqf"; params ["_unit","_loadout"]; switch (toLower _loadout) do { case "rifleman": {[_unit] execVM "rifleman.sqf";}; case "sniper": {[_unit] execVM "sniper.sqf";}; case "missile specialist (at)": {[_unit] execVM "AT.sqf";}; case "missile specialist (aa)": {[_unit] execVM "AA.sqf";}; case "heavy gunner": {[_unit] execVM "heavygunner.sqf";}; case "combat life saver": {[_unit] execVM "medic.sqf";}; case "grenadier": {[_unit] execVM "grenadier.sqf";}; }; -
Merging five gear load out scripts into one?
jshock replied to vurelo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you post one of your loadout scripts here, and I assume they all follow the same general format aside from the actual gear in them? (At an actual computer now) -
Merging five gear load out scripts into one?
jshock replied to vurelo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Correct. And to use the above it would look something like: ["RIFLEMAN"] execVM "chooseLoadout.sqf"; -
Merging five gear load out scripts into one?
jshock replied to vurelo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
params ["_loadout"]; switch (toLower _loadout) do { case "rifleman": {/*gear script 1*/}; case "sniper": {/*gear script 2 */}; etc... }; On my phone, so it's hard to be more explicit. -
Merging five gear load out scripts into one?
jshock replied to vurelo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/switch -
What type of respawn are you using?
-
:ok:
-
Looking for a script that finds building names
jshock replied to linuxmaster9's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here is a small update to it, to check for any that return "", and it will place a marker on that position, so you can visually see where and what it is so possibly you can find the classname elsewhere: _buildingClasses = []; _trackerVar = 0;//just so you can see progression of the script, as well as how many classnames there are in the end _unknown = 0; _buildings = nearestObjects [[0,0,0],["Building"],(worldSize/2)]; { if !(typeOf _x in _buildingClasses) then { _buildingClasses pushBack (typeOf _x); _trackerVar = _trackerVar + 1; }; if (typeOf _x == "") then { _unknown = _unknown + 1; _mrk = createMarker [format["building%1",_forEachIndex],(getPos _x)]; _mrk setMarkerShape "ICON"; _mrk setMarkerColor "ColorBlack"; _mrk setMarkerType "hd_dot"; }; hintSilent str(_trackerVar); } forEach _buildings; diag_log str(_buildingClasses);//rpt copyToClipboard str(_buildingClasses);//clipboard hintC format ["Building Search Complete. Buildings Found: %1\nUnknown Found: %2",_trackerVar,_unknown]; -
Looking for a script that finds building names
jshock replied to linuxmaster9's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could try something like this, I'm not sure if it works, and it probably isn't very efficient overall, but it is a one and done deal so...: _buildingClasses = []; _trackerVar = 0;//just so you can see progression of the script, as well as how many classnames there are in the end _buildings = nearestObjects [[0,0,0],["Building"],(worldSize/2)]; { if !(typeOf _x in _buildingClasses) then { _buildingClasses pushBack (typeOf _x); _trackerVar = _trackerVar + 1; }; hintSilent str(_trackerVar); } forEach _buildings; diag_log str(_buildingClasses);//rpt copyToClipboard str(_buildingClasses);//clipboard hintC format ["Building Search Complete. Buildings Found: %1",count _buildingClasses]; -
https://community.bistudio.com/wiki/createVehicle_array
-
No need to setPosATL after the unit is already created on that position in the first place, and just for sake of, since I'm not sure if it makes a difference or not, the "special" parameter options are in all caps, so lets make that so: _pos = [14745.541,17.91,16732.02]; guard1 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"FORM"]; guard1 setDir 270;
-
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, with further testing, it seems the "center" of the flag pole is not at ground level, but halfway up the pole itself, therefore, on the distance check, the action doesn't show up until you are basically right on top of the flag pole, so for sake of it working, take out the distance check in the condition, leaving just the variable check: "(_this getVariable ['allowRecruitment',false])" -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That portion is the "shortcut" parameter for add action. https://community.bistudio.com/wiki/addAction Therefore leaving the actual condition parameter empty, allowing anyone to access the action. -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's not the script, I don't believe, the flag pole itself doesn't allow actions to be added....so....I have no clue if it's me or what, but it's definitely weird. -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, I would give up, call you crazy, and just leave this thread be.....however......I just made a quick test mission, and it seems addAction doesn't work on flag poles for whatever particular reason. I have a flag pole and an ammo crate with the same exact code in their init's, and two playable characters one with the variable "allowRecruitment" set to true, and the other without, yet, the pole had no action and the ammo crate had it. https://www.dropbox.com/s/8oskh3xrimkx2le/addAction_Test.VR.zip?dl=0 -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Instead of: _this == Raven_SL use- vehicleVarName _this == Raven_SL all together- "(_target distance _this) < 4 && _this getVariable ['allowRecruitment',false] && vehicleVarName _this == Raven_SL" -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It may be erroring out cause you need to use: https://community.bistudio.com/wiki/vehicleVarName vehicleVarName _this == Raven_SL -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So in the SL/TL init fields you put the following correct?: this setVariable ["allowRecruitment",true]; That should make it where the only units that can "see" the action are those that you put the above in their init fields. -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yea sorry, was working from my phone when I replied, hoping that you could figure it out :P: //in SL's init field this setVariable ["allowRecruitment",true]; //action this addAction [ "Acquisition Request for Personnel", "recruitment.sqf", nil, 6, true, true, "", "(_target distance _this) < 4 && _this getVariable ['allowRecruitment',false]" ]; And with what I said earlier I wasn't whole-fully clear on what you had done, but get/set variable would have been my preferred method anyhow. -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Use get/set variable in the init field of your SLs that you allow access, then adapt your condtion code with that -
addAction code to allow only certain players to use it. Should this work!
jshock replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, so long as "name of unit" is legitimate. -
Well, the action is "removed" whenever the player has less than 5 supplies, or at least, conditionally, it doesn't show up, but once you get 5 or more supplies again, it shows again. Or are you saying once they use the action, you want to remove it, so they don't use it again?
-
Use the condition parameter of addAction, no need for a loop to manage some addAction can do inherently: player addAction ["My Action",{/*code*/},nil,6,true,true,"","supplies >= 5"];I also recommend the use of get/set variable over a global variable instantiated in the init.sqf.
-
Check out each functions wiki page. https://community.bistudio.com/wiki/BIS_fnc_randomPos https://community.bistudio.com/wiki/BIS_fnc_taskPatrol
-
1. As long as you don't have 1000's upon 1000's of objects, it shouldn't be an issue. 2. This would be the main kicker, disabling simulation would help yes. But so long as simulation is enabled, FSMs will be running, which means those units are essentially "thinking", which each "brain" needs its own chunk of the pie that is the server/your machine. 3. Overall most scripts are relatively light and/or if they are heavy they aren't looped and are more of a "one and done" execution on init or on a particular event. As long as scripts are written correctly, looped or no, there shouldn't be an issue, but overall, I would avoid scripts that need to be looped constantly to provide a desired effect (particle effects for example). And for most of this I refer mostly to performance in multiplayer, singleplayer you have a lot more leeway when it comes to this stuff, and as with any multiplayer mission, the more clients, this less leeway.
- 8 replies
-
- 2
-
- Performance
- Tips
-
(and 3 more)
Tagged with: