-
Content Count
1224 -
Joined
-
Last visited
-
Medals
Everything posted by dreadedentity
-
Squad leader Respawn almost working !
dreadedentity replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This should be what you're looking for (create a file and name it initPlayerLocal.sqf and copy and paste this code into it): player addEventHandler ["Respawn", //I believe this would be a better event handler for this situation { if (leader player != player) && {alive (leader player)}) then //make sure player is not the group leader and that the group leader is alive { _groupLead = leader player; player setPos ([_groupLead, 2, -(direction _groupLead)] call BIS_fnc_relPos); //not sure if this will work as I expect it to, if it doesn't, delete this line and remove the forward-slashes from the line below // player setPos ([_groupLead, 2, (direction _groupLead) * -1] call BIS_fnc_relPos); } else { systemChat "Group leader was not alive, you have respawned at base."; //If either condition is met, respawn the player at base //this will show the same message even if the player is the group leader, it will still work but look a little unrefined. "Of course the group leader was not alive, I WAS the group leader" }; }]; Be sure you set your mission's respawn type to "Base". You can do that in description.ext by typing: respawn = 3 //OR respawn = "BASE" For help setting up the respawn properly you can see the wiki page for description.ext here, and click here to go directly to the respawn entry (you will have to scroll up a little to see everything). -
Problem Throwing me for a loop
dreadedentity replied to austin_medic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Scripts return a script handle, nothing else. Try using a global variable/missionNamespace setVariable to "pipe" your results back to the parent thread (You can tell it's a script because it uses sleep, thus requiring a "spawn" or "execVM" to work prooperly) EDIT: Damn, I'm just too slow tonight -
I'll never understand how people think saying this and providing literally no details will get them a solution faster. This works 100% perfectly fine for me: waituntil {!(isNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler [ "KeyDown", " systemChat str _this; if (_this select 1 == 199) then { if ((typeOf player) isEqualTo 'B_RangeMaster_F') then { _open = player execVM 'dialogs\open_tablet_dialog.sqf'; } else { _open = player execVM 'dialogs\open_teleport_dialog.sqf'; }; }; " ]; I don't think there's an issue here. Also, -showScriptErrors @Ranwer you're not wrong, but originally displayAddEventHandler did not work if using a code variable type (in fact, in OFP that data type didn't even exist), you could only input a code string. That code will work just fine when using quotation marks, as long as one keeps in their mind the rules of nesting quotation marks in sqf. Frankly, I find it appalling that you can write something so condescending without even taking that bit of history into account. Also, when working with UI event handlers (_this select 0) will always return the display or the control. As somebody working on such a dialog-heavy mod you should've known that
-
List of all fonts supported in Dialogs?
dreadedentity replied to igneous01's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you have information about certain control types that is not mentioned on the wiki, I implore you do add it. It's a community-run wiki, either way. -
Drawing a circle checkpoint...
dreadedentity replied to bspendlove's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No, createVehicle is used to create objects in the worldspace. Use createMarker to add markers to the map through script -
Problem adding things into listboxes
dreadedentity replied to austin_medic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I agree with everything here. However, there is an easy fix: onLoad = "uiNamespace setVariable ['RopeSystem_dialog', (_this select 0)]; [] spawn AUSMD_ropeSystem_load"; AUSMD_ropeSystem_load = { waitUntil {!isNil {uiNamespace getVariable ["RopeSystem_dialog"];}; //other code }; As a side note: Back in the old forum, I would get logged out after about 15 minutes. I found this highly annoying and looked for answers anywhere so that I could just stay logged in permanently, I believe I've even mentioned my plight to a few other scripters either through teamspeak or steam chat. But, now since the change, I'm being kept logged in permanently. It's glorious, I rejoice daily. (I STILL WANT MY BLACK COLOR SCHEME BACK THO) Anyway, there's an easy fix for this too: Switch back to the forum and press F5 while you're typing, young one, as I had to for many many months. Welcome to hell -
Detecting if a variable in namespace is public
dreadedentity replied to fn_Quiksilver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I wrote a little function for you, unfortunately I don't have a server to test it on at the moment. I have no idea if it will work but it's been a while since I've tried anything crazy. testVar = { /* Params: P1: Array of objects - Should only be player units To easily get an array of all players use: _allPlayers = []; { if (isPlayer _x) then { _allPlayers pushBack _x }; }forEach allUnits; P2: Namespace - The namespace that you want to retreive a variable from P3: String - The name of the variable you want to retreive Example Call: [[_array,_of,_players], missionNamespace, "test"] call testVar; */ [ [[(_this select 1),(_this select 2)],{ _varResult = (_this select 0) getVariable [(_this select 1), "NULL"]; [[[_namespace, _variable, _varResult],{hintSilent format ["Variable Retrieved!\nNamespace: %1\nVarible: %2\nResult: %3",(_this select 0),(_this select 1),(_this select 2)]}], "BIS_fnc_call", 0, true] call BIS_fnc_MP; }], "BIS_fnc_call", owner ((_this select 0) call BIS_fnc_selectRandom), true ] call BIS_fnc_MP; }; It's (supposed) to work by picking out a random player from a list of players you provide, use BIS_fnc_MP to drop a code bomb on that player, he checks the variable, and sends a BIS_fnc_MP packet back to the server with the result. By the way, if the variable doesn't exist, it will show "NULL" (provided that this code works at all). By the way, this is not a recommended way to use BIS_fnc_MP. -
List of all fonts supported in Dialogs?
dreadedentity replied to igneous01's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Go to the wiki and type "DialogControls" into the search bar and wait for the smart matches to show up. There are wiki pages for every type of control, comprehensive information regarding them, and many (if not all) have a sample class that is perfectly ready to be added to description.ext and used. -
How to Script AI To "Talk Guns" With player
dreadedentity replied to policebear's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I realize that you might not have a lot of experience with scripting in Arma, however here is a little snippet that I cooked up: _state = [(weaponState soldier) select 1, "FullAuto"]; soldier doTarget player; sleep 1; for "_i" from 1 to 30 do { soldier forceWeaponFire _state; sleep 0.101; }; I don't have much time to expand on this, so I'm just going to dump it and see if anyone wants to go from here. To use that code, start a new mission and place a player and another (friendly) rifleman. Give him the name "soldier". Create init.sqf and copy and paste that code in it for some fun FF. -
Embed one custom gui in another gui
dreadedentity replied to celludriel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You might be interested in creating a controls group -
Overwriting FirstAidKits' action
dreadedentity replied to SirMrE's topic in ARMA 3 - MISSION EDITING & SCRIPTING
To all viewing this post, keep in mind that the current stable version of arma 3 is 1.48, in which this command does nothing. You must use the dev branch (99% of players don't even know this exists btw). -
Trigger to check when player leaves a vehicle
dreadedentity replied to chondo999's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well it doesn't work like that. !(player in (crew vehicleName)) -
Remote server calls safety
dreadedentity replied to celludriel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is literally not possible, computers handle every single command, one at a time, in the order of commands received. Computers cannot process 2 or more commands at the same time. No matter what programming language you are using. Anyway, 2 players both calling the same public variable event handler probably wouldn't overwrite the first event handler's variable (requires C++ knowledge to explain, because of the way objects work, namespaces and shit), however in the event that it did, it wouldn't matter anyway if you used the publicVariableServer command to send the data directly to the server (all clients ignore the incoming data or the data is only sent to the server, reducing network cost) instead of using simply publicaVariable. (I'm very drunk and not sure if any of this I just typed made sense to anyone.) -
Civilians Surrendering ONLY in Trigger Area
dreadedentity replied to pliskin124's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you Johnny, R3vo keep in mind when you are doing trigger work in the editor, you have access to 3 commands, this, thisTrigger, and thisList this: Refers to the trigger condition you set with the GUI menu. You can add extra extra conditions by using AND and OR: this && (myVar == 0) //requires GUI condition be met AND myVar is equal to 0 before the trigger will execute thisTrigger: Refers to the trigger object itself thisList: Refers to an array of objects that are currently making the condition true (This may be old information, but last time I used triggers, once the condition has been met it will not update and refresh thisList until the trigger has deactivated and is waiting for the condition to be met again) -
Dialog - Returning Mouse Drag?
dreadedentity replied to Ranwer135's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm not sure if it's possible to rotate the character using setDirAndUp in your dialog but if you can, this is the code you'd want to use. Add this to your picture box control definition: onMouseDown = "isMouseDown == true"; onMouseUp = "isMouseDown == false"; onMouseMoving = "[myObject, _this select 1, _this select 2] call rotate"; rotate function: rotate = { if (isMouseDown) then { _objectDir = _objectDir - (_this select 1); (_this select 0) setDir _objectDir; _objectPitch = (_objectPitch - (_this select 2)) max -90 min +90; [ (_this select 0), _objectPitch, 0 ] call bis_fnc_setpitchbank; objectDirPitchBank = [ _objectDir, _objectPitch, _objectBank ]; }; }; Note that it is not possible to set bank with this function, I haven't figured out the code to make that work yet, nor do I see any use for it in what you need it for. Also, make sure you define 2 global variables, "isMouseDown" and "objectDirPitchBank", with default values of false and [0,0,0], respectively. "myObject" should also be a global variable and refers to the actual man object you are rotating around. -
Civilians Surrendering ONLY in Trigger Area
dreadedentity replied to pliskin124's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The code I posted was meant to be directly copied/pasted into the "ON ACT." field of the trigger through the editor. You didn't specify which error you were getting after placing the code into a script file, but I assume the error had to do with the "thisList" command, since it would be undefined as the script has no knowledge of what "thisList" is. To fix this, you need to call the script and supply it with thisList, and also make some changes to the original script. copy to trigger "ON ACT." field thisList execVM "Surrender.sqf"; Edited code to work in a script: if ({side _x == west}count _this > 0) then //change "thisList" to "_this" { { if (side _x == civilian) then { _x switchMove "AmovPercMstpSsurWnonDnon"; _x disableAI "Anim"; }; } forEach _this; //change "thisList" to "_this" }; //forgot a semicolon on this line. This makes no sense to me, and I think it's absolutely wrong. -
Civilians Surrendering ONLY in Trigger Area
dreadedentity replied to pliskin124's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Make sure trigger activation is set to "ANY", then just paste this into the "ON ACT." field: if ({side _x == west}count thisList > 0) then //count objects in trigger and make sure at least 1 is blufor { { if (side _x == civilian) then //only affect civ's { _x switchMove "AmovPercMstpSsurWnonDnon"; _x disableAI "Anim"; }; } forEach thisList; //loop through array again } The last time I used the editor for actual mission making (or a trigger, really) was about a month after the alpha was released on steam, so I'm kind of hazy, but I think I remember that if a trigger condition has been satisfied it doesn't update until it deactivates, so there will be trouble because the civ's will activate it. Let me know if this happens and we can explore another way to do this. -
How to add current weapon w/ attachments to a box?
dreadedentity replied to MrSanchez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have also submitted a ticket for such a command. Still no word In the meantime you'll have to use KK's workaround of spawning a CIV unit on top of the crate, adding the weapon and attachments to him, and making him drop the weapon into the crate. Do note that the civ is visible long enough so that somebody could see him, to also work around this you'll want to spawn the crate and civ somewhere far away from where you expect people to be, move the weapon in, then move the crate to it's final location. -
playVideo and Sound Content?
dreadedentity replied to Kydoimos's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You're right, I'm not going to read a thread that's over a year old if I want to find up-to-date information. -
playVideo and Sound Content?
dreadedentity replied to Kydoimos's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You really shouldn't necro super old posts. That aside, are you sure you're converting the video to a codec that arma can actually use? Certain audio and video codecs can still be played, despite not being supported by whatever media player is being used. This can lead to strange behavior when trying to play a video. -
kill death ratio calculator
dreadedentity replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I rewrote your code so it's about 2x easier to read, but still contained in 16 lines: _get = call compile _get; _clientID = owner _unit; _get = (_get select 0) select 0; player_stats_add = [ parseNumber (_get select 0), //xp parseNumber (_get select 1), //kills parseNumber (_get select 2) //deaths ]; _clientID publicVariableClient "player_stats_add"; player_stats_got = 1; _clientID publicVariableClient "player_stats_got"; Anyway, I don't think this is the right place to add a kill/death calculation. It would be much better off making the receiving client do it, in which case you would add it to the Public Variable Event Handler "player_stats_add" addPublicVariableEventHandler { _variableName = /*_this select 1;*/ EDIT: _this select 0; _incomingData = _this select 1; //other code systemChat format ["Kills/Deaths ratio:\n%1",(_incomingData select 1)/(_incomingData select 2)]; }; Also, really? -
WARSIM - Persistent Military Careers [ALPHA]
dreadedentity replied to Kingsley1997's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I, for one, would like sept-weekly updates -
Brainstorm: Simple reusable mobilehq script
dreadedentity replied to celludriel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The syntax you are using for getVariable is wrong. _mhq getVariable "MhqDeployed"; //or _mhq getVariable ["MhqDeployed", false]; -
Fine tuning Support Request GUI
dreadedentity replied to lawman_actual's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Solution for #2: _string = ctrlText 1500; _number = parseNumber _string; //parse into number _string = str _number; //turn back into string, but a leading zero should be added in the event that the player did not have one. eg. ".1" should now be "0.1" _output = "Something went wrong."; if ((count _string) > 5) then { hint "Input is too long."; } else { _split = [_string, "."] call BIS_fnc_splitString; _integer = _split select 0; _decimal = _split select 1; //should always be correct since we parsed and re-stringed if ((count _integer) > 3) then { hint "Integer piece too long."; } else { if ((count _decimal) > 1) then { hint "Decimal piece too long."; } else { _output = _number; }; }; }; hint str _output; -
Dynamic numbered Rsc Slider
dreadedentity replied to lawman_actual's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You should familiarize yourself with User Interface Event Handlers, there is an event handler that's exactly what you need, onSliderPosChanged. To use a UI event handler, you need to define it in the control: class RscSlider_2000: RscSlider { idc = 2000; x = 0 * safezoneW + safezoneX; y = 0 * safezoneH + safezoneY; w = 1 * safezoneW; h = 1 * safezoneH; onMouseClick = "systemChat str _this;"; onMouseMoving = "systemChat str _this;"; onSliderPosChanged = "call myFunction;"; }; In the function you call when the event handler fires, a simple switch will be sufficient. To change the text of a control, you need to familiarize yourself with this page, ctrlSetText is the command you are looking for. To hide a control, ctrlShow.