Jump to content

Tova

Member
  • Content Count

    54
  • Joined

  • Last visited

  • Medals

Community Reputation

122 Excellent

5 Followers

About Tova

  • Rank
    Lance Corporal

Recent Profile Visitors

1807 profile views
  1. Hello, I have a long string I want to print on the screen using cutText. The command behaviour is use to use linebreaks if the string is too long to fit as a single line on the screen. I would like to predict on how many lines my text is going to be printed. To achieve this I tried using getTextWidth combined with safeZoneW, my understanding being that : getTextWidth : Retrieves the size of my string when printed on screen (with an arbitrary unit?) safeZoneW : Something equivalent to the maximum length of a string to fit as a single line (with an arbitrary unit?) My issue however is that the units of the results seems to be different, on my PC I find : getTextWidth : 33 for the longest string that fits on a single line (found empirically) safeZoneW : 1.56 I believe I should have found a result where roughly getTextWidth == safeZoneW, what did I miss ?
  2. Thanks for the support ! You'd be surprised to hear that the "piano" is just 3 vanilla desks arranged in a "triangle-y" shape 😛
  3. Oh just, the "piano" object I have in the video, so the 3D sound feels more "authentic". The playNote script has a parameter so you can choose the source of the note. If said parameter is not given, it takes the player by default.
  4. @johnnyboy Here’s a rendition of Beethoven’s Ode To Joy using those ping sounds. Actually, it was a bit harder than simply choosing the right sound file from those 7 « pings ». In fact, @Maffwas able to get the note correspondence for each of the files : Track = Note 1 = F3 2 = A3 3 = G2 4 = E4 5 = F4 6 = G4 7 = A4 And as you can see, the 7 sound files ARE NOT the 7 notes of an octave (letters from A to G), the 7 elemental pieces you need to make music ! So we ended up using the pitch parameter from playSound3D to alter sound files and get more notes. Taking A3 as our base, we used this table to get the frequencies of each note and “convert” one note to another. For example, A3 frequency is 220.00Hz, and B3 frequency is 246.94Hz, so to play a B3 in Arma, we have to play an A3 with a pitch adjustment of 246.94/220.00=1.1224545. So using that trick, we were able to get all the notes we needed, and then, transcribed this music sheet to work with our script. But enough talking ! Here’s the script used in the video, playNote is the “framework” to play notes and can be reused, _odeToJoy is the music sheet transcribed to the playNote format, and pianoSource is the piano object seen in the video.
  5. Hello @Play3r ! Yes that would work ! However you'll have to put [this] if it's in the init field and not _this (note the little "_" and the [ ]) I've also made you a code that will call the script on all the opfor units : TOV_noProne= { params ["_unit"]; while {alive _unit} do { if (behaviour _unit =="COMBAT") then { waitUntil {speed _unit < 1}; _unit setUnitpos "MIDDLE"; waitUntil {speed _unit > 2}; _unit setUnitpos "UP"; } else { _unit setUnitpos "AUTO"; sleep 2; }; }; }; { if (side _x==east) then { [_x] spawn TOV_noProne; }; } forEach allUnits; Just put it in a trigger set to true 🙂 NOTE : I updated the script so it stops when the unit dies. Also I'm not sure how running the script on many units will affect performance. You'll have to try 🙂 But please let me know ! Have fun !
  6. Maybe it's a bit late for an answer @Dj Rolnikbut here's a script that works well, for those who might be interested in the future : [yourUnitName] spawn { params ["_unit"]; while {alive _unit} do { if (behaviour _unit =="COMBAT") then { waitUntil {speed _unit < 1}; _unit setUnitpos "MIDDLE"; waitUntil {speed _unit > 2}; _unit setUnitpos "UP"; } else { _unit setUnitpos "AUTO"; sleep 2; }; }; }; If in COMBAT mode, the unit will take a knee when not moving, and stand up when on the move.
  7. Hi @Alert23 ! I tried to find a solution to use setPitch & Bank together with camPrepareTarget, but I couldn't find a way to... 😢 As a dirty workaround, I added a setDir parameter, if you need to set the bank of the camera, just comment the camPrepareTarget line, and use the combination of setDir and BIS_fnc_setPitchBank instead. Now, let's hope that some SQF guru will find a more elegant solution !
  8. Also it would be great to have an option to disable the little white dot in the center of the screen, or have it disabled by default when the crosshairs are disabled as well.
  9. @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 🙂 )
  10. 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
  11. 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 : while {true} do { waitUntil { uiSleep 1; not isNull findDisplay 314; }; 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 setDir %8; //[%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,_camParameters select 2 ]; copyToClipboard _camOutput; }; }]; waitUntil { uiSleep 1; isNull findDisplay 314; }; } You just have to 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 [13143.1,8857.96,0]; _camera camPreparePos [13140,8859.02,1.75517]; _camera camPrepareFOV 0.75; //setAperture 0; //_camera setDir 109.302; //[_camera, -28.6765, 28.2684] call BIS_fnc_setPitchBank; _camera camCommitPrepared 0; //waitUntil {camCommitted _camera}; EDIT/NOTE : if you use "camPrepareTarget", you won't be able to setPitchBank anymore... So to achieve your desired effect, comment camPrepareTarget and uncomment the combination of setDir/setPitchBank. (Note that you'll have to delete and recreate a camera if you used camPrepareTarget earlier). It's a dirty and imperfect workaround unfortunately 😕 The script pre-edit for reference :
  12. 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 ?
  13. 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 !
  14. 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". 🙂
  15. @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.
×