Jump to content

JCataclisma

Member
  • Content Count

    136
  • Joined

  • Last visited

  • Medals

Everything posted by JCataclisma

  1. Hello, guys! By trying and tracking this link and the previous ones, and also adding some stuff found on internet, I came to two slightly different approaches to it. Both of them work, at least on single player/mission editor. But one of my main goals is to have it running solely for MP dedicated server. I am running the code(s) bellow from a separated .sqf file, called from the init.sqf The problem remains the same for both: player will become invincible (which is desired) while inside ANY vehicle, not only in the ones from the specified classes. I don't mind whether I couldn't actually chose from a custom array of vehicles, but I'd be very happy if it worked only inside helicopters at least. Long in short, it remains ignoring the classes. { _heloClass = typeOf vehicle _x; if (_heloClass in ["B_Heli_Transport_03_F", "O_Heli_Transport_04_F", "I_E_Heli_light_03_dynamicLoadout_F"]) then { _x addEventHandler ["HandleDamage", { params ["_veh", "_source", "_selection", "_damage"]; if (_damage < 0) then { damage _veh; } else { _veh getHitIndex _damage; } }]; } } forEach allUnits; I believe this one is almost fully from forums here, and also works but for ANY vehicles: this addEventHandler ["HandleDamage", { _veh = _this select 0; if(vehicle _veh != _veh) then { if(_this select 5 < 0) then { damage _veh; } else { _veh getHitIndex (_this select 5); } } else { _this select 2; }; }];
  2. JCataclisma

    Trigger to Disable AI

    I am less than rookie in such subject, but most of the times I get that kind of error ("undefined variable") it's related to the global/local stuff mentioned by Harzach. In my case, usually it's because I ended up throwing the script "inside" another function or previous existing stuff, let's say, I add it in a trigger which was already being used for other scripts, and it is no longer passing that required variable to the flow. Could you have maybe forgotten some "{ };" somewhere in your script, from previous attempts?
  3. JCataclisma

    HandleDamage Event Handler Explained

    Or even try this different approach from pierreMGI's code. I´ve just added it with some tweaks to a helicopter and it's much more safe to fly inside it now:
  4. JCataclisma

    Trigger to Disable AI

    Hello! Try and take a look at this video from Gunter, who's also a member here in forums. I dare to say it will help you a lot by solving that. Also, perform a search for "hunt" in his channel, so you will find some really cool ideas for those "garrison-and-hunt" situations.
  5. Bullseye! It works. But it only blocks the script whether the Skyfire is the selected/active weapon, regardless the player is inside or outside the helicopter. I forgot to mention that I kept the original 20mm twin minigun ("M134_minigun"), so if I let it selected, the script will be executed "infinitely". So I added a little extra to your suggestion, and now it works as expected, even when the whole ammunition for any or all weapons is finished. if !((_currentVehicle currentWeaponTurret [-1]) isEqualTo "rockets_Skyfire" || (_currentVehicle currentWeaponTurret [-1]) isEqualTo "M134_minigun") then Thank you! Currently working code for Czapla: private _nearbyVehicles = nearestObjects[player, ["Helicopter"], 25]; { private _currentVehicle = _x; if (typeName _currentVehicle == "OBJECT" && (typeOf _currentVehicle in ["I_E_Heli_light_03_dynamicLoadout_F"])) then { if !((_currentVehicle currentWeaponTurret [-1]) isEqualTo "rockets_Skyfire" || (_currentVehicle currentWeaponTurret [-1]) isEqualTo "M134_minigun") then { _currentVehicle lockTurret [[0], true]; _currentVehicle setCollisionLight true; _currentVehicle removeWeaponTurret ["missiles_DAR",[-1]]; _currentVehicle addMagazineTurret ["168Rnd_CMFlare_Chaff_Magazine", [-1]]; _currentVehicle addWeaponTurret ["rockets_Skyfire",[-1]]; _currentVehicle addMagazineTurret ["38Rnd_80mm_rockets",[-1]]; _currentVehicle addMagazineTurret ["38Rnd_80mm_rockets",[-1]]; _currentVehicle setPylonLoadOut [1,"PylonRack_19Rnd_Rocket_Skyfire",true]; _currentVehicle setPylonLoadOut [2,"PylonRack_19Rnd_Rocket_Skyfire",true]; }; }; } forEach _nearbyVehicles;
  6. Hello, guys! I am running a script in a dedicated server, which is working great, but I would need to improve it. We have a random building which was chosen as an especial workshop point. Whenever any player get nearby, they'll be able to click an action while looking at the building. This action will execute a script in SQF file, which we called "searcher". This "searcher" will check for nearby vehicles (25 meters) and, whether it finds some specific vehicles, it will run a different SQF script file for such vehicle. In this case, it's for a WY-55 Czapla helicopter, and it will do as follows: private _nearbyVehicles = nearestObjects[player, ["Helicopter"], 25]; { private _currentVehicle = _x; if (typeName _currentVehicle == "OBJECT" && (typeOf _currentVehicle in ["I_E_Heli_light_03_dynamicLoadout_F"])) then { _currentVehicle removeWeaponTurret ["missiles_DAR",[-1]]; _currentVehicle addWeaponTurret ["rockets_Skyfire",[-1]]; _currentVehicle addMagazineTurret ["38Rnd_80mm_rockets",[-1]]; _currentVehicle setPylonLoadOut [1,"PylonRack_19Rnd_Rocket_Skyfire",true]; _currentVehicle setPylonLoadOut [2,"PylonRack_19Rnd_Rocket_Skyfire",true]; }; } forEach _nearbyVehicles; So far, it works great. But such action is free for any player which brings the helicopter nearby. And if the player decides just to click the action several times, the script will continue to add more and more and more missiles into the helicopter. NOW, comes the question: would you suggest and help about how could I avoid such repeated/infinite running of script? I believe the best way here would be to add some check at the beginning of the script, so that it would just NOT run the script at all. So my thought was to request a check whether the vehicle already has installed the very type of missiles the script would add to it, and if so, the script would NOT continue. I have searched the forums, but I am lost regarding what function could I try to add in the code bellow for such a check, as I receive one error after another, probably regarding syntax, but I cannot figure out where or "why" the error is there, even with the Arma3's editor pointing it out. Please check the line #6 if that could be the proper approach. private _nearbyVehicles = nearestObjects[player, ["Helicopter"], 25]; { private _currentVehicle = _x; if (typeName _currentVehicle == "OBJECT" && (typeOf _currentVehicle in ["I_E_Heli_light_03_dynamicLoadout_F"])) then { if (!(_currentVehicle /*WHAT SHOULD I TRY HERE?*/ [-1, "rockets_Skyfire"])) then { _currentVehicle removeWeaponTurret ["missiles_DAR", [-1]]; _currentVehicle addWeaponTurret ["rockets_Skyfire", [-1]]; _currentVehicle addMagazineTurret ["38Rnd_80mm_rockets", [-1]]; _currentVehicle setPylonLoadOut [1, "PylonRack_19Rnd_Rocket_Skyfire", true]; _currentVehicle setPylonLoadOut [2, "PylonRack_19Rnd_Rocket_Skyfire", true]; }; }; } forEach _nearbyVehicles;
  7. JCataclisma

    Land transportation

    We had something very similar more than 20 years ago for our Operation Flashpoint missions, and it worked fine but NOT for AIs boarding. The AI driver usually did a nice job if there were not too many obstacles, so it would always reach marked (waypoints) bus stops, wait for a few seconds for whichever players wanted to board/disembark, then follow to its next bus stop, and always looping, looping, looping around. But we had the bus set to no-damage/invincible, so the services would continue even if enemies ended up shooting the players inside. And the main "secret" is on that said by pierremgi, but our true, most common result, was always closer to what fn_Quiksilver and mikey74 said. 😂
  8. Awesome! thank you for the feedback. Cheers!
  9. JCataclisma

    Saros Tweak For Higher FPS On Maps

    Has anyone tried this script/mod for Invade & Annex framework on dedicated servers?
  10. Hello, Phronk! I don´t know whether you´re still rocking upon such work of yours, but I wonder if it would be possible to have an additional "Group-like" radio channel, but a somehow subscribe-able one, like the extra channels inside Quiksilver´s Invade&Annex framework ...? So that the server could have the main channel voice shut, making audio available only for the players which decide to activate such new radio. Cheers!
  11. Have just returned to "Arma 3 Editing" and absolutely LOVED this script!
×