-
Content Count
753 -
Joined
-
Last visited
-
Medals
Everything posted by 7erra
-
Mission Editing: Tracked Vehicle Insertion headaches
7erra replied to TAG_Mako's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try putting the driver of the vehicle in a different group and set him "CARELESS". The commander and gunner remain "AWARE" or "COMBAT". Play around with this idea eg putting the commander in single group etc. Not tested. -
zues using specific units/sides
7erra replied to Cryptdik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
removeAllCuratorAddons and then addCuratorAddons -
Just found this in the Arma 3 Respawn template section: class CfgRespawnInventory { class WEST1 { displayName = "Light"; // Name visible in the menu icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name // Loadout definition, uses same entries as CfgVehicles classes weapons[] = { "arifle_MXC_F", "Binocular" }; magazines[] = { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "SmokeShell" }; items[] = { "FirstAidKit" }; linkedItems[] = { "V_Chestrig_khk", "H_Watchcap_blk", "optic_Aco", "acc_flashlight", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio" }; uniformClass = "U_B_CombatUniform_mcam_tshirt"; backpack = "B_AssaultPack_mcamo"; }; class WEST2 { // Alternative configuration pointing to a CfgVehicles class. Loadout will be copied from it. vehicle = "B_soldier_AR_F" }; }; Pay attention to class WEST2: it redirects to an already existing standard loadout. Maybe you can change parts of the loadout by changing certain attributes like the displayName. Or it crahes your game and you are thrown back to the desktop.
-
Discrepancy between editor spawned smoke grenade and script spawned ones
7erra replied to Khabal's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The problem is that the type and effect of the module are only evaluated once when the module is placed or activated. Here are my tests: Placed 2 smoke grenade modules in editor, both non repeatable, smoke1 is yellow, smoke2 is blue. Test: Just what you expect. The command smoke1 setVariable ["type", "SmokeShellBlue"]; doesn't do anything Made the modules activated by a trigger No smoke as long as the trigger isn't triggered Activated trigger: same as (2.) Second try: No smoke, trigger not activated Execute smoke1 setVariable ["type", "SmokeShellBlue"]; Activate trigger Both smokes are BLUE I guess that this also works for the "repeat" variable, but as I said, the variables are only evaluated once and then passed to a script (which I can't find). Inside this script it might look like this: _module = _this; _smokeColor = _module getVariable "type"; // ... _repeat = _module getVariable "repeat"; // ... Similiar function from the other smoke module: I'm not too sure about this. The smoke grenade makes a sound when it drops (even with the module the first time). This isn't the case here. After the first grenade is spawned there is no other sound anymore. Though these are just educated guesses....- 4 replies
-
- setvariable
- script
-
(and 3 more)
Tagged with:
-
if (isserver) then { _veh = _this select 0; sleep (random 3); { if (!isPlayer _x) then { _x addBackpack "B_parachute"; unassignVehicle _x; (_x) action ["EJECT", vehicle _veh]; sleep 1; (_x) action ["openParachute", vehicle _veh]; } } forEach crew _veh; }; Will eject every AI unit even copilot, gunner, commander and pilot.
-
Use the cfgRespawnInventory in the description.ext: class CfgRespawnInventory { class myClass { displayName = ""; weapons[] = { }; magazines[] = { }; items[] = { }; linkedItems[] = { }; uniformClass = ; }; }; Here's an example (shamelessly stolen from here; @David77): You can use "CTRL+SHIFT+C" in the arsenal to export a loadout in this format.
-
In the init field of the unit you can put this: this addMPEventHandler ["MPRespawn", { _player = _this select 0; _player call BIS_fnc_cameraOld; }]; As soon as the unit respawns it is put in the old spectator mode.
-
zues using specific units/sides
7erra replied to Cryptdik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
There are some moduls ingame: I have never used them before but maybe you can workt it out. The "Manage Addons" module seems promising. I guess it is the function that @crewt proposed. -
Getting the AI to engage
7erra replied to charliereddog's topic in ARMA 3 - MISSION EDITING & SCRIPTING
// On Activation: { _x doTarget (thisList select 0); _x doFire (thisList select 0); } forEach [RB1_1, RB1_2]; Maybe? -
Look at scripts from servers
7erra replied to karver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The directory for MP missions is C:\Users\*username*\AppData\Local\Arma 3\MPMissionsCache. If you want to look in the files there you'll need a program that can open .pbo files eg http://www.armaholic.com/page.php?id=16369 Missions like KoTH are locked by the author so you can't steal their scripts but most missions are accessible. -
How to make a script loop forever
7erra replied to ZU23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
[]spawn { while {true} do { // The true condition can be changed to any value that returns true. Eg you can have a variable my_case_trueFalse which can be set to false if you want to stop the loop _moves = ["HubBriefing_loop", "HubBriefing_scratch", "HubBriefing_think", "HubBriefing_pointLeft"]; _playMove = selectRandom _moves; // select a random animation. chances are equal for every animation officierONU switchMove _playMove; sleep (random 5 +10); // waits at least 10 seconds and another 0-5 seconds. (so between 10 and 15 seconds) }; }; Here are some comments on my previous script to clarify. The loop runs infinitly, even after the unit dies (leads to some strange animations). -
Where's the difference to #include "test.sqf" ?
- 5 replies
-
- waituntil
- genericerrorinexpression
-
(and 1 more)
Tagged with:
-
In this instance you have an unscheduled environment which means you can't use sleep or waitUnitl commands. You have to spawn a script first. You are better off putting all the commands in the spawn part: (solution for your problem) null = [] spawn { myhandle = [] execVM "test.sqf"; waitUntil { scriptDone myhandle } }; Again unscheduled environment. Also the waitUntil {sleep 1; ...} only tells the engine to only check the condition once every second instead of once every 0.001 (?) seconds leading to a less resource consuming script.
- 5 replies
-
- 1
-
- waituntil
- genericerrorinexpression
-
(and 1 more)
Tagged with:
-
How to make a script loop forever
7erra replied to ZU23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
[]spawn { while {true} do { officierONU switchMove "HubBriefing_loop"; sleep 10.00; officierONU switchMove "HubBriefing_scratch"; sleep 10.00; officierONU switchMove "HubBriefing_think"; sleep 10.00; officierONU switchMove "HubBriefing_pointLeft"; sleep 10.00; }; }; This does work if you meant it that way. In your script there's no loop, therefore the last animation you called is running infinitely. -
Creating GUIs: Why does createDialog returns "False"?
7erra replied to Moldisocks's topic in ARMA 3 - MISSION EDITING & SCRIPTING
First: Include the defines.hpp first and then the dialogs.hpp: #include "defines.hpp" #include "dialogs.hpp" Secondly: Don't use GUI_GRID_ scale. It hasn't worked for me so far. Use safezone or absolute instead.- 30 replies
-
- gui
- createdialog
-
(and 2 more)
Tagged with:
-
No not atm and not planned as well. Maybe in the future sometime or even next week but not planned...
-
Executing a script on the cursortarget player
7erra replied to Robin Withes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you share your function too? Otherwise try: //Here i need to let a script run on _unit [[arguments], _yourFunction] remoteExec ["call", _unit]; -
With the following script you can see how many kills the player has got so far (MP only!): onPlayerRespawn.sqf: player setVariable ["Killstreak_Count",0]; player addEventHandler ["HandleScore", { params ["_unit","_object","_score"]; if !(_object isKindOf "MAN") exitWith {}; _killstreak = player getVariable "Killstreak_Count"; _killstreak = _killstreak +1; player setVariable ["Killstreak_Count", _killstreak]; systemChat str _killstreak; false }]; With _streak = player getVariable "Killstreak_Count"; You can return how many kills the player has got so far. Resets after every respawn.
-
parachuting spawns, giving items issues
7erra replied to Nathan Bruns's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here's an approach to spawn you in a certain height (1000m) with closed parachute: _startLoadout = getUnitLoadout player; player addBackpackGlobal "B_Parachute"; [player,1000] call BIS_fnc_halo; waitUntil {(getPos player) select 2 <= 2 && vehicle player == player}; player setUnitLoadout _startLoadout; This has to be executed in an environement which allows suspension, eg spawn or script. -
Create a "initPlayerLocal.sqf" (or use the init.sqf if you are in singleplayer) in your mission directory and put this in it: player enableSimulation false; // Player is not allowed to move while he can't see anything titleText ["", "BLACK FADED", 5]; // Black screen sleep 5; // Waits 5 seonds titleText ["", "BLACK IN", 5]; // Black screen dissapears player enableSimulation true; // Allows the player to move again ["LINE1","LINE2","LINE3","LINE4"] call BIS_fnc_infoText; // Shows your message The BIS_fnc_infoText limits the amount of lines you can use to 4. The fifth one is cut off. And welcome to the wonderawful world of scripting!
-
I'm pretty busy on workdays so don't expect me to answer on an instant. That aside here are some suggestions and questions: Have you checked locality? To execute scripts that send messages to a user you have to execute the script on the player. What exactly is not working? Does the trigger not fire or does the message not show? What environment are you running the mission on? Which type of server (dedicated/hosted/editor hosted)? If you have discord then you might be able to find me here: https://discord.gg/arma (ArmA3 official discord server)
-
Pff just 19 replies and it's "hot" apparently Simply start a conversation and done. Though I have to admit I needed too many trys. I guess it's time to go to sleep...
-
_nr = _this select 0; switch(_this select 0)do { case "1": { _trigger = _this select 1; missionNamespace setVariable [format["%1_hp", player], getDammage player]; missionNamespace setVariable [format["%1_loop", player], 1]; ["ErrorTitleAndText", ["Return to the zone! You have 15 seconds to return!", _exception]] call ExileClient_gui_toaster_addTemplateToast; for [{_i=15}, {_i > 0 && player in list _trigger}, {_i = _i-1}] do { ["ErrorTitleAndText", [(str _i +"...")]] call ExileClient_gui_toaster_addTemplateToast; sleep 1; }; while {(missionNamespace getVariable format[format["%1_loop", player]]) == 1} do { player setDamage (getDammage player + 0.05); hint "test dead"; sleep 1; }; }; case "2": { missionNamespace setVariable [format["%1_loop", player], 0]; player setDamage (missionNamespace getVariable format[format["%1_hp", player], 0]); }; }; No error here Btw I'm testing with this script since I don't have the exile mod: I just changed the ExileClient_gui_toaster_addTemplateToast syntax to systemChat syntax.
-
No put on deactivation 0 = ["2"] execVM "deadzone.sqf"; . The second parameter is only used in case "1" which only triggers when the trigger is activated.
-
_nr = _this select 0; switch(_this select 0)do { case "1": { missionNamespace setVariable [format["%1_hp", player], getDammage player]; missionNamespace setVariable [format["%1_loop", player], 1]; ["ErrorTitleAndText", ["Return to the zone! You have 15 seconds to return!", _exception]] call ExileClient_gui_toaster_addTemplateToast; for [{_i=15}, {_i > 0 && player in list YOURTRIGGER}, {_i = _i-1}] do { ["ErrorTitleAndText", [(str _i +"...")]] call ExileClient_gui_toaster_addTemplateToast; sleep 1; }; while {(missionNamespace getVariable format[format["%1_loop", player]]) == 1} do { player setDamage (getDammage player + 0.05); hint "test dead"; sleep 1; }; }; case "2": { missionNamespace setVariable [format["%1_loop", player], 0]; player setDamage (missionNamespace getVariable format[format["%1_hp", player], 0]); }; }; Changed you structure. Added a for loop with condition (also makes the script tidier), removed the spawn {}; structure, moved the commands that should only be executed at the beginning out of the while loop. You have two choices now: You can either name your trigger "YOURTRIGGER" or whatever you like (global variable) or you can call the script in the activation with // OnActivation: 0 = ["1", thisTrigger] execVM "deadzone.sqf"; and use this script which is a bit more elegant since you don't have to use a global var: _nr = _this select 0; switch(_this select 0)do { case "1": { _trigger = _this select 1; missionNamespace setVariable [format["%1_hp", player], getDammage player]; missionNamespace setVariable [format["%1_loop", player], 1]; ["ErrorTitleAndText", ["Return to the zone! You have 15 seconds to return!", _exception]] call ExileClient_gui_toaster_addTemplateToast; for [{_i=15}, {_i > 0 && player in list _trigger}, {_i = _i-1}] do { ["ErrorTitleAndText", [(str _i +"...")]] call ExileClient_gui_toaster_addTemplateToast; sleep 1; }; while {(missionNamespace getVariable format[format["%1_loop", player]]) == 1} do { player setDamage (getDammage player + 0.05); hint "test dead"; sleep 1; }; }; case "2": { missionNamespace setVariable [format["%1_loop", player], 0]; player setDamage (missionNamespace getVariable format[format["%1_hp", player], 0]); }; };