Jump to content

Tova

Member
  • Content Count

    46
  • Joined

  • Last visited

  • Medals

Community Reputation

90 Excellent

3 Followers

About Tova

  • Rank
    Lance Corporal

Recent Profile Visitors

580 profile views
  1. @BlackbirdSD Well, there are many ways to achieve what you want. I'll explain Killzone_kid version first : In the description.ext, you can define "sound file" in as two "types", as cfgSounds (as you did), or as cfgMusic as Killzone_kid advice you to do. The way you define your "sound file" will classify the file as either sound or music for the Arma engine, and determine what kind of commands you can use to play your "sound file". In fact, defining your file as a cfgMusic (will classify the file as music) and allow you to use playMusic to play your file. Now the cool thing with that command, is that it triggers music Event Handlers, as defined in the biki : In our case, we are interested in using the musicStop event handler, who triggers when a cfgMusic sound is done playing. That way, you should be able to "know" when your song is done playing, and play it again. Here's a ready to use code snippet : playMusic "myMusic"; //To start the music ehID = addMusicEventHandler ["MusicStop", {playMusic "myMusic";}]; //EH that handles the loop //Code to stop the music, uncomment to use /* removeMusicEventHandler ["MusicStop", ehID]; playMusic ""; */ This code however is not MP friendly, as it will only work on the machine the code is run into, you'll have to make sure it is run on all machine if you want all the players too hear the music, and there are many ways to do so. For reference, one of them is to global execute it with remoteExec, and do something in this fashion : { playMusic "myMusic"; //To start the music ehID = addMusicEventHandler ["MusicStop", {playMusic "myMusic";}]; //EH that handles the loop } remoteExec ["bis_fnc_call", 0]; The main limitation of this method however, is that playSound isn't 3D. Which mean, the music will not fade out the further you get from your stereo and will always play at the same volume. Another approach to get the 3D sound capability is to define your song as cfgSound, and use say3D. However since the song is now cfgSound and not cfgMusic, you won't be able to use the musicStop event handler anymore. A workaround is to put your say3D in a loop with a sleep which is as long as the song duration. Note that this is not MP friendly, so you'll have to use the remoteExec trick as well. To get native MP compatibility (so you don't need to remoteExec), you can use playSound3D. Note that you don't need to define your "sound file" in the description.ext to use playSound3D, as you only have to give the path to your song file. Unfortunately, here again you won't be able to use the musicStop event handler, so you'll have to use the sleep trick again. Just note that you'll have to use another trick to get the MP friendly sound file path in MP, just check Jacmac comment in the playSound3D page for a "ready to use" code. I hope that helps ! (I got too lazy to explain methods 2 and 3 in detail, but I'm sure you get the idea ๐Ÿ™‚ )
  2. Tova

    Metal Gear Solid Vr-Missions

    Hello @Alert23! That looks very interesting but it seems the steam link you provided is broken ๐Ÿ˜› Can we expect the mission to get back online soon ? ๐Ÿ™‚ Cheers
  3. I guess this is a bit late to answer your question, but your issue is still relevant, as camera.sqs is still clunky... So for those who still need a solution in the future, I ended up making a script to output data from Splendid Camera in the Old camera.sqs format : findDisplay 314 displayAddEventHandler ["KeyUp", { params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"]; if (_key isEqualTo 46 && _ctrl) exitWith { _camParameters=call compile copyFromClipboard; _targetPos=screenToWorld [0.5, 0.5]; _camOutput = Format [" %1 camPrepareTarget %2; %1 camPreparePos %3; %1 camPrepareFOV %4; //setAperture %5; //[%1, %6, %7] call BIS_fnc_setPitchBank; %1 camCommitPrepared 0; //waitUntil {camCommitted %1}; ", "_camera",_targetPos,_camParameters select 1,_camParameters select 3,_camParameters select 6,_camParameters select 4 select 0,_camParameters select 4 select 1 ]; copyToClipboard _camOutput; }; }]; Open the Splendid Camera, run the script from the debug console, and each time you'll press Ctrl+C it will copy in your clipboard the camera data in the format of the old camera.sqs (with a couple bonus features, commented by default). The output will be in the format : _camera camPrepareTarget [1888.05,5209.32,0]; _camera camPreparePos [1871.51,5540.61,20.2884]; _camera camPrepareFOV 0.45; //setAperture 0; //[_camera, -4.99451, 0] call BIS_fnc_setPitchBank; _camera camCommitPrepared 0; //waitUntil {camCommitted _camera};
  4. Well, months later, I didn't do much progress on the subject... I ended up using the "smooth rotation" script from BIS_fnc_scriptedMove, but while it looks decent for units rotating while stopped, it still looks cranky when a unit is rotating while moving (cf video) : Here's the "smooth rotation" code : //procedure for smooth turning _turningProc = { _this spawn { _guy = _this select 0; _wp = _this select 1; _dir = [_guy, _wp] call BIS_fnc_dirTo; if (_dir < 0) then {_dir = 360 + _dir}; _degs = _dir - direction _guy; if (abs _degs > 180) then {_degs = _degs + (360 * (_degs / abs _degs) * (-1))}; _step = _degs / 20; while {(abs _degs > abs _step) && BIS_scriptedMoveEnabled} do { _guy setDir (direction _guy + _step); _degs = _dir - direction _guy; sleep 0.025 }; _guy setDir ([_guy, _wp] call BIS_fnc_dirTo) } }; I also tried your suggestions with OnEachFrame/stacked eventHandler but without any improvement and with the additional drawback that the unit also rotate when you are in the pause menu ๐Ÿ˜› Maybe the new Arma updates introduced a way to solve this issue ? Also I know @johnnyboythat you have been working on your own version of the script, maybe were you able to make progress on the matter ?
  5. Thanks you very much @johnnyboy! Say no more ! Here are some showcases ! A convoy is trying to traverse a town, with insurgents shooting from roofs/windows. So to explain what happens in the videos : First video : No one dies, nothing blocks the street. Perfect scenario and the script works flawlessly. Second video : Here the two truck drivers get killed, luckily their vehicles end up not blocking the street. You can then see the AI HMMVW overtaking them and resuming the convoy Third video : It illustrates a limitation of the script and AI driving. Here again, the two truck drivers get killed, but this time, their trucks are blocking the street. Because of Arma 3 AI path-finding limitations, the HMMVW can't calculate a path to continue past them, and gets stuck. Maybe he would have moved eventually, but I didn't run the experiment long enough. Also as a side note, I have noticed that if it is the lead vehicle that gets killed, the convoy always stalls (stops moving toward the waypoint, with nยฐ2 vehicle not taking lead vehicle's role), maybe you have an idea for a fix ? I haven't really tried implementing your suggestion, but I feel normal AI behaviour does that good enough already ๐Ÿ™‚ However I noticed a "bug" in limitSpeed behaviour, as only the group leader ends up respecting this limitation, any insight on the matter ? I did some testing with the idea, so here are some on the WIP conclusion : Basically the working principle of my script isn't to "enforce a convoy behaviour" but rather to "recover" vanilla COLUMN formation when it detects a vehicle is stuck. if ((speed vehicle _x < 5) && (_pushThrough || (behaviour _x != "COMBAT"))) then { (vehicle _x) doFollow (leader _convoyGroup); //doFollow command name is misleading, but what it basically does, is order a unit to return to formation, hence unsticking it }; Also once it detects the group is in COMBAT, and if pushThrough is false that "recovery command" isn't run, in practice making the script inactive. Terminating the script properly doesn't changes behaviour in combat. Using a nearTargets to detect end of engagements faster, and restart the script isn't enough, as the units will not mount back in vehicles. I should add an orderGetIn to make them mount back and crack on. Your idea has potential !
  6. Oh my bad @Tankbuster To explain my statement better, the vehicle order is defined by "the hierarchy" of the group, as in group leader is 1st vehicle and so on. I don't know how you're spawning the vehicles of your convoy, but if it's a combination of createVehicle and joinSilent in this fashion : _convoyGroup=createGroup [west,true]; for "_i" from 0 to 9 do { _newVeh="B_MRAP_01_F" createVehicle getMarkerPos "vehSpawner"; createVehicleCrew _newVeh; [_newVeh] joinSilent _convoyGroup; sleep 0.5; }; convoyScript = [_convoyGroup] spawn TOV_fnc_SimpleConvoy; the convoy order will be : <- 1st spawned/joined vehicle <- 2nd spawned/joined vehicle <- 3rd spawned/joined vehicle ... Note that if you want a different order from the "join order", you should use joinAsSilent, as it allows you to specify the "position id in the group". ๐Ÿ™‚
  7. @Maff Only if it's one of those heavily monetized servers and I'm getting a 130% share of the profits ! @Devastator_cm I didn't implement it per se, but they have the vanilla Arma reaction to contact (the script don't affect their "Combat Behaviour"). I didn't test it extensively but they seem to push on while shooting if there's no vehicle with units in cargo seats, otherwise, passengers dismount and engage. If a vehicle gets wrecked/badly damaged the group leader will order its passengers to get in other vehicles of the convoy when possible. EDIT : @Devastator_cm After further testing I found the behavior inconsistent, armed vehicles will sometimes stop to engage, or move closer to targets. I added a parameter to force the convoy to push through ambushes (enabled by default) to make behavior more predictable.
  8. @TankbusterVehicle order is the "grouped order" when you placed the vehicles in the editor ๐Ÿ™‚ Basically, first placed vehicle will be group leader and is in front vehicle, second placed vehicle is second vehicle and so on... @wogz187 Thank you very much ! I tried to keep it as simple as possible, so it's easy to understand and so there are less things that can go wrong
  9. Hello Arma truckers ! It is now of common knowledge that Arma AI barely got its driving license ! While the driving is "decent enough" for single vehicles, once they hear the word "convoy", they get petrified and/or start ramming each other... While there are great convoy scripts out there (respects to@norrinand@Devastator_cm), I wanted a script who uses the new features of Arma 3 engine and follows the novacula Occami principle : Simpler is safer. So here's to you the Simple Convoy Script ! And it's robust ! So robust my AI convoy drove for 2.5 hours on Altis without getting stuck ! They crossed bridges, towns and villages, drove on dirt roads, small roads and highways. The recording is from the player perspective as a gunner on the tail vehicle. Convoy was composed of 8 vehicles, a mix of trucks and Humvees, in AWARE behaviour and was setup using MOVE waypoints and the Simple Convoy Script with default parameters (50km/h, 50m spacing). Features : Convoys will not get stuck for no reason ! Robust script Easy to use : put your waypoints in the editor, and run the script only giving the convoy's group name as parameter Player friendly : you can be driver/gunner/commander/passenger in any vehicle of the convoy without breaking the script AI will push through contact (feature can be turned off) Adjustable convoy speed Adjustable convoy spacing Performance and environment friendly ๐Ÿ™‚ How to use : Here's a video example : Put the script code in an sqf file, trigger, init field or whatever you fancy, then call it with : convoyScript = [convoyGroup] spawn TOV_fnc_SimpleConvoy; Optional parameters are also available : convoyScript = [convoyGroup, convoySpeed, convoySeparation, pushThrough] spawn TOV_fnc_SimpleConvoy; With : convoyGroup : the group you want to move as a convoy convoySpeed : Maximum speed of the convoy in km/h (default 50 km/h) convoySeparation : distance between each vehicle of the convoy (default 50m) pushThrough : true/false, force the AI to push through contact, only returning fire on the move (default true) The script doesn't exit himself, so once you reach your final waypoint, you'll have to end it with : terminate convoyScript; {(vehicle _x) limitSpeed 5000;(vehicle _x) setUnloadInCombat [true, false]} forEach (units convoyGroup); convoyGroup enableAttack true; The script : Download links : Mission example : Armaholic Known limitations : Having mixed vehicles in the convoy will cause the fastest vehicles to have a not so smooth driving, as they'll accelerate faster than the other vehicles then brake once they reach target speed. Due to how setConvoySeparation works, the convoy will stop on tight turns, vehicles crossing one at a time. Rear vehicles will then often cut the corner to catch up faster if possible (doFollow behavior). Behavior of the convoy when "pushThrough" parameter is disabled isn't very satisfying : passengers in cargo slots will disembark (but keep formation) to engage, armed vehicles will leave convoy formation to engage, some unarmed vehicles will just stop while others will keep pushing on etc. The convoy will eventually recover after the contact is destroyed and the leader calls "Area Clear" (as in they will mount up again and resume convoy route). That however might take up to 20 minutes, as the convoy and dismounts are usually spread over a couple km after the fight. Credits : The Arma community. With special thanks to all those who answer scripting questions on the forums. Changelog : License : Share it, edit it, steal it, rip it, call it your own etc. Arma scripting and modding is about sharing ! If you're having fun, then I'm happy !
  10. I've been playing a lot on this map recently, and while it is indeed fantastic for flying, it feels a bit limited once you put boots on the ground. Considering the addition of roads and the large towns/villages of the map, I believe it would make a wonderful playground for infantry if it wasn't for the un-enterable buildings. I really hope @Jove Chiere that you'll consider replacing them with their CUP counterparts, or at least making the map compatible with CUP Core. In fact, I've been having a look at your buildings from ToH Core, and a replacement seems doable since the classname structure is similar. I've made a quick script to illustrate that in-game as a "proof of concept" (cf. video). And here's the script I used : Also please note that the "center" of the buildings is sometimes a bit offset between your models and those from CUP, but considering the "small" amount of different building models, it shouldn't be too hard to adjust them. On an another hand, a full replacement may be performance unfriendly. If you manage to make the map compatible with CUP (so you don't have those black textured buildings in the video), mission makers could just replace buildings on small areas of interest, or do it temporarily when players are close to towns. Anyway thanks for your work on the port ! PS : The script is MP and JIP compatible, and has to be run only on the server. You can replace all buildings on the map with : [[(worldSize / 2), (worldSize / 2), 0], (sqrt 2 * (worldSize / 2))] call TOV_fnc_TohToCupReplacement; It takes 40 seconds to run on my PC ๐Ÿ˜‹.
  11. @Jove ChiereIt seems that your South Asia map got removed from the workshop... I hope that you'll get it back on Steam, and that you're not stopping working on it because of those stupid stories ๐Ÿ˜“
  12. Smart move ! It didn't work as it is, but you just forgot to add a ParseNumber since the third parameter of sortBy has to return a number ๐Ÿ™‚ _sorted= [_yourArray, [], {parseNumber ((str _x splitString "_") select 1)}, "ASCEND"] call BIS_fnc_sortBy; Thanks a lot !
  13. Hello ! I have an array of objects in the format : [obj_10,obj_1,obj_12,obj_13,obj_14,obj_11,obj_2,obj_3,obj_4,obj_5,obj_6,obj_7,obj_8,obj_9] I would like to sort this array so it becomes : [obj_1,obj_2,obj_3,obj_4,obj_5,obj_6,obj_7,obj_8,obj_9,obj_10,obj_11,obj_12,obj_13,obj_14] Also please note that the array contains objects and not strings ! I tried the sort function on the array, but no luck ๐Ÿ˜• I believe the problem arises from alphabetical sorting as obj_11 comes before obj_2. Any ideas on how to get around the issue ? Thanks for the help !
  14. Tova

    Tab targeting for AI tank gunners

    Thanks @Beaglefor your answer ! I find it unfortunate that the "Radar" got removed tho ๐Ÿ˜• Also for those who might be interested in the future, I made a quick ready-to-use script to emulate that feature. It's binded to the Tab key : tab_radar_EH = (findDisplay 46) displayAddEventHandler ["KeyDown", { params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"]; //hint format["%1", _key]; if (_key!=15) exitWith{}; _unit=player; _gunner= gunner vehicle player; _targetsArray=_unit nearTargets 10000; _targetsArray=_targetsArray apply {[_x select 3, -1*((_x select 0) distance _unit),_x select 4]}; _targetsArray sort false; _nextTarget=[0,'nothing',objNull]; { if ((isNull assignedTarget _gunner) or (_x select 2!=assignedTarget _gunner)) exitWith {_nextTarget=_x;}; } foreach _targetsArray; if (_nextTarget select 0 < 10) then {_nextTarget=objNull} else {_nextTarget=_nextTarget select 2}; _gunner reveal _nextTarget; (_gunner) doWatch _nextTarget; (_gunner) commandTarget _nextTarget; }];
  15. Hello ! I remember back in the older Arma games, when I was playing as a tank commander, I could press the Tab key (Next Target) and the AI gunner would pick the biggest threat and target it. I was playing in Arma 3 today and for some reason, it doesn't seem to work, I also tried the Next Empty Target, Next Target (Vehicle) and Next Empty Target (Vehicle) keys but none of them seems to work ! ๐Ÿ˜“ Is there anyone who can walk me through it ? PS: I'm not using any mod.
ร—