-
Content Count
363 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by Magirot
-
It might work, but you'd need to use ' or "" instead of " as quotation marks inside a string (otherwise it ends the string there), also you were missing two quotation marks in the earlier paste. trigger setTriggerStatements["this", "[[[1], "spawn.sqf"],BIS_fnc_execVM",true,true] spawn BIS_fnc_MP;, ""]; -> trigger setTriggerStatements["this", "[[[1], 'spawn.sqf'], 'BIS_fnc_execVM', true, true] spawn BIS_fnc_MP;", ""]; Just thought to point this out, since it might help elsewhere.
-
Scripting (for randomness) in multiplayer
Magirot replied to SilentSpike's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The mission file and scripted locations use a different order in defining the axes, so it's currently creating the markers at an altitude of 11-17 km. If you switch around the last two values in each location, it should work. -
How to end a mission properly on dedicated?
Magirot replied to fett_li's topic in ARMA 3 - SERVERS & ADMINISTRATION
You could add enableDebugConsole = 1; in your description.ext, and then use the debug console to globally execute 'endMission "END1"' or '"END1" call BIS_fnc_endMission'. -
Latest or some recent version has chemlights and smoke grenades continuing to warp into the terrain sillily after they've hit the ground. Has this been reported yet?
-
In the latest version, at least in dedicated server MP, thrown chemlights and smoke grenades keep bouncing in and out of the terrain after they've hit the ground. Anyone else getting this? Edit: Crap, wrong thread. Sorry, ignore this.
- 5179 replies
-
- branch
- development
-
(and 1 more)
Tagged with:
-
Can a trigger size (both axis) be changed in a script?
Magirot replied to alleycat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Did you try setTriggerArea? ctrl+F in https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 usually helps in cases like this. -
Faster turnaround/iteration time for scripting
Magirot replied to Tvok's topic in ARMA 3 - MISSION EDITING & SCRIPTING
joinUnassigned = 0; in description.ext will skip this bit, if you meant that you choose the slot manually. What differences are there in testing in a non-dedicated server MP, and the editor's preview, by the way? Besides scripts like initServer, initPlayerLocal etc. being executed. -
What's the smart thing to do with tickets where the issue has been fixed ages ago? Should a note of the fix still be posted (in the process forcing more recent tickets off the front page), or should they just be ignored?
-
Getting a server to the Steam server browser?
Magirot replied to Magirot's topic in ARMA 3 - SERVERS & ADMINISTRATION
I can't find it on the Steam client browser either. Same thing when we tried to find my friend's server. For me, refreshing the Steam server browser seems to take take just as long as the game's own system, though, as in around 5 minutes. -
Getting a server to the Steam server browser?
Magirot replied to Magirot's topic in ARMA 3 - SERVERS & ADMINISTRATION
I gave the setting a quick try, but as I expected it didn't help. I'm not behind NAT, and I already tested with no firewalls (incl. Windows Firewall). :( -
How to make already activated trigger to affect JIP players?
Magirot replied to wontialo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's not the case, JIP players will receive public variables with their latest values when they join. You might be confusing it with how addPublicVariableEventHandler works. As .kju says in the wiki: "For JIP players pV'ed variables are received and set BEFORE the init.sqf." If you mean this: "When initialising a public variable to handle JIP, you will usually first want to check if the public variable has already been (broadcast, received and) set locally. Otherwise you may inadvertantly overwrite the broadcast value with your default value." then it shouldn't be an issue, because that's a warning for people using init.sqf to either 1) execute publicVariables on all clients, or 2) setting values regularly for variables that are later broadcast with publicVariable. In the first case the values would be broadcast and overwritten with the default values for everyone when a JIP player joins, in the second the JIP player will first receive the pV'd values, and then init.sqf will follow and set them back to the default on the JIP player's client. Just putting the initial values under an isServer condition and then broadcasting them is enough to avoid both scenarios. Dr_Eyeball's method is more optimal, since it doesn't use additional bandwidth, but with just a few broadcast variables I've not noticed a significant difference. Oh, sorry, I forgot this :( Initial trigger checks are done before init.sqf, so stuff probably occurs in the wrong order. First the player receives the publicVariable ambush values, then the triggers run and remove hideObject, and finally all units are hidden as init.sqf is executed (Edit: Especially with the 8sec sleep there delaying it further!) See the load order here - as far as I know, triggers are first checked at point 4 along with unit initialisation fields. Adding a short countdown (like 3sec) to the trigger that removes hideObject should be sufficient. Alternatively, as a little more complicated method, you could add individual checks to init.sqf (but I'd try the countdown first): In case you're curious, the variable setup that doesn't involve isServer or publicVariable that Onno mentioned above would be like this: The triggers should still use publicVariable to broadcast the values, if this is used. -
EmptyDetector is a classname (like "Land_Suitcase_F" in the createVehicle), changing it to something that's not defined in the game files means that no trigger is created, as far as I know.
-
It might also be because of the missing quotation mark in hint format ["3/3];, you can spot it nicely because of the syntax highlighting changing in the above post. I meant to ask this earlier, but is there a reason for specifically using _name = "intel"; call compile format["%1 = _intelCase", _name]; instead of intel = _intelCase;? They're the same thing. Edit: I see you also changed the trigger classname from EmptyDetector to CaseTrigger, was that intentional? I've never seen the latter used.
-
Like this, for example: definetriggerMP = { _this setTriggerActivation ["WEST", "PRESENT", false]; _this setTriggerArea [2, 2, 0, false]; _this setTriggerStatements ["player in thislist","nul = [intel,thistrigger] execVM 'scripts\intelPickup.sqf' ", ""]; }; in briefcaseintel.sqf: _trigE = createTrigger ["EmptyDetector", getPos _obj]; [_trigE, "definetriggerMP", true, true] spawn BIS_fnc_MP; That's because (_x getVariable ["intelVar", FALSE]) is missing ! before it - the purpose of the last FALSE is to define a default value if none is set. So it currently first checks if the variable exists -> it doesn't, so it sets it to FALSE -> checks if the variable is TRUE -> nope, next.
-
If you just change the isDedicated to isServer it becomes even worse, because it's followed by if (isServer) exitWith {}; So what it reads as is that the following script isn't executed if the caller is a dedicated/server. You probably wanted a "!" if (!isServer) exitWith {}; // stuff after this only runs on the server But: you should wrap the whole loop around isServer, because otherwise it'll will cycle pointlessly through allUnits on the player clients, just to execute scripts that deny the players running them on their first line. Also, using a trigger will still involve using BIS_fnc_MP, because while createTrigger can and should only be executed on the server, the following commands (setTriggerActivation, setTriggerArea, setTriggerStatements) have to be executed on the player clients. So you'd have to define a function for that purpose in either case.
-
You should try debugging it by temporarily adding hint "briefcaseintel.sqf executed"; at the very beginning, to make sure it's not hung on something else. I can't tell why it doesn't work, but as said, the solution of executing it on all clients has some problems: Passing through allUnits is a somewhat heavy operation which shouldn't be done where it's not needed createVehicle is a global command, so it'll create a briefcase for every player running the script (10 players = 10 briefcases) Same thing with createTrigger, though the result isn't as bad (and you actually do have to execute the statements, area etc for every player), it eats a bit more performance. I suggest the following chances: Put the loop under if isServer Instead of executing a script for every unit, add a onKilled event handler (as far as I know, it's lighter for the server than a waitUntil, which is basically a loop) Use it to add the addAction you were trying earlier init.sqf or similar: if isServer then { [] spawn { while {TRUE} do { { // forEach block start if (!isPlayer _x && !(_x getVariable ["unitHasIntel", FALSE])) then { _x addEventHandler ["Killed", {[_this select 0] execVM "scripts\briefcaseintel.sqf"}]; _x setVariable ["unitHasIntel", TRUE]; }; } forEach allUnits; sleep 30; // loops through all the units every 30 seconds }; }; }; briefcaseintel.sqf: hint "briefcaseintel.sqf executed"; // debug private ["_obj","_intelCase"]; _obj = _this select 0; _intelCase = createVehicle ["Land_Suitcase_F", _obj modelToWorld [0,0,0], [], 0, "can_collide"]; // the last TRUE (isPersistent) might become a drag on the server if this is executed on many units, // you might want to consider removing it even if JIP players cannot gather intelligence // for units killed before them connecting to the server [[_intelCase],"addactionMP", TRUE, TRUE] spawn BIS_fnc_MP; addactionMP (still has to be defined to all players in init.sqf for example) could be something like this: addactionMP = { private "_briefcase"; _briefcase = _this select 0; _briefcase addAction [ "<t color='#FF0000'>Gather Intel</t>", // action text { // what you want to execute, presumably at least _target = _this select 0; deleteVehicle _target; }, nil, // no additional arguments passed 10, // priority TRUE, // show action in the middle of the screen when its available TRUE, // hide the action menu when the action is used "", // shortcut key (none) // action executor cannot be in a vehicle and must be within 2m "vehicle _this == _this && _target distance _this < 2" ]; }; Probably full of wrong assumptions, please fix if necessary.
-
Yeah, either switch _this select 0 to _this in briefcaseintel.sqf, or _x to [_x] in the loop, and it should work. :) Why do you terminate the script if the caller is a dedicated server, though? Currently it would require every player to run the allUnits loop. Was there a problem with the addAction? Edit: Sorry, had the unrefreshed window open. Did you have ececVM instead of execVM in your tests, like in those snippets?
-
Weird, my code worked when I tried it. Are you sure it's not due to briefcaseintel.sqf trying to call the parameter from an array (_this select 0), or something like that?
-
isPlayer needs a parameter to check, I mean it has to be "isPlayer _x" or similar. Same thing is in your earlier snippet from Description.ext, actually. Anyway, the other forEach has no purpose there, and "allUnits _x" probably causes errors.
-
Sorry, misread. :( What does briefcaseintel.sqf do? Have you considered running it through init.sqf or something, instead of Description.ext / a function? if isServer then { [] [url="https://community.bistudio.com/wiki/spawn"]spawn[/url] { while {TRUE} do { { // forEach block start if (!isPlayer _x && !(_x [url="https://community.bistudio.com/wiki/getVariable"]getVariable[/url] ["intelVar", FALSE])) then { _x execVM "scripts\briefcaseintel.sqf"; _x [url="https://community.bistudio.com/wiki/setVariable"]setVariable[/url] ["intelVar", TRUE]; }; } [url="https://community.bistudio.com/wiki/forEach"]forEach[/url] [url="https://community.bistudio.com/wiki/allUnits"]allUnits[/url]; sleep 30; // loops through all the units every 30 seconds }; }; }; so many brackets
-
The wiki article: https://community.bistudio.com/wiki/Functions_Library_%28Arma_3%29 class CfgFunctions { class someTag { class someCategory { class my_fnc_briefcaseintel { file = "scripts\briefcaseintel.sqf"; preInit = 1; // or postInit }; }; }; }; File will be automatically called for all players.
-
Two questions| For loops and hints
Magirot replied to blasturbator's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's randomised every time. If you want to get a random number that stays the same throughout the script/scope (though still different for each player executing the script), assign it to a variable and refer to it afterwards. A random number also is a decimal number like "9.954", so you might want to round or floor it. _randomcache = round (random (0 + (paramsArray select 1))); The wiki article on random says: Edit: Wait, I misread, let me reread your script. The issue is probably that local variables are not passed outside the compile. You either have to use a global variable, like: call compile format ["randomcache = cache%1", round (random (0 + (paramsArray select 1)))]; or create an array of the cache names during the cache creation script, and call from there. -
How to make already activated trigger to affect JIP players?
Magirot replied to wontialo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's sadly the case. Feedback ticket here: http://feedback.arma3.com/view.php?id=17299 I think in your case the reason isn't that the trigger is "gone" when the Join-In-Progress players arrive, rather it hasn't been activated yet for them, because the trigger conditions and activation is checked separately for every player. Or at least that's the way they've come to bite me in the rear. Sickboy's locality guide for Arma 2 says: I mean that the trigger is there, but at the moment when they join no-one is fulfilling its condition, so it doesn't activate. So what you might want to try is to add this to your init.sqf: if isServer then { ambush_activated = FALSE; [url="https://community.bistudio.com/wiki/publicVariable"]publicVariable[/url] "ambush_activated"; } and change the ambush activation trigger's On Activation field to this: ambush_activated = TRUE; [url="https://community.bistudio.com/wiki/publicVariable"]publicVariable[/url] "ambush_activated"; and finally create a new trigger which has the unhiding and enable simulation stuff, and simply ambush_activated in its Condition field. That way JIP players don't have to walk to the trigger to activate it, rather the server passes the state of ambush_activated to them during joining, after which the trigger is activated as well. -
How to make bar gate indestructible in 3d editor
Magirot replied to Catalyst317's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not with the bar gate, at least, I just tried it. Makes me wonder if the command has other objects that have similar chances to fail. Edit: The command itself shouldn't run locally, though, at least according to wiki, so I assume it's related to the locality of the actual object. Or would it help to execute allowDamage through init.sqf, for example? -
How to make bar gate indestructible in 3d editor
Magirot replied to Catalyst317's topic in ARMA 3 - MISSION EDITING & SCRIPTING
this addEventHandler ["HandleDamage", {false}]; in the init field like you suggested. Half the time was out of four tries, though. I think I backed over it with a HEMTT in both cases.