Jump to content

ribera1945e

Member
  • Content Count

    25
  • Joined

  • Last visited

  • Medals

Everything posted by ribera1945e

  1. Hello. I am making a PiP script that runs on a dedicated server. It works as intended in the preview, but not in multiplayer. Below is the code: I have implemented zoom and PiPEffect change functions using addAction, but changes to the monitor are not synchronized in multiplayer. Thanks.
  2. Apparently I was writing unnecessary processing. If you change the processing of the initial value, JIP will also be synchronized. I've finally got the code to work as intended in JIP-enabled multiplayer, so I'll share it: /*----------------------------------------------------------------------------------- Script: liveFeedUAV Description: UAVのカメラフィードバックをモニターオブジェクトに行う。 Parameters: _monitor - <OBJECT> フィードバック再生とaddActionを行うオブジェクト Return: Nothing Examples: (in initPlayerLocal.sqf) nul = [yourMonitor] execVM "scripts\liveFeedUAV1.sqf"; (in init.sqf) [missionNamespace, "arsenalClosed", { [yourMonitor] execVM "scripts\liveFeedUAV1.sqf"; }] call BIS_fnc_addScriptedEventHandler; ["ace_arsenal_displayClosed", { [yourMonitor] execVM "scripts\liveFeedUAV1.sqf"; }] call CBA_fnc_addEventHandler; Author: ribera1945eBP -----------------------------------------------------------------------------------*/ params ["_monitor"]; if (isNull _monitor) exitWith {}; sleep 1; if (localNamespace getVariable ["liveFeedUAV1done", false]) exitWith { _cam1 = (localNamespace getVariable "cam1"); _cam1 cameraEffect ["Internal", "Back", "uavrtt1"]; }; _monitor setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt1,1)"]; _cam1 = "camera" camCreate [0,0,0]; _cam1 cameraEffect ["Internal", "Back", "uavrtt1"]; _cam1 attachTo [MQ_1, [0,0,0], "PiP0_pos"]; localNamespace setVariable ["cam1", _cam1]; liveFeedUAV1cams = []; fnc_selectZoom = { private _sZoom = _this select 0; private _cam1 = _this select 1; switch (_sZoom) do { case "ULTRA WIDE": { missionNamespace setVariable ["zoomLevel", 0.46599999, true]; }; case "WIDE": { missionNamespace setVariable ["zoomLevel", 0.2, true]; }; case "MEDIUM": { missionNamespace setVariable ["zoomLevel", 0.1, true]; }; case "NARROW": { missionNamespace setVariable ["zoomLevel", 0.02, true]; }; case "NARROWER": { missionNamespace setVariable ["zoomLevel", 0.01, true]; }; }; }; fnc_selectMode = { private _sMode = _this select 0; switch (_sMode) do { case "DTV": { missionNamespace setVariable ["camMode", [0], true]; }; case "NV": { missionNamespace setVariable ["camMode", [1], true]; }; case "WHOT": { missionNamespace setVariable ["camMode", [2], true]; }; case "BHOT": { missionNamespace setVariable ["camMode", [7], true]; }; }; }; { private _actionTitle = format ["Select Zoom - %1",_x]; _monitor addAction [ _actionTitle, { private _Value = _this select 3 select 0; [_Value, (localNamespace getVariable "cam1")] call fnc_selectZoom; }, [_x],3.3,true,false,"","",8 ]; } forEach ["ULTRA WIDE", "WIDE", "MEDIUM", "NARROW", "NARROWER"]; { private _actionTitle = format ["Select Mode - %1",_x]; _monitor addAction [ _actionTitle, { private _Value = _this select 3 select 0; [_Value] call fnc_selectMode; }, [_x],3.3,true,false,"","",8 ]; } forEach ["DTV", "NV", "WHOT", "BHOT"]; localNamespace setVariable ["liveFeedUAV1done", true]; 0 = liveFeedUAV1cams pushBack [localNamespace getVariable "cam1"]; addMissionEventHandler ["Draw3D", { { _cam1 = _x select 0; _dir = (MQ_1 selectionPosition "laser_start") vectorFromTo (MQ_1 selectionPosition "laser_end"); _cam1 setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ]; _cam1 camSetFov (missionNamespace getVariable ["zoomLevel", 0.46599999]); "uavrtt1" setPiPEffect (missionNamespace getVariable ["camMode", [0]]); } count liveFeedUAV1cams; }]; There is still a possibility of optimization, but this is the end for the time being. @7erra @pierremgi Thanks for teaching me a lot!
  3. Thank you for the detailed lecture. I thought that everything would work if remoteExec was done. Please forgive the script rookie. Now I'm running camSetFov and setPiPEffect in Draw3D. This works as intended in multiplayer. However, JIP still seems to be loading the initial values of zoomLevel and camMode. I want to borrow your wisdom once again. Thanks.
  4. That's exactly what I'm looking for. Everyone should have the same picture regardless of who set it. fnc_selectZoom is currently only run by the server, does that mean cam1 doesn't match that of the local machines? Also, does cam1 need to be private? Thanks.
  5. @7erra Thank you for your reply. I wrote !IsServer at the beginning to prevent addAction from running on all machines. I modified the code based on your point: But fnc_selectZoom stopped working in preview. I don't get an error, but camSetFov doesn't seem to recognize cam1. What should I do?
  6. I created a UAV live feed script based on this tutorial. However, I noticed that when I opened Arsenal while it was working, the monitor screen went black. Is there a way around this?
  7. ribera1945e

    [solved]PiP script and arsenal

    Thank you for your reply. Your code helped me understand the code delays in arma3. I solve the problem by simply adding sleep 1 to my code. thank you for your politeness.
  8. ribera1945e

    [solved]PiP script and arsenal

    It works in the debug console but not in the if statement. Help me
  9. ribera1945e

    [solved]PiP script and arsenal

    I gave up on how to execute code inside an event handler. Instead, I succeeded in calling liveFeedUAV1.sqf from init.sqf with pierremgi's code. But another problem arose. I limited the code with exitWith to avoid multiple execution of all the code in liveFeedUAV1.sqf, but cameraEffect and camCreate are not working with the following syntax. if (missionNamespace getVariable ["liveFeedUAV1done", false] isEqualTo true) exitWith { cam1 cameraEffect ["TERMINATE", "BACK"]; camDestroy cam1; cam1 = "camera" camCreate [0,0,0]; cam1 cameraEffect ["Internal", "Back", "uavrtt1"]; cam1 camSetFov 0.46599999; "uavrtt1" setPiPEffect [0]; cam1 attachTo [MQ_1, [0,0,0], "PiP0_pos"]; }; I think the if statement is correct as it works when I run hint in the syntax. Maybe I overlook something? Thanks.
  10. ribera1945e

    [solved]PiP script and arsenal

    After the screen goes black, run the following code on the server to restore the monitor. isNil { cam1 cameraEffect ["TERMINATE", "BACK"]; camDestroy cam1; cam1 = "camera" camCreate [0,0,0]; cam1 cameraEffect ["INTERNAL", "BACK", "uavrtt1"]; cam1 attachTo [MQ_1, [0,0,0], "PiP0_pos"]; }; Is it possible for the event handler to not recognize the variable name?
  11. ribera1945e

    [solved]PiP script and arsenal

    I ran it globally with init.sqf, but it had no effect. I also tried the following syntax to regenerate cam1 but it didn't work. //PIP arsenal proof [missionNamespace, "arsenalClosed", { isNil { cam1 cameraEffect ["TERMINATE", "BACK"]; camDestroy cam1; cam1 = "camera" camCreate [0,0,0]; cam1 cameraEffect ["INTERNAL", "BACK", "uavrtt1"]; cam1 attachTo [MQ_1, [0,0,0], "PiP0_pos"]; }; }] call BIS_fnc_addScriptedEventHandler;
  12. ribera1945e

    [solved]PiP script and arsenal

    I'm sorry I don't have enough explanation. The PiP render image is displayed on the monitor object until I open the arsenal, but when I open the arsenal it turns black. I'm trying to find a solution with a script.
  13. Solved. I changed _feeder to a variable name and it worked.
  14. if (!isServer) exitWith {}; params [["_display", objNull], ["_feeder", objNull]]; _display setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"]; cam = "camera" camCreate [0,0,0]; cam cameraEffect ["Internal", "Back", "uavrtt"]; cam attachTo [_feeder, [0,0,0], "PiP0_pos"]; cam camSetFov 0.7; "uavrtt" setPiPEffect [0]; addMissionEventHandler ["Draw3D", { _dir = (_feeder selectionPosition "PiP0_pos") vectorFromTo (_feeder selectionPosition "PiP0_dir"); cam setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ]; }]; http://killzonekid.com/arma-scripting-tutorials-uav-r2t-and-pip/ I read KK's blog and made a live feed script, but the turret vector is not reflected with the following error: '..eder selectionPosition "PiP0_dir"); cam |#|setVectorDirAndUp [ _dir, _dir vectorCr...' Error 0 elements provided, 3 expected The UAV thinks there is a problem with the code as it gives the same error when using a vanilla one.
  15. Hi guys. I want to change the side of a playable unit with a parameter, but my script doesn't work. playerTeamSide.sqf: if (!isServer) exitWith {}; private ["_side", "_playerGroup", "_newGroup"]; if (playerTeamSide == 1) then { _side = EAST; } else { _side = INDEPENDENT; }; _playerGroup = allGroups select { side _x == WEST; }; { _newGroup = createGroup _side; units group _x joinSilent _newGroup; } forEach _playerGroup; It seems that the group is not stored in _x. What should I do?
  16. However, the side is not applied correctly on a dedicated server... Is there something I overlooked?
  17. It was fixed after reinstalling FIR AWS. I'm sorry to interrupt you.
  18. Hi, firewill. I found a bug in the latest version of your mod. I haven't been able to properly guide your GPS guided bomb since the last update. The guidance mode is "GPS", but no system message is displayed when the bomb is dropped, and the bomb drops without guidance. Or do we need another new step to apply GPS guidance to the bomb? Thanks you.
  19. ribera1945e

    LAMBS Improved Danger.fsm

    I think it would be better if we could switch all the functions.(e.g. Sharing function, Withdrawal function) Also, with this add-on installed, the vehicle's AI turret will accurately find targets farther away than in the vanilla environment. Is this an add-on feature? Thanks you.
  20. ribera1945e

    LAMBS Improved Danger.fsm

    Hello. Are you planning to add a CBA setting to disable the sharing function? Thanks you.
  21. ribera1945e

    ADV - ACE CPR

    Hi Beldo. This mod and ACE3 v3.13.0 don't seem to fit well. Blood pressure and heart rate cannot be measured correctly. May I ask you how to deal with ACE3 v3.13.0? Thanks you.
  22. hi. Does TADST support multiplayer custom faces? The face of the person using the custom face becomes the default white face.
  23. ribera1945e

    Task Force Arrowhead Radio

    Hi.Thank you for a nice mod. However,I'm having a problem with the TFAR latest version 0.9.12 with TS3(x64) version 3.0.19.4. It was installed by using the "task_force_radio.ts3_plugin" but you will see the following message. -Warning You are about to install a Plugin for your TeamSperk Client. Plugins should only be installed from trusted sources, as it is possible to inject malicious code into the TeamSpeak client with a plugin. Do you trust this Plugin and want to proceed installing?- I have finished agreeing to this announcement and installing, but TS3 says "Plugin failed to load: Failed to open plugin." about "task_force_radio_win64.dll". Although I operate with administrative privileges to reinstall the TS3 and TFAR plug-in but the situation did not change. Current situation: TS3 is to display the "task_force_radio_win64.dll" in red letters. TS3 says "Plugin failed to load: Failed to open plugin." about "task_force_radio_win64.dll". TS3 says API version of "task_force_radio_win64.dll" is "0"(Required:20). Tried reinstall the TS3 and TFAR plug-in with adminstrative privileges. I don't know what to do...Please help.
×