Jump to content

Luft08

Member
  • Content Count

    197
  • Joined

  • Last visited

  • Medals

Community Reputation

27 Excellent

About Luft08

  • Rank
    Sergeant

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I created a mission some time ago that uses the Global Mobilization DLC and the CBA_A3 mod. I have not run the mission for a long time and now when I start it I get error messages: Bad Vehicle Type Virtual AI Squad and mpmissions\__CUR_MP.gm_weferlingen_summer\mission.sqm/Mission/Entities/Item65.type:Vehicle class VirtualAISquad no longer exists I searched mission.sqm and found two references to VirtualAISquad. They refer to light emitters. I don't see the emitters in the Eden editor and when I comment out the offending classes and try to start the mission Arma 3 crashes. I don't know how to proceed.
  2. I wish to display card-like messages while in-game. A header, picture and text below then buttons. Is this possible? I'm trying to create a scenario that is more board game like. The players will get random cards that can add items or abilities if the card is used. I would like it to have a header on top then a nice picture with text below that and finally buttons that will allow them to use or save the card. Thanks.
  3. I want to execute a function after units reach their given waypoint but the function takes an argument. I wanted to use setWaypointStatements but the argument is in a private variable and it is not possible to place the argument into a global variable because the function gets executed by many AI units that require the argument have different values. Is there any way to do this?
  4. Never mind... I just tested it out on the server after my long post and it is working. 🤪
  5. I can't seem to get a handle on locality. I understand it, I just can't seem to not get smacked in the face by it. The other day Harzach helped me identify my locality problem and I though I was being so careful but I once again have code that runs fine in single player but not on my dedicated server. When a player destroys an enemy vehicle I want to award that player points based on the vehicle type and send a hint message to only that player. When I create the vehicle I attach an event handler to it (from code that only runs on the server). LFT_MilitaryTraffic: if(!isServer) exitWith {}; // Delete dead vehicles for "_c" from 0 to ((count militaryVehicleArray) - 1) do { private _veh = militaryVehicleArray # _c; if(!alive _veh) then { militaryVehicleArray deleteAt _c; }; }; while {(count militaryVehicleArray) < MAX_VEHICLES } do { // Get Vehicle Type private _vehicleType = selectRandom vehicleTypeArray; // Get Random road positions for start private _posStart = [0,0]; private _startSeg = [] call LFT_GetRandomRoadSeg; _posStart = getPos _startSeg; // Spawn Vehicle. private _roadDir = [_startSeg] call LFT_GetRoadDirection; private _vehArray = [_posStart, _roadDir, _vehicleType, east] call BIS_fnc_spawnVehicle; private _vehObject = _vehArray # 0; private _group = _vehArray # 2; _group deleteGroupWhenEmpty true; _vehObject addEventHandler["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; [_unit, _killer] remoteExecCall ["LFT_AwardKillPoints"]; }]; if(_vehicleType == "O_Truck_02_Ammo_F") then { _vehObject addEventHandler["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; for "_c" from 1 to 10 do { private _bomb = "Bo_GBU12_LGB" createVehicle (getPos _unit); _bomb setDamage 1; }; }]; }; militaryVehicleArray pushBack _vehObject; // Send Vehicle // _group = _vehArray # 2; [_group] call LFT_SetWaypoint; }; I assume that the event handler will run on the server so I remoteExecCall a function (LFT_AwardKillPoints) that has been compiled and placed into a variable. The variable has been declared a public variable: initServer: if(!isServer) exitWith {}; private _year = 2035; private _month = 7; private _day = 19; private _hour = 12; private _min = floor random 60; setDate [_year, _month, _day, _hour, _min]; private _handle = [] execVM "scripts\initVariables.sqf"; waitUntil {scriptDone _handle}; LFT_RaptorMaintenance = compileFinal preprocessfilelinenumbers "scripts\LFT_RaptorMaintenance.sqf"; LFT_VehicleMaintenance = compileFinal preprocessfilelinenumbers "scripts\LFT_VehicleMaintenance.sqf"; LFT_MilitaryTraffic = compileFinal preprocessfilelinenumbers "scripts\LFT_MilitaryTraffic.sqf"; LFT_GetRandomRoadSeg = compileFinal preprocessfilelinenumbers "scripts\LFT_GetRandomRoadSeg.sqf"; LFT_SetWaypoint = compileFinal preprocessfilelinenumbers "scripts\LFT_SetWaypoint.sqf"; LFT_GetRoadDirection = compileFinal preprocessfilelinenumbers "scripts\LFT_GetRoadDirection.sqf"; LFT_AwardKillPoints = compileFinal preprocessfilelinenumbers "scripts\LFT_AwardKillPoints.sqf"; LFT_InitBuildingManagement = compileFinal preprocessfilelinenumbers "scripts\LFT_InitBuildingManagement.sqf"; publicVariable "LFT_RaptorMaintenance"; publicVariable "LFT_VehicleMaintenance"; publicVariable "LFT_MilitaryTraffic"; publicVariable "LFT_GetRandomRoadSeg"; publicVariable "LFT_SetWaypoint"; publicVariable "LFT_GetRoadDirection"; publicVariable "LFT_awardKillPoints"; addMissionEventHandler ["entityRespawned",{ params ["_unit"]; call { if (side _unit isEqualTo WEST) exitWith {_unit setpos getpos respawn_west_1}; }; }]; [] spawn LFT_MilitaryTraffic; serverReady = true; publicVariable "serverReady"; LFT_AwardKillPoints: params ["_unit", "_killer"]; if(player isEqualTo _killer) then { { private _unitType = _x # 0; private _unitTypeText = _x # 1; private _unitTypeScore = _x # 2; if(_unitType isEqualTo (TypeOf _unit)) exitWith { hint format ["You have destroyed a %1. +%2 Points!", _unitTypeText, _unitTypeScore]; // TODO - add _unitTypeScore to players total score. }; } forEach scoreTable; }; The function uses an array called scoreTable that has also been made public: initVariables.sqf: if(!isServer) exitWith {}; MAX_VEHICLES = 150; player_1_Score = 0; player_2_Score = 0; player_3_Score = 0; player_4_Score = 0; vehicleTypeArray = [ "O_APC_Wheeled_02_rcws_v2_F", "O_MRAP_02_F", "O_MRAP_02_hmg_F", "O_LSV_02_AT_F", "O_LSV_02_armed_F", "O_LSV_02_unarmed_F", "O_Truck_03_device_F", "O_Truck_03_ammo_F", "O_Truck_03_fuel_F", "O_Truck_03_medical_F", "O_Truck_03_repair_F", "O_Truck_03_transport_F", "O_Truck_03_covered_F", "O_Truck_02_Ammo_F", "O_Truck_02_fuel_F", "O_Truck_02_medical_F", "O_Truck_02_box_F", "O_Truck_02_transport_F", "O_Truck_02_covered_F" ]; scoreTable = [ ["O_APC_Wheeled_02_rcws_v2_F","Unarmed Ifrit",10], ["O_MRAP_02_F","Ifrit GMG",30], ["O_MRAP_02_hmg_F","Ifrit HMG",30], ["O_LSV_02_AT_F","Qilin (AT)",20], ["O_LSV_02_armed_F","Qilin (Mini-Gun)",20], ["O_LSV_02_unarmed_F", "Qilin (Unarmed)", 5], ["O_Truck_03_device_F","Tempest (Device)",10], ["O_Truck_03_ammo_F","Tempest (Ammo)",25], ["O_Truck_03_fuel_F","Tempest (Fuel)",25], ["O_Truck_03_medical_F","Tempest (Medical)",10], ["O_Truck_03_repair_F","Tempest (Repair)",25], ["O_Truck_03_transport_F","Tempest (Transport)",30], ["O_Truck_03_covered_F","Tempest (Covered Transport)",30], ["O_Truck_02_Ammo_F","Zamak Ammo",25], ["O_Truck_02_fuel_F","Zamak Fuel",25], ["O_Truck_02_medical_F","Zamak Medical",10], ["O_Truck_02_box_F","Zamak Repair",25], ["O_Truck_02_transport_F","Zamak Transport",30], ["O_Truck_02_covered_F","Zamak Transport (Covered)",30] ]; publicVariable "scoreTable"; mainIsland = [[9803.08,9978.81], 5000]; cityArray = [ ["GeorgeTown",[6093.99,10023.6],1000], ["BluePerl",[13436.6,11933.5],800], ["Kotomo",[10786.3,6455.53],400], ["Tanouka",[9029.22,10021.6],500] ]; militaryVehicleArray = []; Again, It works when I run it from my PC but not on a dedicated server. Any ideas? Thanks.
  6. Each function is in it's own sqf file and I compile the files from the initServer.sqf file: if(!isServer) exitWith {}; private _year = 2035; private _month = 7; private _day = 19; private _hour = 6 + floor random 10; private _min = floor random 60; setDate [_year, _month, _day, _hour, _min]; private _handle = [] execVM "scripts\initVariables.sqf"; waitUntil {scriptDone _handle}; LFT_RaptorMaintenance = compileFinal preprocessfilelinenumbers "scripts\LFT_RaptorMaintenance.sqf"; LFT_VehicleMaintenance = compileFinal preprocessfilelinenumbers "scripts\LFT_VehicleMaintenance.sqf"; LFT_MilitaryTraffic = compileFinal preprocessfilelinenumbers "scripts\LFT_MilitaryTraffic.sqf"; LFT_GetRandomRoadSeg = compileFinal preprocessfilelinenumbers "scripts\LFT_GetRandomRoadSeg.sqf"; LFT_SetWaypoint = compileFinal preprocessfilelinenumbers "scripts\LFT_SetWaypoint.sqf"; LFT_GetRoadDirection = compileFinal preprocessfilelinenumbers "scripts\LFT_GetRoadDirection.sqf"; [] call LFT_MilitaryTraffic; serverReady = true; publicVariable "serverReady";
  7. Nope, but maybe I need to put in a few more logging statements to see what's happening on the client side.
  8. I placed diag_Log messages at the beginning of each function. Everything is being called so I assume that the code in the LFT_VehicleMaintenance function is failing when run on a dedicated server. params ["_vehicle"] _vehicle setVehicleAmmo 1; _vehicle setFuel 1; _vehicle setDamage 0;
  9. Thanks rowdied, I'll look over the code but what I really want is to understand why my code fails on the server.
  10. Good idea. Because it is running on the server I'll have to put in some logging messages to determine that.
  11. I made a super simple mission that has four helicopters named raptor_1, raptor_2, raptor_3 and raptor_4. I populated the main Tanoa island with opfor vehicles and have them running around. The players each take a helicopter and try to destroy as many vehicles as they can then come back and land on a pad to get rearmed, refueled and repaired. Everything works in single player mode but when I put the mission on a dedicated server the rearming, refueling and repair process does not work. The helopads each have a trigger: Type:None, Activation: Blufor, Activation Type: present. The condition field has: (raptor_1 in thisList || raptor_2 in thisList || raptor_3 in thisList || raptor_4 in thisList); The on Activation field has: [thisTrigger] remoteExecCall ["LFT_RaptorMaintenance"]; // Note I tried [thisTrigger] call LFT_RaptorMaintenance; but it didn't work either. The LFT_RaptorMaintenance function: params ["_trigger"]; if(raptor_1 inArea _trigger) then {[raptor_1] call LFT_VehicleMaintenance;}; if(raptor_2 inArea _trigger) then { [raptor_2] call LFT_VehicleMaintenance;}; if(raptor_3 inArea _trigger) then { [raptor_3] call LFT_VehicleMaintenance;}; if(raptor_4 inArea _trigger) then { [raptor_4] call LFT_VehicleMaintenance;}; The LFT_VehicleMaintenance function: params ["_vehicle"]; _vehicle setVehicleAmmo 1; _vehicle setFuel 1; _vehicle setDamage 0; How do I make this work on a dedicated server. As I said, it does work in single player. Thanks
  12. Luft08

    Lighting Problem

    In the initServer.sqf file I call a method that compiles several functions including the LFT_LightSource function. In the initServer.sqf file: _handle = [] execVM "scripts\common\compileMethods.sqf"; waitUntil {scriptDone _handle}; In the scripts\common\compileMethods.sqf file: if(!isServer) exitWith {}; inView = compileFinal preprocessfilelinenumbers "LFT_Common\inView.sqf"; isPrimaryAmmoLow = compileFinal preprocessfilelinenumbers "LFT_Common\isPrimaryAmmoLow.sqf"; LFT_Attack_Ground_Troops = compileFinal preprocessfilelinenumbers "LFT_Common\LFT_Attack_Ground_Troops.sqf"; LFT_LightSource = compileFinal preprocessfilelinenumbers "LFT_Common\LFT_LightSource.sqf";
  13. Luft08

    Lighting Problem

    I guess I don't understand what you mean when you say I don't need to broadcast the creation of a lightPoint. My code doesn't do that. The call to the LFT_LightSource function is placed in the initPlayerLocal.sqf file that gets run locally on every player's PC at the start of the mission so it should work but it doesn't. Very frustrating. I'll see if I can get your remoteExec way of doing it to work. Thanks for the help.
  14. Luft08

    Lighting Problem

    Yep, lightpoints and all commands are local. No joy.
×