Jump to content

johnnyboy

Member
  • Content Count

    2683
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by johnnyboy

  1. Hey androxe, I'm glad you're giving it a try. But if you want help, you have to provide details.
  2. Here's a random patrol script for boats. It should work well for ambient boats. It is currently not geared for combat boats, as combat AI would compete with the scripted move commands. However it could be easily modified for a boat to exit this script if their behaviour changes to COMBAT. The screenshots below show the random paths that 5 boats took during various time frames. The last one ran 4 hours, so I think the script is pretty well tested now. Challenges overcome: 1. Boats would run into the ground if move to pos too close to shore. Solved by insuring moveTo pos had enough water in front and 90 degrees right, and 90 degrees left to execute a turn. 2. Boats still occasionally run aground or into a deep water piling or pier. Solved by flipping boat 180 degrees when this occurs. This is bad for immersion but better than a stuck boat. May replace this someday with a slow rotation of boat 180 degrees that looks better. 3. AI simply stops responding to commandMove commands. Sovled by deleting AI and replacing with new fresh AI driver if not responding for 30 seconds or more. Downside, is new unit does not have same gear as unit replaced. This is ok for ambient boats, but ultimately replacement units should be loaded with all same gear as unit being replaced. Feel free to plug in your favorite gear replacement script here (send me a an integrated solution and I will credit you...but I'm not into doing this myself). 4. Scripts would die after awhile giving no error, and no longer logging diag_log messages per loop execution. Solved by ending script, and spawning new script on same boat after 500 loop evolutions. Put this script in your mission directory named Scripts: In the editor, put this in a boat's init box: dummy = [this, "ColorBlue",true,2000] execVM "Scripts\JBOY_boatRandomPatrol.sqf"; The parameters are: boat object color of marker to track boat path show markers boolean (true to show markers, false to not show markers) Radius: Calculated positions to move must be within this radius, where center of radius is boat's starting position. This prevents boats from cruising a zillion kilometers away from the island. Credits: Hat tip to @fn_Quiksilver for suggesting the getTerrainHeightASL for getting water depth. Thanks @theend3r for suggesting getUnitLoadout/setUnitLoadout. Its in the script above now. Demo mission: Dropbox link Random boat paths recorded over 30 minutes: Paths recorded over 1 hour: Paths recorded over 4 hours: It's odd that all the random path patterns above look like naked women. Or is that just me?
  3. This beauty is ripe for a demolition mission as well. I wonder how it would look at night if you spawned explosions at various locations, and ran a script to detach objects near each explosion. Would it fall apart beautifully disappearing into the ocean? Now we need an oil slick dammit...our work is never done!
  4. Which animation? Many animations are weapon specific.
  5. @Jimbo Dude That looks really cool. I have no skills in modding, so don't know how to help with that. But I would love to see one strapped on a Jboy Dog! :) @thedog88generously offered up this awesome tactical vest below also. I think he ported it from Arma 2, but it still needed work to be usable. He was willing to turn this over to anyone who could make it Arma 3 compliant (he's got too many other serious projects going, so no time for the dog).
  6. I think it CAN work on a Dedi server, but so far Accuracy Thru Volume is the only one to do it. And he used a "non-standard" way (IMO), where he removed all the "if (!isServer) exitwith {};" from the top of many sprocs, and found an alternative way to insure only one dog was created per player in a dedi situation. ATV deserves credit for solving his issue and I'm glad the Dogs are being used. I'm just not sure his solution is the one everyone should use. Its likely this could have been handled differently using remote_exec, in which case you wouldn't have to remove a statement from many sprocs. Anyway, I believe there is not too much work involved in implementing this in Dediicated server. However, I hope someone else takes that on and points the way. My time is limited, so setting up and learning about dedicated servers is not going to happen. I'd rather invest my time adding and improving capabilties for the dog (bomb sniffing, etc.). So if anyone wants to volunteer for JBOY Dog MP/Dedi Integration and Testing that would be awesome. You will be credited accordingly of course. @T.Gavin, also you mentioned you would send me the errors and logs from your attempt to use it Dedi. Can you still provide those?
  7. Thanks @theend3r. I didn't even know that command exists. That is simple enough, and I will definitley add it! Sweet another command in my tool belt now.
  8. Regarding your other points... "faster speedboats seemed to do much better". True. I don't know why. "AI did not navigate the main river on Doung reliably". For the river, you might want to record mulitple boat paths using BIS_fnc_UnitCapture. I recorded about 10 paths through Lake Limni on Altis for my Property of Mabunga mission, and they worked will. AI will not drive at all there normally (watch the first minute of mission video at that link to see 4 AI boats crusing up the narrow canal). To achieve some randomness you can randomize which paths AI will play at mission start, and you can also randomize at what time they start on their paths.
  9. @TeTeT You're right, I was having two problems: 1. Boats occasionally get stuck in the shallows. 2. Boats occasionally stop moving. I think I've solved the shallows problem, and I've improved the stop moving problem (sometimes they stop for a minute before moving again...no idea why). But now I've introduced a bug I have to fix before posting the improved solution. Stay tuned. The screenshot below shows 4 boats I had running the script for about 40 minutes. I tracked their paths with different colored markers. One of the boats stopped moving. I liked that they occasionally folowed a coast line, and the red path managed to pass between a small island and a bigger island.
  10. @Mynock I've never used the command, so have no advice to offer. I just remember KK recommending it for creating a custom object without a mod. Good luck mate.
  11. Blondie...maybe its CreateSimpleObject you should use?
  12. You can make your own sample mission. Open editor on any map. Create a boat unit and place it in the water off the coast. Make AI unit driver Add Player unit as passenger on boat Open double click on boat to open up its attributes Copy and paste the code I posted above into the units INIT box. Play mission. You will observe the boat driving from one random position to another. All in water. Return to editor, and hightlight the boat, and copy and paste it 20 times creating 20 more boats near original boat. Play mission and see all boats moving to different destinations.
  13. Try changing "param" to "params".
  14. That wasn't intended as a complete solution. Just pointing the way. But here you go. Put this in the init of a boat with an AI driver, and make player a passenger, and enjoy the ride. I dropped about 30 boats off SW side of Tanoa between big island and smaller islands, and they all cruised around nicely. Didn't see anyone get stuck. The speed boat I was in as the observing player went about 30 meters close to shore a few times, but always turned away and never got stuck. If this is for ambient civilian boat traffic this might be all you need. If its for patrols that need to react to the enemy then you need to end the loop when driver's behaviour switches to COMBAT, so thier combat ai can take over. dmy=[this] spawn { _boat = _this select 0; _driver = driver (vehicle _boat); _moveToPos = []; _fnc_getRandomPos = { params["_obj"]; _posFound = false; _randomPos = []; while {!_posFound} do { _distance = 800 + random 300; _dir = random 360; _randomPos = [_obj, _distance, _dir] call BIS_fnc_relPos; if (surfaceIsWater _randomPos) then { _posFound = true; }; }; _randomPos }; _moveToPos = [_boat] call _fnc_getRandomPos; _boat commandMove _moveToPos; while {alive _boat and alive _driver} do { if ((_boat distance _moveToPos) < 50 ) then { _moveToPos = [_boat] call _fnc_getRandomPos; _boat commandMove _moveToPos; }; sleep 2; }; };
  15. Here's a function I use for dog packs to roam. It was made to move to random pos where position is NOT water. For you, I changed it to move to RandomPos that IS Water. Its looking for one 300 - 400 meters away. Tweak that distance to your liking. You still need a loop doing what @theend3r suggests (give boat a waypoint or moveTo command). This function still runs the risk of returning a "bad" water position like in a mangrove channel that AI can't navigate to. To reduce chance of AI getting stuck in shallow water or being blocked by a wreck or dock, I set the condition for move completion to within 50 meters of calculated moveTo position. So boat completes move long before reaching new position. _fnc_getRandomWaterPos = { params["_obj"]; _posFound = false; _randomPos = []; while {!_posFound} do { _distance = 300 + random 100; _dir = random 360; _randomPos = [_obj, _distance, _dir] call BIS_fnc_relPos; if (surfaceIsWater _randomPos) then { _posFound = true; }; }; _randomPos };
  16. I'm sorry KK, you know we all love you buddy!
  17. I see. Maybe if you playsound3d from a dumb invisible object attached to unit, and in killed EH, you setpos the dumb object to [0,0,0]. Might work. I sure get tired of workarounds though...
  18. I'm hoping you smart MP scripting guys can help cure some of my ignorance on MP scripting and Dedicated Servers. @accuracythruvolume generously tested my JBOY Dog scripts in MP dedicated server environment and they didn't work. He reported its because I have the following line at the top of many of my scripts: if (!isServer) exitwith {}; Why is that wrong for Dedicated servers? I've been doing this routinely for years thinking this guaranteed my script runs on the server, and is not spammed on all clients. Can somebody please explain? When is it good to use "if (!isServer) exiitwith {};", and when is it not? Thanks in advance!
  19. @Mynock I'm happy you're giving it a try. This points out I need to build AI Handler/Dog team logic to order dog to attack detected enemies (potentially players). You are right, currently they will only follow their AI handler. Arrrrg...this just points out I have more work to do. :) Until I build that new logic, you should be able to script this yourself. You need to detect via a trigger or loop when you want AI to attack player or someone else (maybe a trigger on when AI knowsabout player). Once detected, execute the following commands so the AI handler will order his assigned dog to attack. _dog setVariable ["vTarget", _dogTarget,true]; // _dogTarget is unit you want attacked, could be AI, player, or rabbit, chicken or snake _dog setVariable ["vCommand", "attack",true]; // switches dog from current mode (probably "heel") to attack mode If the the dog kills the target, and you want him to attack another target, then re-issue same commands above passing in a new target. If you want the AI controlled dog to stop attacking, and return to following AI handler, then execute this command: _dog setVariable ["vCommand", "heel",true]; Instead of "heel" you could use "stop" or "sit" to stop the dog attacking. But "heel" is best to get dog following AI handler again. Note when dog is in attack mode, he will continue to attack until: dog is dead dog is given a different command or target the dog is attacking is dead. If dog's target is killed, then dog goes into an idle state (I think). So you would have to issue the "heel" command to get the dog following the AI handler again. If you want an AI handled dog to board a vehicle with his AI handler, execute the following: _dog setVariable ["vVehicle", vehicle dogHandler1,true]; // assumes "dogHandler1" is name of AI controlling dog _dog setVariable ["vCommand", "getin",true]; // commands dog to board vehicle To have AI controlled dog exit vehicle: _dog setVariable ["vCommand", "getout",true]; // dog exits vehicle sleep 1; _dog setVariable ["vCommand", "heel",true]; // dog resumes following his handler If AI Handler dies, and dog still lives, you can assign a new AI handler for him if you want: _dog enablecollisionwith _handler; _dog setVariable ["vHandler", _handler , true]; // assign new handler to dog Hope that helps. Feel free to shoot me more questions. Q: Who said "There's only two kinds of people in this world my friend. Those with loaded guns, and those who dig. You dig."...?
  20. @dchan200 Thanks much for looking into this. I'm thinking the only part that should run local to each player client is creating the dog menu event handler. So I think this line from my init.sqf should be local: _dogMenu = [] spawn {sleep 2; _d=[player] call JBOY_fnc_DogDisplayEH;}; // Add dog menu to player And the following scripts should all be run on the server (also from my init.sqf): // ************************************************************************** // Create a dog, assign him to a handler (player or AI), spawn background command listener for dog // In this example handler1 is an editor placed unit that is also the player. Dog1 is a variable name // for the dog created and assigned to Handler1. You could name the dog1 variable anything. // ************************************************************************** dog1 = [handler1, "Fin_tricolour_F", (handler1 modelToWorld [2,2,0]), true] call JBOY_dog_create; // Create dog. 4th parameter true means use Johnnyboy voice for commands. nul = [dog1, handler1, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf"; // Start command listener for dog _n=[] spawn {sleep 2; dog1 setVariable ["vCommand", 'sit', true]}; // Issue first command to dog (sit, heel, stay, etc. Sleep to allow dog to be initialized first. // ************************************************************************** // Start Trail Detection for dog1 // ************************************************************************** dog1 setVariable ["vScentTrailDetectionOn", true, true]; // Must set this property true if you want dog to track a trail of scentMarkers. _dmy = [] spawn {sleep 1; _d=[dog1] call JBOY_DogScentDetectionLoop;}; // ************************************************************************** // Start dropping scent markers for leader of group to be tracked. // quarry1 is the name of an editor placed unit. Change this to be any unit you want to be tracked. // ************************************************************************** _dmy = [quarry1] spawn {params["_prey"];sleep 2; preyObject1=[_prey] call JBOY_dogPreyInit;}; The above commands can be repeated to create multiple dogs (each with its own command listener), and to start dropping scent trails for more than one quarry (unit to be tracked). @accuracythruvolume: I'm hoping you can try DChan200's suggestion, and remoteExec the dog create scripts if calling them via an AddAction (which is local). It would be great to confirm that technique works, and I can keep all my "if (!isServer) exitwith {};" lines in the scripts (to insure they only execute on the server). I do appreciate your help and effort.
  21. Hey Gom, have you seen the "find in-game sounds/sentences" utility Larrow posted ? From that I gathered all in-game command paths for "Stop", "MoveThere", "Form on Me", etc. I then I use string replacing in the folder structure for given command to give different Language versions of sound file, and different volume of sound file (normal, stealth=whisper, combat=shout). So my JBOY Dog scripts allow player to command his dog using in-game voice in any language (Eng, GRE, PER, FRE, etc.) and any loudness (stealth, normal, combat). So if you want to say the Stop command below in French, and you want to whisper that command, you replace 'ENG' with 'FRE' and replace 'Normal' with 'Stealth'. playsound3d "A3\Dubbing_Radio_F\data\ENG\Male01ENG\RadioProtocolENG\Normal\100_Commands\Stop.ogg"; My script:
  22. That's great news ATV. Thanks for these details, I will hunt down those statements. A few questions: For my education, why is "if (!isServer) exitwith {};" a problem on dedicated? And without it, don't I risk running the scrpts redundantly on all clients? If more than one player connected, you still only had one dog correctly created? (i.e., there wasn't a dog spammed per client?) I really appreciate the help man, and will add you to the credits list!
  23. Either way. I like LAN better, because then you have option to play as CSAT or NATO. With SP, you play as CSAT only. If you try it, please comment here and rate on steam. Thanks!
×