-
Content Count
254 -
Joined
-
Last visited
-
Medals
Everything posted by HallyG
-
[Question] Finding and Manning a Static Weapon in Dynamic Composition
HallyG replied to doubleblind's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The nearestObjects command was returning a sign object. Change it to this: _newUnit = _group createUnit [_units select 0, _group, [], 0, "NONE"]; _newUnit moveInGunner ((nearestObjects [position _newUnit, ["car", "armored", "static", "staticWeapon"], 50]) select {(_x emptyPositions "gunner") > 0} select 0); _newUnit assignAsGunner ((nearestObjects [position _newUnit, ["car", "armored", "static", "staticWeapon"], 50]) select {(_x emptyPositions "gunner") > 0} select 0); -
[Question] Finding and Manning a Static Weapon in Dynamic Composition
HallyG replied to doubleblind's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try using the orderGetIn command -
How To Make A Custom Player Inverntory
HallyG replied to thoops99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is an example of a custom inventory system using a simple GUI and some scripting. This video is from an old project of mine. I made a quick video for you - excuse the poor quality, my computer is slowly dying. -
Don't have my computer setup right now so I can't check. I think it might be because I, stupidly, have two variables with the same name in "cloaking\init.sqf". Try changing it to this: if (!hasInterface) exitWith {}; if (isNil "HALs_cloak_init_done") then { { missionNamespace setVariable [ _x select 0, compileFinal (preprocessFileLineNumbers (_x select 1)) ]; } count [ ['HALs_cloak_cloak','cloaking\functions\HALs_cloak_cloak.sqf'], ['HALs_cloak_gui','cloaking\functions\HALs_cloak_gui.sqf'], ['HALs_cloak_handle','cloaking\functions\HALs_cloak_handle.sqf'], ['HALs_cloak_init','cloaking\functions\HALs_cloak_init.sqf'], ['HALs_cloak_progress','cloaking\functions\HALs_cloak_progress.sqf'] ]; HALs_cloak_init_done = true; }; Obviously you'll need to change the file paths if it's different in your setup. Additionally change the bit in the initPlayerLocal.sqf from: waitUntil {!(isNil "HALs_cloak_init")}; to: waitUntil {!(isNil "HALs_cloak_init_done")};
-
Here we go. I'm pretty sure the issue was respawn because, from what I remember, you respawn on start with Exile. Reworked it so respawn should be fine now. Additionally, the cloak will deactivate if you remove the required clothing while it is active.
-
I'll have a [more in depth] look when I have some free time. I'm moving house currently so, needless to say, I seldom have free time. However, I've uploaded a version to dropbox which I have updated for you today. It seemed to work in multiplayer apart from the particle effects. I haven't bothered to script for the player respawning but I'll do that in the near future. This version has various improvements which I'll probably update this post later with a list of them. It is by no means finished but I thought I may as well post it for anyone who is still interested.
-
Apply alignment to structured text without losing linebreaks.
HallyG replied to prykpryk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Pryk_fnc_hitTranspose = { private _arr = getAllHitPointsDamage _this; private _arrNew = (_arr select 0) apply { format ["%1: %2%3", _x, round ((_this getHitPointDamage _x) * 100), "%"] }; private _text = _arrNew joinString "<br/>"; _text = parseText ("<t align='left'>" + _text + "</t>"); _text; }; Just an alternative using different commands. :) -
I saw this topic earlier today so I thought I'd find some stuff I had been messing around with before with an idea similar to this - I tried something exponential but the effect falls off quite quickly (outside of the 'inner zone'): h = [] spawn { private _origin = getPos player; private _innerRadius = 5^2; private _outerRadius = 25^2; // second number is distance to half intensity from previous value private _constant = -(0.69315 / 5); private _fnc_round = { round ((_this select 0) * (10 ^ (_this select 1))) / (10 ^ (_this select 1)) }; while {true} do { _distance = player distanceSQR _origin; _radiation = 1; if (_distance > _innerRadius) then { _radiation = 1 * exp (_constant * sqrt (_distance - _innerRadius)); }; _radiation = [_radiation max 0 min 1, 2] call _fnc_round; _damage = _radiation call { if (_this > 0.7) exitWith {1/30}; if (_this > 0.3) exitWith {1/90}; if (_this > 0) exitWith {1/150}; 0 }; hintSilent format [ "Distance from centre: %1\nRadiation: %2\nDamage: %3%4", sqrt _distance , _radiation, _damage * 100 * 0.1, "%" ]; sleep 0.1; }; }; Also, the 'radiation' extends beyond the 'outer zone' (can fix with some minor adjustments, mind). You could maybe do something like the following: h = [] spawn { _origin = getPos player; private _innerRadiusSQR = 5^2; private _outerRadiusSQR = 25^2; while {true} do { _radiation = linearConversion [_innerRadiusSQR, _outerRadiusSQR, player distanceSQR _origin, 1, 0, true]; _damage = _radiation call { if (_this > 0.7) exitWith {1/30}; if (_this > 0.3) exitWith {1/90}; if (_this > 0) exitWith {1/150}; 0 }; hintSilent format [ "Distance from centre: %1\nRadiation: %2\nDamage: %3%4", sqrt (player distanceSQR _origin) , _radiation, _damage * 100 * 0.1, "%" ]; sleep 0.1; }; }; The 'radiation' is based on distance from origin and doesn't take into account players previous radiation. Damage also takes into account the players radiation. Anyways, this is just my two cents, might help op with deciding which method is preferable
- 230 replies
-
- contamination
- gas mask
-
(and 6 more)
Tagged with:
-
Saving Eden/Editor placed objects to a script for spawning later?
HallyG replied to Sphereo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have a look at this -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Brilliant - Thanks for taking the time to write such a detailed explanation. Will give this a more thorough look when I have some free time later on today -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Glad you got it solved- I was definitely over complicating it! -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Okay so essentially, you're running the script on each client, then the action is being added to each client on each client hence the multiple actions. It's probably best to try and make it server sided then try that. Try this (I'm at work so i can't test any of this, sorry): After: [radiocar, a1] remoteExec ["removeAction", 0, true]; Put: missionNameSpace setVariable ["a1", false, true]; -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
How are you calling those scripts above? If you're using BIS_fnc_MP to call them then, the remoteExec will be executed multiple times meaning multiple addactions on each player. A quick fix, although it won't stop what I mentioned above, (UNTESTED): [ [], { if ((missionNameSpace getVariable ["a1", false]) isEqualType false) then { private _a = radiocar addaction ["déploy radio", { [[_this, "deploy.sqf"], "BIS_fnc_execVM", true] call BIS_fnc_MP; }]; missionNameSpace setVariable ["a1", _a]; }; } ] remoteExec ["call", 0, true]; -
Woah Woah Woah BI. Trying to sneak one in?
HallyG replied to uncookedzebra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
playSound3D [ format ["%1%2", [(str missionConfigFile), 0, -15] call BIS_fnc_trimString, "music\sound1.ogg"], player ]; -
Multiplayer Texture Respawn
HallyG replied to warbirdguy1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It will only run once, upon the unit's respawn..? Well the wiki doesn't have anything about it being run on the server, it's global so should work on clients too. // Edit: Oh I think you meant running again due to it being put in the init of an editor unit. My bad, I don't use the editor much. -
Woah Woah Woah BI. Trying to sneak one in?
HallyG replied to uncookedzebra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Look at what I posted above, 2 hours ago. It won't show a file error. Use the absolute path instead of the relative path. -
Multiplayer Texture Respawn
HallyG replied to warbirdguy1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If it's multiplayer, you need to use setObjectTextureGlobal. Add this to the unit's init: 0 = this addEventHandler ["Respawn", { params ["_unit", "_corpse"]; private _textures = getObjectTextures _corpse; _unit setObjectTextureGlobal [0, _textures select 0]; }]; Untested but this is the general idea // Edit Oh, Davidoss already replied. woops -
spawning an infantry squad when a trigger is acrivated.
HallyG replied to WurschtBanane's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Although these forums are here for people to help each other, it's important that you search to see if an answer, to your question, exists before you post: HERE -
Woah Woah Woah BI. Trying to sneak one in?
HallyG replied to uncookedzebra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You need the absolute path to the sound file for playSound3D. Try: format ["%1%2", [(str missionConfigFile), 0, -15] call BIS_fnc_trimString, "music\sound1.ogg"]; Instead of: "\music\sound1.ogg" See the notes here. // Edit Also, you're separating lines with commas instead of using semi-colons. -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
addAction has local effects. You need to add the action to all clients. As far as I know, you can't return the actionID when you remoteExec so try this: [ [], { private _a = radiocar addaction ["Remove Radio", { [[_this, "deployed.sqf"], "BIS_fnc_execVM", true] call BIS_fnc_MP; }]; if ((missionNameSpace getVariable ["a2", false]) isEqualType false) then { missionNameSpace setVariable ["a2", _a, true]; }; } ] remoteExec ["call", 0, true]; -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Replace the removeAction bit with: [radiocar, a1] remoteExec ["removeAction", 0, true]; This might work, can't test right now Edit - I was being an idiot. Changed code -
AddAction multiplayer for allplayers
HallyG replied to unidad2pete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
removeAction has local effects. You need to broadcast it to all clients. -
shhh that makes me look bad for not checking his links :o
-
Loot system (Configurable Loot script)
HallyG replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
With the script you don't need to add your magazines to the array, it automatically takes the weapon's compatible magazines from the config. The only reason why I changed it was so you could put explosives in the array and they would still spawn- as far as I know explosives don't have a weapon which they originate from- because explosives items (until they are placed) are registered as magazines by the game and as such don't have a cfgWeapons class. -
Loot system (Configurable Loot script)
HallyG replied to bangabob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's odd. Weapons seem to be spawning with magazines for me: I did change the following lines, assuming the original classnames are correct, to: case 0: { _holder addWeaponCargoGlobal [_weapon, 1]; private _arr = getArray _magazines; _holder addMagazineCargoGlobal [selectRandom _arr, 2]; }; case 1: { private _arr = getArray _magazines; _holder addMagazineCargoGlobal [ [ selectRandom _arr, _weapon ] select (_arr isEqualTo []), 2 ]; };