Jump to content

Joshua9797

Member
  • Content Count

    54
  • Joined

  • Last visited

  • Medals

Community Reputation

38 Excellent

About Joshua9797

  • Rank
    Lance Corporal

Profile Information

  • Gender
    Male
  • Location
    Germany

Contact Methods

  • Steam url id
    https://steamcommunity.com/id/Joshua9797/myworkshopfiles/?appid=107410

Recent Profile Visitors

542 profile views
  1. Hi, if, as you mentioned, you have a few fixed positions and simply want to get one of them randomly, I recommend using selectRandom. selectRandom picks a random element from an array. In your case, you can simply create an array with positions: _pos1 = [123, 456, 789]; _pos2 = [123, 456, 789]; _pos3 = [123, 456, 789]; _pos4 = [123, 456, 789]; _randomPos = selectRandom [_pos1, _pos2, _pos3, _pos4];
  2. There is probably a much better way, but the following worked quite well in a multiplayer mission: I placed a small placeholder object at the desired position and named it myLightPos1. Then, I added the following code in initPlayerLocal.sqf: _myLight = "#lightpoint" createVehicleLocal getPos myLightPos1; _myLight setLightColor [0,0,0]; _myLight setLightAmbient [0.8,0.3,0.1]; _myLight setLightBrightness 2.45; deleteVehicle myLightPos1; I used the following page to set the values for setLightAmbient[]: https://www.tug.org/pracjourn/2007-4/walden/color.pdf
  3. Hi, unfortunately I can't test the code at the moment, but the following should give a rough idea of how the whole thing could be rewritten with "spawn" and loops: LFT_startCarLoops = { params ["_cityAreaArray", "_percent", "_carTypeArray", "_deletionRange", "_spawnRange"]; //checkPlayerProximityForCarsLoop [_cityAreaArray, _percent, _carTypeArray, _spawnRange] spawn { //The code in Spawn runs separately from the rest of the code. This means that there is no waiting for the end of the while loop. //Since the private variables within the spawn are not known, we provide them as parameters. params ["_cityAreaArray", "_percent", "_carTypeArray", "_spawnRange"]; while {true} do { //endless loop (It would be better if there was a real ending condition). [_cityAreaArray, _percent, _carTypeArray, _spawnRange] call LFT_CheckPlayerProximityAndSpawnCars; sleep 1; //Without a short break between loops, the game's performance would suffer greatly. }; }; //checkCarsProximityLoop [_deletionRange] spawn { params ["_deletionRange"]; while {true} do { [_deletionRange] call LFT_CheckCarsProximity; sleep 1; }; }; }; LFT_CheckPlayerProximityAndSpawnCars = { params ["_cityAreaArray", "_percent", "_carTypeArray", "_spawnRange"]; <Some code> };
  4. Joshua9797

    Keyframe on Trigger

    Hi, the magical function is called "BIS_fnc_timeline_play". You need to provide the variable name of the timeline to it: [MyTimeline] call BIS_fnc_timeline_play; I would like to mention that, to my knowledge, timelines do not work in multiplayer. For MP, I always make myself the object and record the movement with BIS_fnc_unitCapture.
  5. Hi, this might help: private _spawnPoint = getMarkerPos "_markerCordon"; //The midpoint (marker) at which units are spawned. private _amount = 3; //The amount of units to spawn. private _radius = 30; //The radius in which the units are spawned (from the midpoint). private _unitTypes = ["B_Soldier_F", "B_Pilot_F", "B_Survivor_F", "armst_blinddog2"]; //the types(classnames) of units to be spawned (see CfgVehicles e.g. https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_EAST) //You can see the class name in the editor if you hover over the unit in the list on the left. //or you get the class name with "typeOf" e.g.: typeOf player private _group = createGroup east; //The group into which the units are spawned.(Determines the side) for [{private _i = 0}, {_i < _amount}, {_i = _i + 1;}] do { private _randomTyp = selectRandom _unitTypes; //the typ of Unit to be spawned private _myAI = _group createUnit [_randomTyp, [0,0,0], [], 0, "NONE"]; //spawn the unit at the first available free position nearest to [0,0,0] private _randomPos = (_spawnPoint getPos [_radius * sqrt random 1, random 4000]); _myAI setPosATL (_randomPos); //sets the position relative to the terrain. [_myAI, (random 360)] remoteExec ["setDir"]; //set a random dir };
  6. I just tested the version with the new diary. Unfortunately, you have to attach the AddAction to the vehicle because it's not visible on the driver from the outside. I also added a condition so that the action is no longer visible once it has been executed. Otherwise, you could add an infinite number of diaries. Please use the adjusted code: if (isServer) then { JFR_Diary_created = false; publicVariable "JFR_Diary_created"; [_newPoliceTruck, ["Talk to", { ["New Diary added!"] remoteExec ["hint"]; _newDiaryTitle = "New Infos"; _newDiaryText = "My new Diary Text<br/><br/>This is the new Text in a new line"; { [_x, ["Diary", [_newDiaryTitle, _newDiaryText, "\a3\missions_f_oldman\data\img\holdactions\holdAction_talk_ca.paa"], taskNull, "", true]] remoteExec ["createDiaryRecord"]; } forEach allPlayers; JFR_Diary_created = true; publicVariable "JFR_Diary_created"; } , [], -1000, true, true, "","(JFR_Diary_created == false) && (_this distance _target < 5)"]] remoteExec ["addAction"]; };
  7. Another idea would be to create a new diary entry: if (isServer) then { [_newDriver, ["Talk to", { ["New Diary added!"] remoteExec ["hint"]; _newDiaryTitle = "New Infos"; _newDiaryText = "My new Diary Text<br/><br/>This is the new Text in a new line"; { [_x, ["Diary", [_newDiaryTitle, _newDiaryText, "\a3\missions_f_oldman\data\img\holdactions\holdAction_talk_ca.paa"], taskNull, "", true]] remoteExec ["createDiaryRecord"]; } forEach allPlayers; } , [], -1000, true, true, "","(_this distance _target < 5)"]] remoteExec ["addAction"]; };
  8. 1) With a setDir after createVehicle: _dir = 300; _newPoliceTruck, _dir] remoteExec ["setDir"]; 2) The following adds an action to the driver (mouse wheel menu). When this is selected, a hint will be displayed for all players and the task description will be changed. (Please assign the task a unique ID (variable name), e.g., "TSK_myTask"). if (isServer) then { _newTaskDescription = "new description text"; [_newDriver, ["Talk to", { ["Mission description was changed!"] remoteExec ["hint"]; ["TSK_myTask", [ _newTaskDescription, (("TSK_myTask" call BIS_fnc_taskDescription) select 1), (("TSK_myTask" call BIS_fnc_taskDescription) select 2) ]] call BIS_fnc_taskSetDescription; } , [], -1000, true, true, "","(_this distance _target < 5)"]] remoteExec ["addAction"]; }; (I am currently unable to test the code)
  9. I think the easiest way would be to place everything in the editor beforehand, make it invisible, and disable the simulation. (This will also remove the collision). You can either check the boxes under the attributes or use the Hide/Show module. Then, you can make everything visible again at a certain point via a trigger. You can either embed the code directly in the trigger or link the module to the trigger. If you still want to spawn the vehicles and NPCs, I recommend looking into createVehicle, createUnit, and setDir. _side = east; private _group = createGroup _side; _spawnPoint = [0,0,0]; _myAI = _group createUnit ["O_Soldier_F", _spawnPoint, [], 0, "NONE"]; [_myAI, 300] remoteExec ["setDir"];
  10. Joshua9797

    Hold Action Animation

    Have you already tried other functions like switchMove or BIS_fnc_ambientAnim? Apparently, some animations can only be played with certain functions. I think there was some kind of naming convention that indicated this. In any case, I would try BIS_fnc_ambientAnim, as it is listed in the wiki in connection with the animation: https://community.bistudio.com/wiki/BIS_fnc_ambientAnim [_caller,"REPAIR_VEH_KNEEL","ASIS"] call BIS_fnc_ambientAnim;
  11. Joshua9797

    RemoteExec a Function

    If it helps, I have used this for a simple confirmation: player addAction ["End Mission", { private _result = ["Do you want to end the mission?", "End Mission", "Yes", "No"] call BIS_fnc_guiMessage; if (_result == true) then { ["end1", true , 3, true, true, true] remoteExec ["VN_fnc_endMission", 0]; }; }, nil, 7, false, true, "", ""];
  12. Joshua9797

    JIP not showing addAction

    Hi, I could imagine that you need to set the trigger to repeatable (a checkbox in the trigger). Alternatively, I would suggest moving the addAction to the script "initPlayerLocal.sqf" and adding the activation of the trigger as a condition for showing the action. initPlayerLocal.sqf: Executed locally when a player joins the mission (includes both mission start and JIP). The trigger activation can be added as a condition for the display as follows: ptboat addAction ["Equip SCUBA Gear", "scubagear.sqf", nil, 7, false, true, "", "_this in (crew _target) && !scubaEquipped && triggerActivated myTrigger"]; If the players spawn in the trigger and you only use it for adding the addAction, you can also leave out the condition “triggerActivated myTrigger”.
  13. I just copied the code from above. But I guess that's not the problem then. Unfortunately, I have never executed my own function with remoteExec, but only an entire sqf file. The documentation says: "while any function or command can be used here, only those allowed by CfgRemoteExec will actually be executed" Maybe that is the problem? if this helps, a call to the file should look like this: ["fn_updateAttackMarker.sqf", [westAttackSector]] remoteExec ["execVM",west,"JIPwest"]; But you already said that it works with a 0 instead of “west”… Very strange.
  14. Only thing i can imagine is that these strange invalid characters have somehow made their way into the code. You can get rid of them by removing the red dots when you paste the code here in the forum and then copying the cleaned code again.
  15. Joshua9797

    Remote Exec Play music?

    To trigger the end of the mission, entering the following into the console on the server was enough: ["", 132] call BIS_fnc_playMusic; NUP_points_BLUFOR = 5; publicVariable "NUP_points_BLUFOR";
×