Jump to content

MH6

Member
  • Content Count

    63
  • Joined

  • Last visited

  • Medals

Everything posted by MH6

  1. Yep. Something like this would do what you want. Might need to change the variables a bit. _bcam = "camera" createVehicleLocal getPos(_chopper); _bcam cameraEffect ["INTERNAL", "BACK"]; _bcam camSetTarget _chopper; _bcam camCommit 0; _bcam attachTo [_chopper,[0,-10,0]];
  2. Yes, I was putting that in as you typed it.
  3. As I recall, the one time I needed to change the orientation of an attached object, I just used General Barron's script after attaching it to rotate it 90-degrees on its x-axis so it was facing down instead of north. I do remember the object I attached acting a little strangely when I rotated it, but I think it's the fact that it was attached to an object that was attached to another object more than the rotation that caused it. Now, if you only need rotation on the Z-axis (i.e. rotate it left and right, like yawing in car), then you can just use 'setDir'. Here's the script: /************************************************************ Set Pitch and Bank By General Barron ([email=aw_barron@hotmail.com]aw_barron@hotmail.com[/email]) and vektorboson Parameters: [object, pitch, bank] Returns: nothing Rotates an object, giving it the specified pitch and bank, in degrees. Pitch is 0 when the object is level; 90 when pointing straight up; and -90 when pointing straight down. Bank is 0 when level; 90 when the object is rolled to the right, -90 when rolled to the left, and 180 when rolled upside down. Note that the object's yaw can be set with the setdir command, which should be issued before using this function, if required. The pitch/bank can be leveled out (set to 0) by using the setdir command. ************************************************************/ //extract parameters private ["_obj","_pitch","_bank","_yaw","_vdir","_vup","_sign","_rotate"]; _obj = _this select 0; _pitch = _this select 1; _bank = _this select 2; //find the yaw (direction) of the object //map compass directions go CW, while coordinate (vector) directions go CCW, so we need to flip this //if we don't flip this, the object will face backwards _yaw = 360-(getdir _obj); //---------------------------- //function to rotate a 2d vector around the origin //---------------------------- _rotate = { private ["_v","_d","_x","_y"]; //extract parameters _v = +(_this select 0); //we don't want to modify the originally passed vector _d = _this select 1; //extract old x/y values _x = _v select 0; _y = _v select 1; //if vector is 3d, we don't want to mess up the last element _v set [0, (cos _d)*_x - (sin _d)*_y]; _v set [1, (sin _d)*_x + (cos _d)*_y]; //return new vector _v }; //---------------------------- //find vector dir (pitch) //---------------------------- //find sign of pitch _sign = [1,-1] select (_pitch < 0); //cut off numbers above 180 while {abs _pitch > 180} do {_pitch = _sign*(abs _pitch - 180)}; //we can't use pitch that is exactly equal to 90, because then the engine doesn't know what 2d compass direction the object is facing if(abs _pitch == 90) then {_pitch = _sign*(89.9)}; //we can't pitch beyond 90 degrees without changing the facing of our object //(pitching beyond 90 degrees means that the object's eyes will point in the 2d compass direction that its back used to point) if(abs _pitch > 90) then { //we are rolling upside down; flip our direction (yaw) _obj setdir (getdir _obj)-180; _yaw = 360-(getdir _obj); //use bank to flip upside down _bank = _bank + 180; //and adjust our original pitch _pitch = (180 - abs _pitch)*_sign; }; //find appropriate vdir according to our pitch, as if we were facing north _vdir = [0, cos _pitch, sin _pitch]; //then rotate X & Y around the origin according to object's yaw (direction) _vdir = [_vdir, _yaw] call _rotate; //---------------------------- //find vector up (bank) //---------------------------- //find sign of bank _sign = [1,-1] select (_bank < 0); //cut off numbers above 360 while {abs _bank > 360} do {_bank = _sign*(abs _bank - 360)}; //reflect numbers above 180 if(abs _bank > 180) then {_sign = -1*_sign; _bank = (360-_bank)*_sign}; //find appropriate vup according to our bank, as if we were facing north _vup = [sin _bank, 0, cos _bank]; //rotate Y & Z elements according to pitch _vup = [_vup select 0] + ([[_vup select 1, _vup select 2], _pitch] call _rotate); //rotate X & Y around origin according to yaw _vup = [_vup, _yaw] call _rotate; //---------------------------- //apply the vectors //---------------------------- _obj setVectorDirAndUp [_vdir, _vup]; then add setPitchBank = compile preprocessfile "scripts\setPitchbank.sqf"; to your init script and call the function like so: [object, pitch, bank] call setPitchBank;
  4. Set the desired orientation after you attach it.
  5. While I tend not to need to land this way in a transport chopper, I do use a similar technique for bleeding off speed in the cobra while maintaining cover (essentially I do a 180-degree turn with the ground to my left and the sky to my right and go from 250+km/h to a perfect hover with little to no translational movement). I hate being a gunner in a cobra when the pilot tries to slow down as we approach the hot zone by pulling back and subsequently climbing 100ft, so we're in clear view of all the ruttin' AA... If you're going to pull back to bleed speed, at least cut the throttle a few seconds beforehand so your altitude doesn't change.
  6. MH6

    Gear Changes??

    Missed that bit. Still, not many people know you can in MP, so I'll leave my post.
  7. MH6

    Gear Changes??

    Not sure if this is Domination-specific or not, but in the Domination maps you can stick a primary weapon in your backpack. So for instance, if you grab an M16 and SMAW and leave the gear window, you can then scroll your mouse-wheel and select "M16 to Backpack". You'll no longer be carrying the M16 (it's in your backpack!), so now go back into the gear window and pickup a sniper rifle (i.e. M24). Now you can switch back and forth between the M24 and M16 using the action menu, and still have a SMAW for taking out armor.
  8. And just for those who would enjoy firing artillery manually (I certainly do in maps like Domination), here's a quick diagram of the aiming reticule and how it's read. The middle blue line is your current altitude in the artillery piece. The closer line is your altitude + 1000m, and the further line is your altitude - 1000m. Therefore, each red hash mark equals about 200m. By reading the topographic map, I can see that my target's elevation is around 135m. So if I aim with the first red hash mark after my current altitude, the shell should land within 5m (since that hash is the 140m mark). I fired the round when the second-hand struck 12 on my watch. The round will have a 43.16s flight time (41.8+(48.6-41.8)/5), so should arrive two seconds before the second-hand strikes 9. Observing the target area... Kaboom. (Watch reads exactly 43 seconds) Accuracy was within 5-10m, at near maximum range of the M119. That truck is toast. Another tip is to setup a game controller to manipulate the artillery piece with. This way, you can aim using the larger map (see first picture) instead of that pansy minimap. This will make you much more accurate. You still have to close the map to actually fire, however. God, I love artillery. Edit: Scaled first image down slightly. Click to see full size. Edit2: Oh nice, they made the minimap a lot bigger in 1.03!
  9. MH6

    Patch 1.03

    I hope for the love of god they give aircraft flares. Or, at the very least, a missile warning system. If they're hesitant because of balancing issues in PVP or something, then only enable them in Co-op (or let the server decide).
  10. MH6

    Weapons with Tripods

    I think he means the MGs you carry, like the m249. Most sniper rifles also have bipods. I think they're deployed automatically when you go prone, but I'm not positive. Or maybe he did mean the static machine guns, dunno. :P
  11. MH6

    M119 add ammo

    Yep I'm having the same problem. :/
  12. How exactly can I get them to work? First of all, they have no ammunition (even after calling 'this addMagazine "ARTY_30Rnd_105mmHE_M119"'), and second of all the "Target Artillery" action does not work properly. It displays the map but not the artillery markers (red/blue crosses), and my players marker doesn't seem to rotate with the artillery piece (always facing north). This of course makes it useless. On top of that my editor seems bugged. I fired off some Hydras and they did a 90-degree turn after launch and flew to a specific point on the map (they always flew to that point no matter what my chopper's rotation was). The MLRS rockets also did this...and if the MLRS happened to be between the missile tube exit points and that specific point on the map, it blew up (basically the missiles fired in reverse into the truck). And yes, I added the proper magazine to it beforehand. I even tried to download premade missions from the Artillery Module thread and the artillery doesn't work with them either. I call in artillery and designate a target, the MLRS vehicles line up like their about to fire, the operators are calling out Shot over on the radio...but they never fire. Even after the operator calls out the splash notifications, they just sit there, rocket tubes pointed in the air, but never firing. These problems only occur in the editor. In singleplayer/multiplayer, hydras fire straight as they're supposed to and artillery barrages actually fire. The "Target Artillery" option for the M119 works in multi too. I'm at a loss, and my wit's end. Any help would be appreciated. Edit: It seems as if the Artillery Module is what causes the weird behavior of the MLRS/Hydras. Even if the MLRS isn't syncced with the ARTY module, once I place one the MLRS rockets go from shooting straight and proper to blowing up the vehicle.
  13. MH6

    Mh6

    Hey, I like my MH6 too. Guess we'll have to settle for the addon though. :(
×