Jump to content

johnnyboy

Member
  • Content Count

    2693
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by johnnyboy


  1. Thanks man, love to hear it.  Please send me your copy with the changes you made to make it MP compatible.  Snafu made a few changes in that regard (remoteExec-ing all the hideObjectGlobal commands) which I've incorporated in my dev version.  Snafu also added in some more burnt tree objects that came out in a later  PF version that spice it up. I can share that with you if you like.

     

    I would love to see your changes also to make it as good as I can.

     

    I'm close to releasing a new version of SOG AI that includes these Napalm FX. 


  2. 1 hour ago, Harzach said:

    Math is required.

    Ugh, math, that's where you lose me.  setVelocityTransformation is probably the way to go (its what BIS_fnc_unitPlay uses I believe),  but a similar idea below might work and is easier on my brain.  Before running it place the ufo where  you want in relation to hidden helicopter (and name ufo myUFO and helicopter myHeli).

    onEachFrame 
    {
    	private _vms = getVelocityModelSpace myHeli;
    	myUfo setVectorDirAndUp [vectorDir myHeli,vectorUp myHeli]; 
    	myUfo setVelocityModelSpace _vms;
    };

    This is untested, but easy to test and see if it works.  If it does work I would convert it from using onEachFrame to using an EachFrame missionEventHandler instead.

     

    If you don't like the space ship's pitch to match the heli's you could use vectorUp surfaceNormal instead and the pitch would be parallel to the terrain below.

     

    Speaking of BIS_fnc_unitPlay, if the space ship is only going to fly a predetermined path, you could run BIS_fnc_unitCapture on a helicopter to pre-record a path, then in the mission call BIS_fnc_unitPlay using the Space Ship instead of the heli.  Another possibility.

    • Like 1

  3. 1 hour ago, Ibragim A said:

    There is also HandleChatMessage event handler. He returns the necessary arguments to me, but he handles messages in the chat, but the leader of the AI group does not transmit anything to the player in the chat, because he is in another group. He just says his message in the game.

    That's a damn shame that does not fire if no player in the group, as there's a wealth of info there.

     

    You may be able to get most of what you want (commandChanged, EnemyDetected, knowsaboutChanged, CombatModeChanged) from group event handlers.  You then have to construct your own messages per desired situation.  And possibly use jboy_speak or something like it to play the applicable voice config sound.


  4. I'm unaware of such a feature.  Do you want to see all chatter, or a subset?  What is that subset?   For the subset, there may be a way to determine some of these AI group leader states/decisions, then construct appropriate messages to player, and maybe use jboy_speak to hear the messages (it looks up and plays many of the most useful audio speech files).


  5. 39 minutes ago, madrussian said:

    Extremely immersive indeed & well done!  Curious how you are floating these things?  attachTo to small things that float?  addForce?  setVelocityTransformation on every frame? 

    To float, I attach them to a hidden "Balloon_01_water_NoPop_F" object, and use setVelocity on each frame.

    39 minutes ago, madrussian said:

    Also, how do they react when you bump boat against them?

    All the small objects get bumped out of the way and wiggle, so its not bad really.  But the big tree trunks can wig out spinning and look stupid.  I may have to try and deal with that.  Funny thing is a player swimming collides with big tree trunks nicely and naturally without disturbing them, and not clipping through them (you have to swim around), so not sure why boat is different. I tried adjusting mass thinking tree trunk (or the balloon object its attached to) needed greater mass than boat to prevent wigging, but that didn't work.

     

    Another nice effect is a grenade explosion near the small objects make them rock nicely.

     

    I also monitor when they flow close to shore so they don't tumble or clip too much into shore when balloon gets too shallow and hits bottom.  So I stop the object and looks like it naturally drifted into shore and got stuck.

     

    Currently spawned floater can only float in direction of nearest defined river flow point, so if they reach a bend they will drift straight into shore and get stuck.  I plan to change that later so that flow logic will read next river segment's direction change and apply it (with a gradual turn), to keep item flowing around bends.  I already have that logic in my boat waypoint script, so shouldn't be too hard.

    • Like 3

  6. I've added scripts to SOG AI mod for floating objects down a river.  You can add floating objects to your own Nam missions by following examples in this sample mission for placing objects and setting up trigger calls to float the objects.

     

    Get the sample mission here.  Unzip this mission folder into your missions directory, and open the mission in the Editor.  You must have SOG AI mod running for it to work.

     

    See it in action here:

     

    Known issues:

    • If you drive a boat into a big attached log/tree trunk, the log spins crazily and looks dumb.  I don't know how to fix this, so if your mission has boat traffic, you may not want big floating logs.
    • Objects float in direction of nearest defined river point.   If river bends, script currently does not look for next river point and turn the floating object, so object simply floats to shore and stops.  I plan on fixing this so objects continue to flow around bends following entire path of river.
    • Like 10
    • Thanks 2

  7. 1 hour ago, Ibragim A said:

    Download and look how this script is made, it shows how dead units can be attached to moving objects and then detached.

    I used this script a long time ago, it is possible that now it may contain some errors.

     

    Drag Dead Body Script

    Good find.  Looked at it and its overkill for my needs.  Uses EachFrame to continually setPos the dead unit. A lot of code.  I appreciate you looking it up for me though.


  8. Thanks guys.  My purpose for this question is I want to attach a recently killed unit to a moving object.  But the problem is, once dead, they no longer attach to anything.  If they are attached before being killed, they are immediately detached when killed.  And never can be attached thereafter.

     

    So my workaround will be to use allDeadmen to find them, or an OnKilled EventHandler.   Then create a dummy live unit that I disableSimulation on, put into a death animation, give him same loadout, uniform, headgear,etc., delete dead guy and attach new dummy unit.   Ugh.

    • Like 1

  9. Upon dying, a unit is replaced with a weaponHolder object that looks like a dead body.  You can find weapon holders with this command:

    nearestObjects [getPos player, ["WeaponHolderSimulated", "GroundWeaponHolder", "Default"], 4]

    But this returns any type of weapon holder.  I want to find the ones that are dead bodies, and exclude  a weapon lying on the ground or any other kind of holder.

     


  10. 1 hour ago, madrussian said:

    Ah-ha!  I did something similar in Fight Back mission related to Destroy Truck explosion.  Vanilla truck destruction was too wimpy looking so I spiced it up with a giant bomb.  Just for the visual & sound effect.  Used a handleDamage to detect the moment the truck was going to explode to know when to add the bomb.  I also recall handleDamage firing a whole bunch-o-times & having to account for that (not to mention trying to sync it all in MP), and that giving me fits.  Also to my surprise turns out bomb was waaay too powerful (killing people very very far away), so I had to make sure and spawn bomb right in the middle of the truck, with truck doing nice job of shielding surrounding units & more importantly players from that vast blast radius.  (Turns out vanilla truck explosion itself was just right amount of deadliness.)  On top of this, I also had to worry & fiddle a lot about where the middle of the truck actually was, having no standard destroy truck size or shape because enemy faction was selectable by the player from all factions detected in the config.  With A3, it's amazing how much is often involved in such seemingly trivial thing.  It's like... you start adding a bit, and pretty soon everything easily spirals out of control.

    That's arma scripting in a nutshell.  One simple cool thing you want to do takes you down a 3 day rathole, and you do it, because you want it to be the best it can be.  

     

    I seem to recall a similar issue where I spawned the explosion a few meters underground to mute the explosion fx.  I'd have to test that again to swear to it though.

     

    There is a similar issue with grenades in water.  If you are standing on shore, and a grenade detonates 4 meters away in water 2 meters deep, the water gives units zero shielding from blast and shrapnel.  I want to fix that.  The other grenade issue is they don't splash when they hit the water, and water in no way impedes their velocity, so they can skip along the ocean floor for 30 meters before exploding.  This I have solved (coming soon).

    • Like 1

  11. When running a mission that has respawn enabled, I circumvent respawn (prevent it) via a handle damage event handler that prevents player team units from ever having damage greater than amount of damage that triggers respawn.  For Escape and Combat Patrol, .42 damage triggers respawn, so I never allow units to have >.41 damage (unless truly killed) and instead set them unconscious and run my AI revive scripts where AI buddies can revive the downed unit. 

     

    How can I detect if a random workshop mission is using revive with this .42 threshold for triggering respawn?  I want to detect this condition and apply same handling for these missions so when running SOG AI revive is never triggered.


  12. 4 minutes ago, madrussian said:

    Curious about this one.  What was stopping full grenade damages?

    I have a complicated (probably too complicated) damage eventHandler for limiting damage to a threshold that won't trigger respawn, and instead calls my set unconscious script, and sends AI to revive the downed unit.  I think nades slipped through the cracks because of 10 or 20 fragments triggering the handleDamage event simultaneously, so not all of the small incremental damages per fragment (per fired handleDamage EH) were applied to the unit.

    • Like 1

  13. Version 1.6 of SOG AI released.  Main new feature is ability to order team to cross rivers.

    Change Log:

    Spoiler

    v1.6 Changes:
    - Player can now order AI to swim across rivers.  Player looks at water, and action appears.
    -- River crossings only available for these maps currently: Cam Lao Nam, The Bra, Khe Sanh.
    -- In Cam Lao Nam, river crossing not supported in NE rivers North of Hanoi, and South of Mekong river.
    - River crossing forbidden if far bank exit blocked by rocks, steep bank, piers, bridges, etc.
    - VCOM AI mod now compatible by making VCOM disabled for player AI team.
    - AI will die if incapacitated in water deep enough to drown (for sake of immersion).
    - Player will immediately be given Withstand option if incapcitated in water deep enough to to drown.
    I was going to make player die in water for immersion sake, but this caused weird game freeze.
    So decided on instant Withstand, rather than very unrealistic incapacitated state under water.
    - Tailgunner now says "Out of Ammo" when ordered to place mine, and he has no more to place.
    - In "The Bra" map, in the big swamp, all hard bushes are replaced with elephant grass which allows AI to navigate better there.
    - Fixed problem where player and his team was not taking full damage from grenades.  Grenades are deadly, so hit the dirt if you hear "Incoming!".

     

    • Like 7

  14. I just replayed this solid old mission.  Since player controls an AI squad in open Altis, its perfect for my SOG AI mod that makes AI easier for player to control, and much more responsive and immersive.  The video isn't that exciting, but if you watch from this point for a few minutes you will see clean leapfrogging by SOG AI team.

    BTW, SOG AI is not just for Prairie Fire missions (but it does require the SOG Prairie Fire DLC be owned).

    • Like 2

  15. It works like this:  In the init.sqf, this is called:

    // Will trigger napalm object destruction and burn effects for napalm strikes called via Air Support menu.
    [] spawn JBOY_monitorAirSupportClicks;

    You will find that function in the JBOY/JBOY_NapalmFX.sqf, and it looks like this:

    // Call this once from player's init.  It waits for player to use Prairie Fire Air Support menu
    // and call in an airstrike. It then calls script to look for F4s dropping napalm.
    JBOY_monitorAirSupportClicks =
    {
    	sleep 2;
    	while {true} do 
    	{
    		waitUntil {!isNull (uiNamespace getVariable ["vn_artillery_display",displayNull])};
    		waitUntil {isNull (uiNamespace getVariable ["vn_artillery_display",displayNull])};
    		if (!isnil "vn_artillery_map_selecting_end") then {
    			_dir = vn_artillery_map_selecting_end getDir vn_artillery_map_selecting_start;
    			_position = vn_artillery_map_selecting_start;
    			//_helper = ["Sign_Arrow_Cyan_F",_position] call JBOY_createHelperObj;
    			["vn_air_f4_base",_position] spawn JBOY_NapalmFxFindBombs;
    		};
    	};
    	sleep 10;
    };

    The first waitUntil senses when the player opens up the PF interface for calling in an air strike.  The second waitUntil senses when player closes the air strike interface.  It then gets the position of the airstrike as chosen by player, and direction of the airstrike.  And finally it passes in the type of aircraft that drops napalm (vn_air_f4_base) and position of strike to JBOY_NapalmFxFindBombs.  That script tracks the jet looking for a near bomb object that it drops.  Once it finds a bomb object, it calls a script to track the bomb to the ground.  Once bomb position is at ground level, we then know the impact point and we then call the FX script to replace objects with burned objects, spawn scorch marks, start fires, etc.

     


  16. 4 hours ago, SirBassi said:

    So if I understand it correctly, the map item damage will remain (as long as the mission doesn't restart), right?

    That's correct.  

     

    I'm glad you like the script, and like you, I'm all for persistent destruction.

     

    All your suggestions are good, but with limited time, I'm not sure I'll get around to doing it. I have lots of ideas that "burn" more for me at this time.

     

    You might contact snafu on Prairie Fire discord channel.  He's been using the script successfully in an MP environment, and modified it a bit.  It's possible he's done some of what you described.  If you find out he's met your wishes, please report back here on what you find.

    • Thanks 1
×