Jump to content

ofp_f3d3

Member
  • Content Count

    40
  • Joined

  • Last visited

  • Medals

Everything posted by ofp_f3d3

  1. Hey! you can check the state of the player by using: _lifeState = lifeState player; and then make him invincible based on that. while{alive player} do { if(_lifeState == "INCAPACITATED") then { player allowDamage false; } else { player allowDamage true; } } I haven´t tried it but this should work. Now, this is a simple SP method, if you want this to work on MP you'll have to put that code in "initPlayerLocal.sqf". At least from the top of my head, this should work, but as i said, it´s not tested. Happy Holidays! USE SOLUTION PROVIDED BY pierremgi BELOW
  2. Hi everyone, long time forum lurker. This is my first script to be released and i hope it won´t be the last. This script was and idea that came to my mind when a wrong click on a zeus mission sent a full 82mm mortar barrage on a squad. Thats when i came with the idea, even if it isnt completly realistic, of creating something that would give the players some time to react by displaying a small marker on the map to warn them of a possible round coming down on the area. I dont use any kind of eventhandlers, and if im not mistaken, all the calculations are run server-side. The script only works for mortars and artillery as easier to predict its target, where mlrs or rocket propelled rounds have an engine providing acceleration. (i might try to get them to work in the future) Radar Script 0.3 Hope you enjoy it, and if suggestions or ideas come up, write them down and if its in my skill range, ill try my best to add them. Future ideas: -Remove markers after hit. -Predict launch position after X rounds fired from around the same area. Released under APL-SA CHANGELOG: Version 0.3 #Changed -Fixed bug where markers wouldnt delete because of being stored the wrong way. -More optimizations were made. -Tested in Dedicated server and LAN. No script errors and no FPS drops while running. (Set at 5000m range and 6 second interval). Tested with 16 simultaneous players in VeteranMod. I can safely say that this boi saved lots of lives that day, exactly the purpose i built it for. Version 0.2 #Added -Radar_MrkR --- Its job is to mark the radar´s position and its range so its visible to everyone in the side of the radar. #Changed -All markers (Radar pos and range, and prediction markers) now only show to the side the radar belong to,making this viable for PVP. Markers are created globally but its alpha is set to 0 and only changed to 1 by remoteexec. -Several optimizations marked by sarogahtyp Version 0.1 BETA #Added -Added a floor height for the radar to detect rounds to simulate blind-zones too close to the radar.(Default Radar Pos ASL + 500m) -Added death range. This value shows the "sure range" of death around the round´s impact. If you are within this range, you die. THANKS sarogahtyp for showing me how to check class configs -Added filter to only predict artillery rounds and avoid tank shells or anything else - AGAIN THANKS sarogahtyp for the code -Markers are now stored and deleted in order when rounds impact #Changed -As artillery radars cant locate a single round, the threshold for detection has been increased from "> 0" to "> 2". -Position of the round was changed from getposATL to getposASL, this showed improved precision. -The radius of the marker now corresponds with the indirectHitRange X 5 #Removed -Replaced Radar_Alcance for Radar_CalcImpact.sqf by sarogahtyp Version 0 Release
  3. 0.3 Released. Now that it works and has been tested extensively in Dedicated server environment, development will focus on making it more accesible to players giving them better warning signs other than markers. Although it was tested in a 16 people dedicated server with great results and players really happy because now they can actually fight against artillery strikes and not instantly die without warning.😂
  4. 0.2 Released!! Some optimization and Improvements for PVP environments
  5. No, that code goes in the init field of an object, "plane" is the name of the vehicle you want to use. Its 1 respawn position but lets you rearm and then teleport to the plane to jump.
  6. Mmmm, ok.... it might be plausible but it would need scripting: 1) For the spawn in base you need to set respawn in custom location, for this you go to the editor ON YOUR MISSION, and go to the Atributes >> Multiplayer tab. Then, scroll and find "Respawn". There you have to change it to Respawn on Custom location, and in the box below, tick select respawn position. 2) If you want to allow players to gear up before boarding the plane, put the previous respawn where the crates are and then put something to use as a teleporter, an item like a flag or something. Then, in its init field copy this: this addAction [ "<t color='#FF0000'>Board Plane</t>", { (_this select 1) moveincargo plane; }, [], 0, true, false, "", "vehicle _this == _this && alive _this", // _target, _this, _originalTarget 2, false, "", "" ]; Haven´t tested it, but it should work
  7. Weird, i downloaded it myself... i took it down now and re-uploaded it.
  8. Released 0.1!!! Changelog in first post
  9. i lowered that var to 0.1 and the center of the marker literally missed by 2 meters, F***ING PIN-POINT ACCURACY. ABSOLUTELY MAGNIFICENT. And no fps drop even with 15 rounds one after another. 😭 I actually dont know how to thank you for the help man. I´ll use your method and give you the proper credit. i´ll upload Version 0.1 today wth some minor changes + this new calculation method.
  10. I´ve run some more tests. The following pictures show 2 tests done with you method and mine, using the same target. The crosshair is where the AI was told to fire 1 Round of HE. First picture shows the prediction made by my solution. This one is from your 2nd script posted above As you can see, both have almost the same spread error. BTW, where can i find the functions used by the artillery computer??? i would love to read where does the computer get the SPREAD value from.
  11. Couldnt have said it any better myself 😂. Your brain farting gave me an idea, i discovered that the angle and speed is correctly measured. But for example, if my expected distance is 2400 meters, i need to add the ASL altitude of the final position which is pretty simple, ill test this and return to announce if it was a brilliant idea or a stroke. EDIT: MASSIVE STROKE
  12. Quick question @sarogahtyp Thats in the documentation for BIS_fnc_relPos and is almost certainly the cause that my predictions are missing by 100 or so meters, have you found a solution for it anywhere or even a mathematical way to correct it? I´ve been searching and optimizing the script but this still bugs me.
  13. Just downloaded it. The hint you see is the estimated distance of the round to the target, check the map and you´ll see red border markers around the predicted area. Give the mortar a fire mission and check it. If it still doesnt work just tell me and ill try to fix it.
  14. Thats what i get for not reading the user comments on the wiki, and trusting completly on bi´s documentation. what about this code: while {alive _bomber} do { _bomber doMove (position _target); sleep 5; //give some time for ai to move } the documentation mentions that if the unit belongs in a group, after reaching the final position, it will return to formation, but the while should keep him on his way to the target.
  15. My script every X time scans for artillery rounds. If a round is found, i obtain its direction and speed, and with that (not considering friction) i can get an aproximate range. With that range, and direction i get the relative position from the round and can find a good aproximation of the point of impact. And when i have that point, i mark it to notify players. I hope this explains the script better than i did before.
  16. I have the direction of the round. If i get the range, i can find and mark on the map an aproximate position to warn players about incoming rounds. But now i saw that the formula i found doesnt take into account that initial height wont be zero, as i catch the round midair. EDIT: now thats a thing. Using that i can FINALLY stop tracking rounds that don´t correspond, like a fricking tank shooting at 70°. If i check for that artillerylock i can find actual artillery rounds. you fixed a headache indirectly 😀
  17. I found that mk-6 mortar rounds and some 155mm rounds have "airfriction"=0. I´m having issues finding or coming up with a formula for the max range of a round. I know i´ll find one in the end 😑 EDIT: Found a formula 😁 ((2*b)/(3*v0*cosθ))R2+R−R0=0 , now i have to calculate the 2 solutions for the formula and im good to go
  18. I tried to keep it simple first, and now with the base working properly i can start adding more controls for better predictions. With the code you gave me, be sure i´ll try to get the friction into account and i´ll add the mlrs stuff down the road.
  19. Instead of just the script, i uploaded a test mission that is currently working to test it yourself.
  20. Both are amazing. The thing is that i didn´t want to know anything about the shooter or the target. Thats why i try to catch and detect the round mid-air and run any kind of predictions there. I´ll try to come up with solutions for both of the future ideas and any other quality-of-life improvements people can suggest.
  21. You can use this: _soldier1 doFollow _soldier2
  22. Thank you, i didn´t know that i had to include that. Also, this was tested in SP/MP, dedicated (too be checked extensively)
  23. i just tried writing this to check whats wrong in the syntax: if ((getPosATL vehicle player) select 2 < 2) then { hint "hello";}; somehow this works, but i can´t see why yours wont work, sorry if this isn´t very helpful
  24. if ((getPosATL _turretVehicle)# select 2 < 2) then { in turretdir.sqf the # isn´t needed. Also you´ll get an error with "in turretdir.sqf" because the IN expects a value first. https://community.bistudio.com/wiki/in IN is used to check if a value is inside an array.
×