GEORGE FLOROS GR 4207 Posted October 23, 2019 8 hours ago, LSValmont said: use an animation depending on if the Ai is holding a primaryWeapon, SecondaryWeapon or handGunWeapon. Sure , i think the same about it and this would be a great addition ! # This is the community spirit ! 3 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 24, 2019 Added in melon popping as one of the random melee outcomes. 3 3 Share this post Link to post Share on other sites
jandrews 116 Posted October 24, 2019 8 hours ago, johnnyboy said: Added in melon popping as one of the random melee outcomes. One of the all time greats. No doubt, a classic for any zombie kill. 1 1 Share this post Link to post Share on other sites
froggyluv 2136 Posted October 24, 2019 getting better and better Johnny - possible to add impact sounds for all the melee contact strikes? Seems like there is one at the end (kill strike?) but not leading up to it 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 24, 2019 5 hours ago, froggyluv said: add impact sounds for all the melee contact strikes? Seems like there is one at the end (kill strike?) This is some part of a code that i have and fits with the certain animation. ex: [_Medic,"acts_miller_knockout"]remoteExec["playMoveNow",0]; // acts_miller_knockout AwopPknlMstpSgthWrflDnon_End Acts_Executioner_Backhand uisleep 2; [["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss",_Medic,false,getPosASL _Medic,1,1,100]]remoteExecCall["playSound3D",0]; _Injured setDamage 1; uisleep 2; [_Medic,""]remoteExec["switchMove",0]; 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 24, 2019 9 minutes ago, GEORGE FLOROS GR said: This is some part of a code that i have and fits with the certain animation. Thanks George, that is a nice hit sound. But I don't think I need a hit sound since I am spawning a bullet to hit the victim, which gives an impact sound, plus a puff of blood. I currently spawn a .408 bullet for the head smash (bigger bullet means bigger blood spray with chunks), but I need to add spawned bullets for forehand/backhand strikes also (probably a 9mm for lesser blood effect for these). That should satisfy @froggyluv's request. 3 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 24, 2019 On 10/22/2019 at 3:14 PM, LSValmont said: The attachment of the weapon to the arm looks weird and perhaps unnecessary if you use an animation depending on if the Ai is holding a primaryWeapon, SecondaryWeapon or handGunWeapon. There are animations meant to be used with one of those particular weapons so they look good. Thanks LSValmont. I've added in your suggested overhead strike (grenade anim) to the script. Now it randomly picks 2 of the 3 strike animations to play (forehand, backhand, overhead). The butt smash to head is additional and has a percentage chance of happening if victim knocked to ground. Regarding attaching a rifle to hand, I'm keeping that. It happens if unit has a rifle. I think its better to see a rifle for the strikes rather than nothing, or switching to a pistol for a strike (as that doesn't make sense when holding a rifle). Thanks for the input! I tried to get a flying dropkick to work using "Acts_JetsCrewaidLCrouchThumbup_in". This animation has guy lean on one knee to side, with other leg sticking straight out. If I could play it and tilt the guy back so straight leg in air and setVelocity up and forward it could have been awesome. So I tried setVectorDirAndUp to get straight leg in the air, but engine snaps AI back to surface normal immediately and messes it up. Even putting setVectorDirAndUp in onEachFrame eventhandler didn't solve it. Also tried attaching unit to hidden object while playing the anim, but the anim won't play while attached. So I'm giving up on flying drop kicks. Sigh... 2 Share this post Link to post Share on other sites
LSValmont 789 Posted October 24, 2019 3 hours ago, johnnyboy said: I tried to get a flying dropkick to work using "Acts_JetsCrewaidLCrouchThumbup_in". This animation has guy lean on one knee to side, with other leg sticking straight out. If I could play it and tilt the guy back so straight leg in air and setVelocity up and forward it could have been awesome. So I tried setVectorDirAndUp to get straight leg in the air, but engine snaps AI back to surface normal immediately and messes it up. Even putting setVectorDirAndUp in onEachFrame eventhandler didn't solve it. Also tried attaching unit to hidden object while playing the anim, but the anim won't play while attached. So I'm giving up on flying drop kicks. Sigh... Keep it simple, remember some of us want to use this for MP! AttachTo and excessive commands are bad and cause desyncs, stutters and other MP related issues. Remember there could be a very high number of Ai units executing your script at any given time so have that in mind. Other than that a must have script! Fixes a very long standing Arma 3 issue! 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 24, 2019 36 minutes ago, LSValmont said: Keep it simple, remember some of us want to use this for MP! AttachTo and excessive commands are bad and cause desyncs, stutters and other MP related issues. Remember there could be a very high number of Ai units executing your script at any given time so have that in mind. Thanks. Not using the attachTo any more. I'm actually not too worried about performance as the main loop will just be looking for AI close to each other, and nothing else. When that occurs, then the melee script is spawned. Its unlikely IMO that very many instances of the melee script will end up running simultaneously. The spawned script will end in a few seconds after one of the AI is killed. Edit: I am using the attachTo for the weapon during strikes. But like I said I don't think too many instances will run simultaneously. 1 Share this post Link to post Share on other sites
LSValmont 789 Posted October 25, 2019 3 hours ago, johnnyboy said: Thanks. Not using the attachTo any more. I'm actually not too worried about performance as the main loop will just be looking for AI close to each other, and nothing else. When that occurs, then the melee script is spawned. Its unlikely IMO that very many instances of the melee script will end up running simultaneously. The spawned script will end in a few seconds after one of the AI is killed. Edit: I am using the attachTo for the weapon during strikes. But like I said I don't think too many instances will run simultaneously. Think of Ravage and how many zombies come into melee contact with the bandits and renegades spawned by ravage alone, not to mention any AI the players might be commanding on a regular MP mission in ravage. Outside of Ravage the scenario is a lot less likely like you said! You could perhaps limit the amount of simultaneous melee scripts by using a mission variable that becomes true if a melee animation script is currently being played like so: On the script/fnc: if (isNil {missionNamespace getVariable "jBoyMeleeWorking"}) then {missionNamespace setVariable ["jBoyMeleeWorking", false]; _meleeScriptWorking = missionNamespace getVariable "jBoyMeleeWorking"; if (_meleeScriptWorking) exitWith {hint "only one melee attack at a time, wait your turn!";}; //Exit the script if a previous one is still being executed, once the other is done this one can resume on the next loop! missionNamespace setVariable ["jBoyMeleeWorking", true]; // If the script did not exit it means we can run it, while we run it we set it to true so no other melee attack can happen simultaneously. CODE CODE CODE // Script ends here missionNamespace setVariable ["jBoyMeleeWorking", false]; Since the script runs quite fast anyway the next loop will catch the next melee Ai in line quite fast! Only a few seconds of delay while the previous meleeing Ai is done with its thing! 2 Share this post Link to post Share on other sites
madrussian 347 Posted October 26, 2019 How visceral and entertaining, well done j-boy! Thanks for all these great scripts, can't wait to see what ya come up with next. Maybe I missed some details, but is this just for AI or could player units be the winner and/or loser too? Also, how MP compatible is it? (Curious, which machine to call it on if winner and loser are local to different machines.) Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 26, 2019 3 hours ago, madrussian said: How visceral and entertaining, well done j-boy! Thanks for all these great scripts, can't wait to see what ya come up with next. Thanks man. This started out on a whim, but came together really nice. My latest version of the butt smash works surprisingly well. I hope it was worth the effort, as AI getting that close does not happen that often (although probably more often with Ravage zombies vs. ai). 3 hours ago, madrussian said: Maybe I missed some details, but is this just for AI or could player units be the winner and/or loser too? Also, how MP compatible is it? (Curious, which machine to call it on if winner and loser are local to different machines.) Currently its strictly for ai vs. ai. I'm considering on letting player be loser also...(as the thought of the last thing player sees is that rifle butt smashing his face before everything goes dark makes me want to do it). But that takes more work, and I have other projects to get to. Regarding MP, I hope it is MP compatible. All the switchmove/playmove/playaction is remoteExeced. After I release it, I hope somebody will MP test it and let me know. Regarding the winner and loser being local to different machines I have no freaking idea about that. If this script runs server side, won't the remoteExec of the animations handle that case? My last step is to write a loop monitoring for enemy ai nearness to call the script. I'll then release a demo mission with latest code. I know you're not a fan of loops, but I think it will be ok. Once released, I'm going to post a link on all he AI threads seeing if they want to integrate it or not. I figure VCOM or LAMBs may already has some kind of AI monitoring loop running that they could plug this into. So stay tuned for a release in the next few days. 3 Share this post Link to post Share on other sites
madrussian 347 Posted October 26, 2019 2 hours ago, johnnyboy said: I know you're not a fan of loops, but I think it will be ok. Wait, you might have me mixed up with someone else. My code usually ends up quite loopy. 2 hours ago, johnnyboy said: My last step is to write a loop monitoring for enemy ai nearness to call the script. I'll then release a demo mission with latest code. ... I'm going to post a link on all he AI threads seeing if they want to integrate it or not. I figure VCOM or LAMBs may already has some kind of AI monitoring loop running that they could plug this into. So stay tuned for a release in the next few days. Good deal, looking forward to it! 2 hours ago, johnnyboy said: If this script runs server side, won't the remoteExec of the animations handle that case? One thing I noticed when creating MP, is that locality sometimes (often?) matters, even when the wiki says it shouldn't. Especially when you're trying to time things on different machines (with attachTo having it's own set of peculiarities). Then often the thing causing MP hickups turns out to be some command you least expect. Thinking yours is probably fine, but curious to check it out. 1 1 Share this post Link to post Share on other sites
LSValmont 789 Posted October 26, 2019 3 hours ago, madrussian said: Then often the thing causing MP hickups turns out to be some command you least expect. Thinking yours is probably fine, but curious to check it out. I remember when I added the simulWeatherSync command to my weather loop hoping that it would sync the weather changes across all players in MP and only ended up causing massive stutters and other MP issues. It took me a while figuring out that was the reason to blame! The same happened when I enabled Ravage's Breath fog effect and ended up killing my server FPSs after a couple hours. I reported that to @haleks and he was quick to fix it thou! Now when I code for MP I use as little weird (untested) commands as possible. I know many players play Arma 3 in SP but for SP I feel that there are so many better options out there... now when it comes to MP it is then that Arma 3 is truly unique in that you can create a SP like experience on a MP environment! PS: Triggers are loops that run every 0.5 seconds anyway... and loops are fine if they don't run simultaneously to other loops and specially if they run on the unscheduled environment. On my server I run 2 loops on each client, around 5 on the server and a few holdActions here and there... I get 70 FPS on malden now! 2 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 27, 2019 Who doesn't like 3-way action? I hope to release full script and demo mission tonight. 2 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 28, 2019 Here's multiple instances of melee script running simultaneously. Multi-national team of AI fighting zombies. You can hear their melee chatter/shouts in their different languages (russian, persian, polish, french, chinese, english, etc.). 2 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 28, 2019 Version 1 of this script is released. See link to demo mission in top post. MP Compatibility: Should be ok. I RemoteExec all switchMove, playMove, and playAction calls. Someone want to MP test this? Currently the main loop that monitors for AI nearness conditions sleeps once every 2 seconds, and will run simultaneously as many AI pairs found that are within 2 meters of each other. I may change this to be a setting to control how many simultaneous AI fights can run (if anyone reports a performance issue. Here's the loop in case someone has some performance suggestions for it: Spoiler // ******************************************************************* // Loop below looks for pairs of dance partners every 2 seconds // ******************************************************************* _n = [] spawn { if (!isServer) exitWith {}; sleep 1; // In case this script is incorporated in more than one mod, we want to guarantee only one main loop is running if (missionNamespace getVariable ["JBOY_PointBlankMeleeLoopIsRunning",false]) exitwith {}; missionNamespace setVariable ["JBOY_PointBlankMeleeLoopIsRunning",true,true]; while {true} do { _dancePartnerFound = false; _units = (allUnits - allPlayers) call BIS_fnc_arrayShuffle; // Shuffling guarantees random "losers" selected { _loser = _x; { if (alive _x && !(lifeState _x isEqualTo "INCAPACITATED") && alive (_loser) && !(lifeState _loser isEqualTo "INCAPACITATED") && (_x distance _loser < 2.1) && !(_x isEqualTo _loser) ) then { [_x,_loser] spawn JBOY_PointBlankMelee; if (true) exitWith {_dancePartnerFound = true;}; }; // Dont compare loser to zombies and non-enemies (but loser may be a zombie) } foreach ([_units, {(typeOf _x) find "zombie"< 0 // not a zombie && !([side _loser, side _x] call BIS_fnc_sideIsFriendly) // and not a friendly && (primaryWeapon _x != '' or handgunWeapon _x != '')} // and has a rifle or a handgun ] call BIS_fnc_conditionalSelect); if (_dancePartnerFound) exitWith {}; } foreach _units; sleep 2; }; }; 3 1 Share this post Link to post Share on other sites
EO 11277 Posted October 28, 2019 Nice one JB!! Idea for a fun Halloween mission....JBOY Point Blank Melee+JBOY PumpkinHead+Ravage Zeds. Ravage has a no face variant (rvg_no_face) so you can run your PumpkinHead script and spawn a zed with no head and replace it with a zed with a pumpkin head....should make that melon pop, pumpkinhead pop outcome look pretty sweet. 😂 2 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 28, 2019 8 minutes ago, EO said: Idea for a fun Halloween mission....JBOY Point Blank Melee+JBOY PumpkinHead+Ravage Zeds. Haha. Great minds think alike! This has occurred to me, but I doubt I have time. But the pumpkinhead pop idea sure is tempting dammit...<calls in sick to start on pumpkinhead mission...> 1 Share this post Link to post Share on other sites
froggyluv 2136 Posted October 28, 2019 Hey Jdawgs looking good amigo! Link on 1st post not working for me getting a Verizon server error *checks to see if bill paid Edit: Got it bud thanks. Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 28, 2019 4 minutes ago, froggyluv said: Link on 1st post not working for me getting a Verizon server error *checks to see if bill paid Thx for heads up. I just updated the link (although it looked ok to me), and its working for me to go to dropbox. Try again. 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 28, 2019 On 10/21/2019 at 2:03 AM, johnnyboy said: Thanks to @LSValmont, @GEORGE FLOROS GR, EO and others for suggestions and support. You 're welcome johnnyboy ! You've done your magic again ! 1 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 28, 2019 Happy Halloween everybody!🎃 This is for my buddy EO... 1 3 Share this post Link to post Share on other sites
LSValmont 789 Posted October 29, 2019 On 10/20/2019 at 8:03 PM, johnnyboy said: Thanks to @LSValmont, @GEORGE FLOROS GR, EO and others for suggestions and support. Remember when I was a newbie here on the forums and you unselfishly helped me with my MP vDog Patrol script even thou you had a Dog script on your own!? Well you won my eternal admiration and friendship back then so I will always be there to help in your endeavors! Specially as noble ones as sharing your great work with everyone else! 2 Share this post Link to post Share on other sites
johnnyboy 3797 Posted October 29, 2019 1 minute ago, LSValmont said: Remember when I was a newbie here on the forums and you unselfishly helped me with my MP vDog Patrol script even thou you had a Dog script on your own!? Well you won my eternal admiration and friendship back then so I will always be there to help in your endeavors! Specially as noble ones as sharing your great work with everyone else! Aw shucks, you're making me blush. We're all in this together man! Improving the Arma-verse one small step at a time. 2 Share this post Link to post Share on other sites