Jump to content

johnnyboy

Member
  • Content Count

    1867
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by johnnyboy

  1. I'm back scripting again boys! The rumor that I quit arma to work full time on Conan Jiggle Physics is completely false BTW...(it was a broken wrist that made typing too difficult for a few months). This script addresses problem where 2 enemy AI are too close together and they either do not shoot (and jerk around), or shoot through each other without hitting each other. I encountered this a few times in my Scripted AI CQB Movement script, and decided it would be fun to solve it with a melee attack. I'm adding this to my Scripted AI CQB Movement script. But someone else might want to use this for other purposes (AI scripts, cutscenes, etc.). So here it is if someone wants the whole thing or pieces of it. Features: Forehand/Backhand strike animations with rifle attached to hand. Randomized Loser reactions: Drop weapon Ragdoll to ground after strike Try and pull pistol after losing primary weapon Striker executes victim after striking him. Pain grunts and shout fx
  2. johnnyboy

    LAMBS Improved Danger.fsm

    In this video you mention the problem of AI too close and it would be nice if there was an AI melee animation you could use. I've built something for my scripted movement scripts that you are welcome to use any part of if you like.:
  3. johnnyboy

    Brush Clearing

    This is very useful, thanks. And if you don't have an entrenching tool, you can always trim the bushes with Double-Ought Buck! 😀
  4. This script shows how to use an eventHandler to reduce damage to specific parts of an AI unit. Read this and see how it works. Once you understand that, look at this script I used on a vehicle to reduce damage taken by a vehicle (same principle): // handleBoatDamages.sqf // dummy = [boat1] execVM "Scripts\handleBoatDamages.sqf"; /* diag_log ["getAllHitPointsDamage boat1",getAllHitPointsDamage boat1];diag_log ["getAllHitPointsDamage player",getAllHitPointsDamage player]; ["HitBody","HitEngine","HitTurret","HitGun","HitTurret","HitGun","HitTurret","HitGun","HitTurret","HitGun"], ["hull","engine","","","","","","","",""], [0,0,0,0,0,0,0,0,0,0]]] */ _u = _this select 0; _u addEventHandler ["HandleDamage", { private ["_return"]; _unit = _this select 0; _selection = _this select 1; _passedDamage = _this select 2; _source = _this select 3; _projectile = _this select 4; _oldDamage = 0; _bodyMultiplier = .01; _engineMultiplier = 0.005; _otherMultiplier = 0.01; _overAllMultiplier = 0.005; switch (_selection) do { case("hull"): { _oldDamage = _unit getHitPointDamage "HitBody"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplier); }; case("engine"): { _oldDamage = _unit getHitPointDamage "HitEngine"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _engineMultiplier); }; case("fuel"): { _oldDamage = _unit getHitPointDamage "HitFuel"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _otherMultiplier); }; case(""): { _oldDamage = damage _unit; //_return = _oldDamage + ((_passedDamage - _oldDamage) * _overAllMultiplier); _return = _oldDamage; }; default{}; }; _return }]; I ran this script on a boat to make it tougher to destroy. You can tweak this to work for you most likely. Good luck.
  5. I would try putting at least one intermediate waypoint in the water between the 2 shores, putting group in FILE formation, and running this on the ai before they cross: { _x disableAI "FSM"; } foreach units group LeaderOfTeamThatIsSwimming; Disabling FSM tends to make units ignore formation and move directly to next point. Not sure if that will work well with swimming or not. If the above doesn't work, I would give each ai in the group a moveTo command when they are on starting shore, to a point on ending shore. This would have them move independently from the group. You can have a trigger on the ending shore that has them return to formation once they all have crossed. That should work, as they each unit will be pathing independently (like the leader does who you say actually makes it to the other side). You may need to disableAI "FSM" for this approach also.
  6. I want to detect when ai unit is pointing his weapon at another ai unit. So I think I need to ray cast from weapon using weapon direction. I came up with this based on Killzone Kid's Bob example: _unit = dude1; _beg = eyePos _unit; _endW = (_beg vectorAdd (_unit weaponDirection currentWeapon _unit vectorMultiply 15)); objs = lineIntersectsWith [_beg, _endW]; When I test this, I have player stand directly in front of dude1 unit (and dude1 has his rifle raised and pointing at me), but player is never in the objs array. I do see plant and building objects in the objs array, but not the player object. What am I doing wrong? Is there a better way to return human object an ai is pointing his weapon at?
  7. Maybe I'm not crazy after all and its not just me! Thanks for the slick test function.
  8. Thanks RCA3. That KillZone Kid example is what I based my experiments on. If you run that code you see the weapon line drawn which is exactly what I want to use to see if it intersects an AI unit. Unfortunately when I use this technique with any of the intersects commands, I can't get them to return the AI man object in the array of intersected objects. I'm probably doing something wrong, but can't figure it out. 😖
  9. Thanks Gizz, I'll try it out when I go into Arma later. But it may not work for me because, I think this test... ...is checking if eyepos shooter can see aimpos of target (if I understand this code correctly). What I want to know is if the weapon is pointing directly at the target. Example: Shooter is standing, and target is prone 5 meters away. If shooter is facing the target, and 2D weapon direction is toward target, that is not good enough, because weapon may be pointing above the prone target. What I need to know is if weapon is pointing down exactly at target (so if shooter was to shoot, they would hit the target).
  10. Thanks for the reply. I tried all the different intersects commands, and none of them were returning object of type "Man" though.
  11. Welcome back dude! Arma is punishing you for leaving, she can be a vengeful mistress. Now that you are hailing from Bigfoot Country, I expect to see Bigfoot appear in one of your campaign missions. Now get to work sir!
  12. johnnyboy

    LAMBS Improved Danger.fsm

    Also note that if you want to test if unit is refusing to suppress, use the currentCommand command after doSuppressiveFire. If unit successfully did some suppressive fire, then currentCommand returns "suppress" for some time. If unit did not successfully do suppressive fire, then currentCommand returns "". Maybe this can be tested to determine if unit should move to a better shooting position?
  13. johnnyboy

    LAMBS Improved Danger.fsm

    You can cure the "Negative"/"No can do" spam by temporarily disabling speaker. Replace code like this: p1 doSuppressiveFire t2; With this spawned code: _nul= [p1,t2] spawn { params["_shooter","_target"]; _speaker = speaker _shooter; _shooter setSpeaker "NoVoice"; _shooter doSuppressiveFire _target; sleep 1; _shooter setSpeaker _speaker; }; I just tested this and it works for me! Hope that helps.
  14. johnnyboy

    LAMBS Improved Danger.fsm

    Love your work man. For AI controlled groups, maybe adding some chatter would be good. In your video, you show the AI initial reaction to contact is to retreat first. If he had team mates, the leader could say "move back". During grenade reactions, if they sense grenade (thrower to the front of their position?) they could shout "incoming grenade". After getting hit with a grenade they can swear or grunt in pain. In my CQB AI script I'm working on, I have a function you can call that uses the unit's in-game voice (i.e., english, french, persian, etc.) to say the voice files. Here's the function if you want to use it:
  15. johnnyboy

    [RELEASE] Notification System

    Sweet. And I love your name btw! 🙂
  16. Excellent demonstration video Kenny, and very useful scripts. Thanks. For the fn_taskHunt script where units are patrolling casually initially, you might consider adding some code from my patrol chatter/lightsOnOff scripts. Rather than have lights on all the time, lights and chatter could occur less frequently, which can startle a player in a night mission when they don't see the patrol, then suddenly hear chatter or see a light come on. If you like the idea feel free to take some code. If not, no problem, your scripts are very cool as is.
  17. johnnyboy

    Interiors for CUP buildings

    Awesome contribution to the community. Thanks much!
  18. johnnyboy

    Singleplayer immersion

    EDIT: I just re-read the top post, and I don't think you were asking for a WAVE assault, so if that's true, you can totally ignore my suggestion below! Haha. To achieve all your goals, Wogz's code sounds great. However, it is relatively simple to create a very randomized wave assault mission using editor placed groups, waypoints, and a time-release loop. Like this: Place 6 assault groups around the town and name the groups g1,g2,g3,g4,g5,g6. Create series of waypoints for each group leading them to center of town (or wherever you want them to attack). The first waypoint for each should be close to group's starting position and contain this code in the waypoint: this lockwp true; lockwp true will force units to stop moving and wait until lockwp = false. Make all the intermediate waypoints that move the assault groups to town center have a placement radius of 200 or 300. This will guarantee their exact path differs each run. To start the wave assault, run a script like the following. It could be in your init.sqf or a trigger. assaultGroups = [g1,g2,g3,g4,g5,g6] call BIS_fnc_arrayShuffle; // randomize order of assault groups sleep 30; // Sleep however long you want before starting first group moving { _x lockwp false; // start group moving through their waypoints sleep (100 + random 100); // randomize delay time between starting each wave/group } forEach assaultGroups; I created a mission with this approach where I had assault groups coming by sea to a beach landing, and multiple land groups (infantry, mechanized infantry, and armor). It worked very well and was very re-playable and unpredictable, because : Order in which groups/waves attack is randomized Exact path each group follows is randomized by waypoint placement radius Time between releasing each wave is randomized When group's combat AI takes over, they are reacting to enemy presence and no longer following waypoints. Hope that helps. Good luck.
  19. #ImmersionMatters!!!
  20. Lookin' good brother!
  21. That all sounds great. Regarding mesh calculation being slow, one option is to pre-calculate meshes for vanilla building types (and most commonly used mods like CUP), and create a building mesh library for the community, If this library existed, your run-time code would simply find near building and lookup the meshes based on building type (no run-time mesh calculation needed). Something to consider.
  22. johnnyboy

    Ravage

    Haha. That screenshot is right up my alley. I love surprising clever stuff like that. I can imagine the player in a foggy sullen-skied mangrove swamp and he hears an approaching outboard motor. And then your metal beast with mounted weapon emerges from the fog... Yeah!
  23. Hi Leopard. You might want to reach out to @madrussian as he has made some great progress on generating building meshes. Maybe you two can collaborate or knowledge share. I believe he has solved stair detection. Check out his bad ass videos. And if there is any code you want to use from my crude attempt at scripted AI navigation of buildings you have my full permission to do so. It includes AI door opening, shotgun door breaching, explosive door breaching (thanks to @beno_83au ...NOT pronounced "bean-o"!), flashbang prior to entry (thanks @phronk ), and more. It currently requires pre-defined node paths, so is not dynamic and as sophisticated as what you are doing. Current unpublished version supports ladder usage and @bad benson's enhanced movement so ai can climb walls and buildings. I hope to publish an update soon (a broken wrist stalled my progress for 2 months). Also you may want to reach out to @sarogahtyp regarding his excellent work on shortest path calculation: I was dreaming of doing what you are doing but I think you can get there quicker than I. I am following this closely, and am excited about your progress. Best of luck!
  24. johnnyboy

    Ravage

    That is awesome bro. Those dudes bolted a big outboard on the back of that Effed up airframe!!! Cheers to you sir!
  25. It should. You can modify the .98 value to decrease speed faster or slower to find what works best for you. Saw your vid and dug the ai landing with tail hook. Very cool.
×