Jump to content

DrBobcat

Member
  • Content Count

    267
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by DrBobcat

  1. DrBobcat

    FFAMM1.5

    No. Fromz disintegrated the hpp from use. - dRb
  2. DrBobcat

    FFAMM1.5

    Assuming you are listening to requests, Fromz, could you also update the M119 sound and perhaps attach some interesting fly sounds to the shells they fire? Just a simple whistling effect would be spectacular. Thank you for the great deal of effort you've put into this. It's fantastic! -dRb
  3. DrBobcat

    IsAdmin function

    Wow. The benefits of this find are great. Roleplay servers and others who strive for complete control over the mission will be able to do so far more easily now. I honestly thought that it was impossible... - dRb
  4. DrBobcat

    Direction of Gunner in Vehicle

    The only real way I know of is using the weaponDirection command. Get the atan2 of the x and y vectors and you will have the direction the gun is facing. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dir = ((vehicle weaponDirection "weapon" select 0) atan2 (vehicle weaponDirection "weapon" select 1)); - dRb
  5. Although there are many artillery scripts out there that either utilize AI or clever "createVehicle"-ing, I believe it would be far more entertaining for the player if he or she was actually in the gunner's seat. I have been working non-stop on a script that does just that. A hint box offers the gunner data such as his current heading and angle, as well as the heading he'd need to take to be aiming at his target, the distance to his target, and the height difference between himself and the target. Obviously, the next thing needed is the angle at which the barrel must be in order for the shell to strike the target accurately. My problem: I would like the shell to travel along a "perfect" parabola and strike a certain distance at a given angle. For example, at a thirty degree angle, I want the shell to land x meters away every single time. What kind of formula would I use? How would I go about this? The consideration of height can be dealt with at a later time. I have already looked at many websites but have not been able to discover a solution to my specific problem. Here is a list of some of those sites.... Wikipedia JBM Formularium Hyperphysics Measurements Converter An alternative solution may be to specify strict velocities based on the launch angle. Anyway, here is a copy of the main script...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (!(local (_this select 0))) exitWith {}; _info = { _gun = _this select 0; while {(alive _gun) && ((typeOf (vehicle player)) == "M119")} do { _xVec = (_gun weaponDirection "M119") select 0; _yVec = (_gun weaponDirection "M119") select 1; _zVec = (_gun weaponDirection "M119") select 2; _tHead = ((getPos _gun select 0) - (getPos targ select 0)) atan2 ((getPos _gun select 1) - (getPos targ select 1)); _cHead = (_xVec atan2 _yVec); if (_tHead < 0) then {_tHead = (180 - (abs _tHead))} else {_tHead = (180 + _tHead)}; if (_cHead < 0) then {_cHead = _cHead + 360}; _dist = ([getPos _gun select 0, getpos _gun select 1, 0] distance [getPos targ select 0, getPos targ select 1, 0]); _hDiff = ((getPosASL _gun select 2) - (getPosASL targ select 2)); _ang = (asin ((9.8 * _dist) / 275000)); hint format ["Current Heading: %1 degrees\nCurrent Elevation: %2 degrees\n\nDistance-to-Target: %3 meters\nHeading-to-Target: %4 degrees\nElevation-to-target: %5 degrees\nHeight difference: %6 meters",_cHead,(_zVec * 90),_dist,_tHead,_ang,_hDiff]; sleep 0.01; }; }; DRB_Art_Fired = { _gun = _this select 0; _ammo = _this select 1; _wAng = ((_gun weaponDirection "M119") select 0) atan2 ((_gun weaponDirection "M119") select 1); _rounds = (_gun nearObjects [_ammo,1000]); _round = objNull; _located = false; for [{_i = 0},{_i != (count _rounds)},{_i = _i + 1}] do { _round = _rounds select _i; _rAng = (((vectorDir _round) select 0) atan2 ((vectorDir _round) select 1)); if ((abs (_wAng - _rAng)) <= 2) exitWith {_located = true}; sleep 0.001; }; if (!(_located)) exitWith {}; switch (_gun getVariable "DRB_Art_Round_Type") do { case "he": { _he = { _round = _this select 0; _spd = 275; while {!(isNull _round)} do { _round setVelocity [_spd * (sin (getDir _round)),_spd * (cos (getDir _round)),(velocity _round select 2)]; sleep 0.01; }; }; [_round] spawn _he; }; case "illum": { _illum = { _round = _this select 0; _time = 0; _spd = 275; _create = false; _flare = objNull; while {!(isNull _round)} do { _time = _time + 0.01; _round setVelocity [_spd * (sin (getDir _round)),_spd * (cos (getDir _round)),(velocity _round select 2)]; if (((getPos _round select 2) <= 300) && (_time >= 2) && (!(_create))) then { _flare = "F_40mm_White" createVehicle [0,0,5000]; _create = true; }; if (((getPos _round select 2) <= 150) && (_time >= 2) && (_create)) then { _rPos = (getPos _round); deleteVehicle _round; _burst = "weaponHolder" createVehicle [0,0,5000]; _burstB = "G_40mm_HE" createVehicle [0,0,5000]; {_x setPos _rPos} forEach [_burst,_burstB]; sleep 0.25; _flare setPos _rPos; {deleteVehicle _x} forEach [_burst,_burstB]; }; sleep 0.01; }; }; [_round] spawn _illum; }; case "prox": { _prox = { _round = _this select 0; _time = 0; _spd = 275; _burst = "weaponHolder" createVehicle [0,0,5000]; while {!(isNull _round)} do { _time = _time + 0.01; _round setVelocity [_spd * (sin (getDir _round)),_spd * (cos (getDir _round)),(velocity _round select 2)]; if (((getPos _round select 2) <= 50) && (_time >= 2)) then { _round setVelocity [0,0,0]; _rPos = getPos _round; {_x setPos _rPos} forEach [_burst,_round]; sleep 0.25; {deleteVehicle _x} forEach [_burst,_round]; }; sleep 0.01; }; }; [_round] spawn _prox; }; case "smoke": { _smoke = { _round = _this select 0; _time = 0; _spd = 275; _create = false; _burst = objNull; _smokeA = objNull; _smokeB = objNull; _smokeC = objNull; _smokeD = objNull; _smokeE = objNull; _smokeF = objNull; _smokeG = objNull; _smokeH = objNull; _smokeI = objNull; _smokeJ = objNull; _smokeK = objNull; _smokeL = objNull; _smokeM = objNull; _smokeN = objNull; _smokeO = objNull; _smokeP = objNull; _smokeQ = objNull; while {!(isNull _round)} do { _time = _time + 0.01; _round setVelocity [_spd * (sin (getDir _round)),_spd * (cos (getDir _round)),(velocity _round select 2)]; if (((getPos _round select 2) <= 100) && (_time >= 2) && (!(_create))) then { _burst = "G_40mm_HE" createVehicle [0,0,5000]; _smokeA = "SmokeShell" createVehicle [0,0,5000]; _smokeB = "SmokeShell" createVehicle [0,0,5000]; _smokeC = "SmokeShell" createVehicle [0,0,5000]; _smokeD = "SmokeShell" createVehicle [0,0,5000]; _smokeE = "SmokeShell" createVehicle [0,0,5000]; _smokeF = "SmokeShell" createVehicle [0,0,5000]; _smokeG = "SmokeShell" createVehicle [0,0,5000]; _smokeH = "SmokeShell" createVehicle [0,0,5000]; _smokeI = "SmokeShell" createVehicle [0,0,5000]; _smokeJ = "SmokeShell" createVehicle [0,0,5000]; _smokeK = "SmokeShell" createVehicle [0,0,5000]; _smokeL = "SmokeShell" createVehicle [0,0,5000]; _smokeM = "SmokeShell" createVehicle [0,0,5000]; _smokeN = "SmokeShell" createVehicle [0,0,5000]; _smokeO = "SmokeShell" createVehicle [0,0,5000]; _smokeP = "SmokeShell" createVehicle [0,0,5000]; _smokeQ = "SmokeShell" createVehicle [0,0,5000]; _create = true; }; if (((getPos _round select 2) <= 5) && (_time >= 2) && (_create)) then { _rPos = (getPos _round); deleteVehicle _round; _burst setPos [(_rPos select 0),(_rPos select 1),0]; _smokeA setPos [(_rPos select 0) + 5,(_rPos select 1),0]; _smokeB setPos [(_rPos select 0) - 5,(_rPos select 1),0]; _smokeC setPos [(_rPos select 0),(_rPos select 1) + 5,0]; _smokeD setPos [(_rPos select 0),(_rPos select 1) - 5,0]; _smokeE setPos [(_rPos select 0) + 3.75,(_rPos select 1) + 3.75,0]; _smokeF setPos [(_rPos select 0) + 3.75,(_rPos select 1) - 3.75,0]; _smokeG setPos [(_rPos select 0) - 3.75,(_rPos select 1) + 3.75,0]; _smokeH setPos [(_rPos select 0) - 3.75,(_rPos select 1) - 3.75,0]; _smokeI setPos [(_rPos select 0) + 10,(_rPos select 1),0]; _smokeJ setPos [(_rPos select 0) - 10,(_rPos select 1),0]; _smokeK setPos [(_rPos select 0),(_rPos select 1) + 10,0]; _smokeL setPos [(_rPos select 0),(_rPos select 1) - 10,0]; _smokeM setPos [(_rPos select 0) + 7.5,(_rPos select 1) + 7.5,0]; _smokeN setPos [(_rPos select 0) + 7.5,(_rPos select 1) - 7.5,0]; _smokeO setPos [(_rPos select 0) - 7.5,(_rPos select 1) + 7.5,0]; _smokeP setPos [(_rPos select 0) - 7.5,(_rPos select 1) - 7.5,0]; _smokeQ setPos [(_rPos select 0),(_rPos select 1),0]; }; sleep 0.01; }; }; [_round] spawn _smoke; }; }; _cam = "camera" camCreate (getPos _gun); _cam cameraEffect ["INTERNAL","BACK"]; _cam camSetTarget _round; _cam camCommit 0; _time = 0; _dist = 0; while {!(isNull _round)} do { _time = _time + 0.01; _dist = _gun distance _round; titleText [(format ["%1 kmh \n%2 seconds \n%3 meters traveled \n%4 z velocity", speed _round, _time, _dist, (velocity _round select 2)]),"PLAIN DOWN"]; _cam camSetRelPos [0,-40,20]; _cam camCommit 0; sleep 0.01; }; sleep 5; _cam cameraEffect ["TERMINATE","BACK"]; camDestroy _cam; }; while {true} do { waitUntil {((typeOf (vehicle player)) == "M119")}; _gun = (vehicle player); [_gun] spawn _info; _fired = _gun addEventHandler ["fired","[_this select 0,_this select 4] spawn DRB_Art_Fired"]; _act1 = _gun addAction ["Change Type (HE)","DRB_ChangeRoundType.sqf","he",-1,false,true,""]; _act2 = _gun addAction ["Change Type (Illum)","DRB_ChangeRoundType.sqf","illum",-2,false,true,""]; _act3 = _gun addAction ["Change Type (Prox)","DRB_ChangeRoundType.sqf","prox",-3,false,true,""]; _act4 = _gun addAction ["Change Type (Smoke)","DRB_ChangeRoundType.sqf","smoke",-4,false,true,""]; waitUntil {((typeOf (vehicle player)) != "M119") || !(alive player)}; _gun removeEventHandler ["fired",_fired]; _gun removeAction _act1; _gun removeAction _act2; _gun removeAction _act3; _gun removeAction _act4; }; My thanks, - dRb
  6. DrBobcat

    More Math Woes

    Yes, I had thought of eliminating air drag entirely by using a formula similar to this... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">forwardSpeedConstant = 285; _zVel = (velocity round select 2); while {!(isNull round)} do { Â Â round setVelocity [(forwardSpeedConstant * (sin (getDir round))), (forwardSpeedConstant * (cos (getDir round))),_zVel]; Â Â _zVel = _zVel - 0.35; Â Â sleep 0.01; }; Note that 285 and 0.35 are arbitrary numbers that I have found comfortable. I believe this will force the round to drop at constant rate depending on its initial velocity, making a clean, smooth parabola, and will bypass air resistance altogether. However, this is not very realistic because the round will often accelerate past terminal velocity when launched from high angles. Additionally, the mathematical calculations needed to predict the launch angle of the shell will have to be different because gravity is ultimately being ignored as well. Thoughts, anyone? -dRb
  7. DrBobcat

    Hifi Sound FX V1.00 Released

    so im not alone with this problem then? i have the exact same problem.. at first i thought that it might have been the 1.14 patch but then i realised it must be this sound mod... ArmA seems to try to model a kind of hearing loss by lowering the volume of certain sounds when many are being played near the player at one time. For whatever reason, it merely happens -more- with this mod than in default ArmA. Personally, I have only had it occur after firing a long burst from a minigun. It is not all that bad, but I wish it could be shortened somehow... *chin* - dRb
  8. DrBobcat

    Arma feedback thread - based on 1.14

    No, and in fact I brought up the idea of more patches in this thread and a moderator deleted it and said it was off topic. Â I started a new thread and the same moderator locked it saying there already was a "bug reporting thread". Seems they don't want anyone to discuss that we really need another patch to fix all the untested 1.14 changes. If that were the case, why does -this- thread exist? Please do not jump to such rash conclusions. This is a thread for giving feedback on the patch, regardless of how general or specific such feedback may be. I imagine that we'd receive some kind of hotfix if we were all to continue to post about the prevalent problems still existing in ArmA. *shrug* -dRb
  9. DrBobcat

    Arma feedback thread - based on 1.14

    For balance? For Warfare? For the hell of it? Take your pick. - dRb
  10. DrBobcat

    1.14 = Armed Assualt: Combat NON-operations

    I believe that Atari (the publisher behind the Steam release) would be responsible for getting the patch to their users, not BIS. Therefore, I recommend you to take it up with them instead. But, of course, you can do whatever you please. - dRb
  11. DrBobcat

    Arma feedback thread - based on 1.14

    You were playing with other people, were you not? It sounds to me as though another person on the server was running a replacement mod that required that addon. - dRb
  12. DrBobcat

    Arma feedback thread - based on 1.14

    I can say for a fact that putting @ before a mod name does not prohibit it from functioning correctly in 1.14. So, no worries! - dRb
  13. While I do not have the time to write anything up at this current moment, I recommend you experiment with the setVelocity command. The third element affects movement along the vertical. If you wanted to, you could simply make that a high number (such as 200) and the aircraft would shoot up into the air. For something more realistic, it would need to be gradual. I'll return to this thread in a while and add more if it is needed. -dRb
  14. DrBobcat

    USEC F117A Nighthawk

    Wouldn't you want to make it randomly visible and invisible to IR and not visible? (Or maybe both since I think ArmA Shilka's are only visual and don't use their tracking or targeting radars although they certainly seem to) I would think that would mean you get locked on to less of the time. Heck you could make the stealth feature have more "peeks through the cloak" when the doors are down so it encourages you to roam around in smooth spook more often ^.^ The idea I proposed would only make it randomly visible on the radar. I do not believe it'd have any effect at all on line-of-sight vehicles like the shilka. Additionally, it would cause IR locks from Strelas and Stingers to break everytime the "box" was moved elsewhere. ArmA, unfortunately, does not accurately simulate thermal behaviour. I think this sort of compromise would work well enough. Icemotoboy, be sure that when the "box" is centered on the Nighthawk, its pos is constantly locked to the plane. Otherwise, even if someone managed to get a radar lock, it would be off by a few hundred meters if the aircraft was moving at a high speed. An (untested) example of the script you could use... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_plane = _this select 0; _tBox = "USEC_F117_Targ" createVehicle [0,0,0]; while {!(isNull _plane)} do { if ((random 1) >= 0.5) then  { for [{_i = 0},{_i != (round (random 800))},{_i = _i + 1}] do { _tBox setPos (getPos _plane); sleep 0.01; }; _tBox setPos [0,0,0]; }; sleep 1; }; NOTES * Raise/lower the 0.5 to a higher/lower number to make it less/more likely for the targeting box to show up at all * Raise/lower the 800 to a higher/lower number to increase/decrease the duration the box would be "attached" to the plane. At the defined settings, the max time is eight seconds. Good luck. -dRb
  15. DrBobcat

    USEC F117A Nighthawk

    Yes and, if icemotoboy wished, it would be very easy to implement your latter suggestion. Simply create an extremely simplistic model of a box, or even a rectangle, make it invisible to sight by using an alpha channel, and then write up a small script that moves the new model towards and away from the F117. To give it a more natural look, use random number sleep durations in the loop. Just a thought. -dRb
  16. DrBobcat

    Hifi Sound FX V1.00 Released

    The only place where I have seen any mention of sound entries pertaining to roll animations and the like is the config file for anims.pbo. Here is an example entry... I shall continue to look, - dRb
  17. DrBobcat

    Hifi Sound FX V1.00 Released

    While I am uncertain if you will receive a reply, you could consider sending a PM to Suma or Placebo and they may be able to supply you with an answer. I will continue to look for mention of those sounds in other config files. - dRb
  18. DrBobcat

    Hifi Sound FX V1.00 Released

    By "equipment sounds," what do you mean exactly? Could you give an example of what kinds of sounds you are referring to? I'll gladly scan through the config once I have a reference to work off of. - dRb
  19. DrBobcat

    typeOf in array?

    You cannot mix and match the two formats within the same script or it will not work properly. In the script you have shown us, you have done just that. * the "#startALL" at the beginning is an erroneous line in SQF * "goTo" is SQS exclusive * "exitWith" works like a condition type, not a command (check the biki) That is all I see at a brief glance. - dRb
  20. DrBobcat

    Slopes and Vectors

    Update! After many hours toiling away at this, working with countless formulas and ideas, I finally got the script to function as I had originally wanted. Here is the portion of the script that has been changed... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while {!(isNull _round)} do { _ang = (((getposASL _target select 0) - (getposASL _round select 0)) atan2 ((getposASL _target select 1) - (getposASL _round select 1))); //_round setDir _ang; _round setVectorDir [sin _ang, cos _ang, vectorDir _round select 2]; if (_xPos != 0) then { _zAng = (((getposASL _target select 0) - (getposASL _round select 0)) atan2 (((getposASL _target select 2) + _h) - (getposASL _round select 2))); _round setVectorUp [cos _zAng, 0, -(sin _zAng)]; } else { _zAng = (((getposASL _target select 1) - (getposASL _round select 1)) atan2 (((getposASL _target select 2) + _h) - (getposASL _round select 2))); _round setVectorUp [0, cos _zAng, -(sin _zAng)]; }; // _round setVelocity [((sin _ang) * ((cos _zAng) * speed _round)), ((cos _ang) * ((cos _zAng) * speed _round)), ((sin _zAng) * (speed _round))]; sleep 0.01; }; As I had stated in a sister post on OFPEC, I now need a method to calculate lead. The missile consistently misses targets with recessed central points, such as a Mi17. Also, I likely will still need to apply some added velocity to the missile or it will continue to fall short of the target at long ranges. (The reason why this is happening is because the missile is no longer receiving the thrust outlined in ArmA's config.) If I could receive some additional support on these fronts, I'd be very thankful. - dRb EDIT: No offence meant towards you, General Barron. I had not seen your post until after the changes already had been made. That is a brilliant, practical function... EDIT 2: The script, for now, is finished. I did not implement any advanced methods of calculating lead, and rather allowed the user to specify lateral and height offsets. I believe this is enough and only a minor inconvenience. Soon, I will make a similar version that uses a specific coordinate starting position instead of relative coordinates. Here we are... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// "Missile Generator (Relative)" by DrBobcat // [target,"type",x,y,z,lateralOffset,heightOffset,proximityBool,proximityDistance] execvm "DRB_MissileR.sqf"; // Much thanks goes out to the ArmA/OFP editing community! _target = _this select 0; _type = _this select 1; _xPos = _this select 2; _yPos = _this select 3; _zPos = _this select 4; _lOff = _this select 5; _hOff = _this select 6; _prox = _this select 7; _pDis = _this select 8; _burst = objNull; _round = _type createvehicle [0,0,1000]; if (_prox) then {_burst = "Bomb" createVehicle [0,0,1005];}; _round setPos [(getposASL _target select 0) + _xPos, (getposASL _target select 1) + _yPos, (getposASL _target select 2) + _zPos]; while {!(isNull _round)} do { if ((_round distance _target) <= _pDis) exitWith { _round setVelocity [0,0,0]; {_x setPos (getpos _round)} forEach [_burst,_round]; _burst setDammage 1; sleep 0.1; {deleteVehicle _x} forEach [_burst,_round]; }; _lPosX = ((getPosASL _target select 0) + (_lOff * (sin (getDir _target)))); _lPosY = ((getPosASL _target select 1) + (_lOff * (cos (getDir _target)))); _lAng = ((_lPosX - (getposASL _round select 0)) atan2 (_lPosY - (getposASL _round select 1))); _round setVectorDir [sin _lAng, cos _lAng, vectorDir _round select 2]; if (_xPos != 0) then { _zAng = (((_lPosX) - (getposASL _round select 0)) atan2 (((getposASL _target select 2) + _hOff) - (getposASL _round select 2))); _round setVectorUp [cos _zAng, 0, -(sin _zAng)]; } else { _zAng = (((_lPosY) - (getposASL _round select 1)) atan2 (((getposASL _target select 2) + _hOff) - (getposASL _round select 2))); _round setVectorUp [0, cos _zAng, -(sin _zAng)]; }; sleep 0.01; }; Again, thanks for all the help. If anyone notices any glaring flaws that I may have overlooked, please do speak up!
  21. While I have not had many problems with scripting up till now, I knew my lack of knowledge in advanced mathematics would eventually cause issues to arise. The following script spawns a missile of a chosen type at a relative x-y-z coordinate given by the mission designer. It works almost perfectly, but there are a few issues. 1) With the basic formula I have applied to the missile's Z velocity, it loves to head towards the ground at an amazing rate, only to stop at whatever height the target is at. It makes an almost perfect curve. Unfortunately, it looks too clean to seem realistic and does not fly like a missile really should. Is there a better formula I could use? 2) Although I have read of the "vectorUp" and "setVectorUp" commands introduced in ArmA, I have not a clue what equations I'd need to use in order to have the missile aiming up/down at the target it is heading towards. Any help here would be equally appreciated. 3) Is there a way I could guarantee a hit each and every time so I do not need to use a crude "net" to insure damage as seen in the "distance < 10" condition? The script... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// "Missile Generator" by DrBobcat (with much help from the ArmA/OFP editing community) // [target,"type",x,y,z] execvm "DRB_Missile.sqf"; _target = _this select 0; _type = _this select 1; _xPos = _this select 2; _yPos = _this select 3; _zPos = _this select 4; _round = _type createvehicle [0,0,1000]; _burst = "Bomb" createVehicle [0,0,1005]; _round setPos [(getposASL _target select 0) + _xPos, (getposASL _target select 1) + _yPos, (getposASL _target select 2) + _zPos]; while {!(isNull _round)} do { _ang = (((getposASL _target select 0) - (getposASL _round select 0)) atan2 ((getposASL _target select 1) - (getposASL _round select 1))); _round setDir _ang; _zAdjust = (speed _round) * ((((getPosASL _target select 2) + 1.5) - (getPosASL _round select 2)) / (_round distance _target)); _round setVelocity [velocity _round select 0, velocity _round select 1, _zAdjust]; if ((_round distance _target) < 10) exitWith { _round setVelocity [0,0,0]; {_x setPos (getPos _target)} forEach [_burst,_round]; {_x setDammage 1} forEach [_burst,_target]; {_x setDammage 1} forEach (crew _target); }; sleep 0.01; }; sleep 0.1; deleteVehicle _round; deleteVehicle _burst; NOTE: I do realize there are other snippets and suites available that likely do exactly the same sort of thing, but I am curious and am trying to figure it all out for the sake of learning something new. Much appreciated, - dRb EDIT: It should also be noted that this script does not influence the missile's X or Y velocities simply because I thought it would be easier to "steer" the missile to the target than forcing it to obey a strict route. Â
  22. DrBobcat

    USEC F117A Nighthawk

    While I do not know if this information would be all too helpful to you in correcting the plane's scale, the height of a soldier in ArmA is, to the best of my knowledge, roughly 1.8 meters. Keep up the excellent work! -dRb
  23. DrBobcat

    typeOf in array?

    Correct! Good job! If you have any further questions or issues that arise, do not hesitate to ask. - dRb
  24. DrBobcat

    typeOf in array?

    That is precisely what I was getting at. Strangely, he does not define the "_veh" variable until after its value is checked in a condition statement. Therefore, how could the script check for a particular type of vehicle when the variable being considered has no value at all? In addition, there is no large loop trying to update the private _veh variable, making it impossible for there ever to be a value in the first place. I do not believe a variable needs to be defined unless it lies within a condition statement. Therefore, I do not see why he would need to define the _bas variable prior to the area where it is defined. My small script sample illustrates that point... - dRb EDIT: I felt the need to provide an example... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// Begin _boolVariable = true; if (_boolVariable) then {_stringVariable = "Test"; hint format ["%1",_stringVariable]}; // Even though "_stringVariable" has not been defined prior to this line, it -has- been defined within the statement. Thus, what truly must be defined before hand is "_boolVariable." This should yield no errors and a hint will be displayed in the right hand corner with "Test" as its text. // End EDIT2: Upon a few more tests, I have figured out that the scripting engine believes private variables declared within a conditional statement are only known within their own scope. This means that both Igor and myself were correct. You must define all private variables that are used within the script in the outermost scope or else any private variables defined within conditional statements will have values known only to themselves and your script will not function correctly. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// begin _boolVariable = true; if (_boolVariable) then {_stringVariable = "Test"}; hint format ["%1",_stringVariable]; //Returns a scalar error // end <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// begin _boolVariable = true; _stringVariable = ""; if (_boolVariable) then {_stringVariable = "Test"}; hint format ["%1",_stringVariable]; // Returns a successful "Test" hint // end EDIT3: A quick rehash of the code given by the OP in SQF <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; ["vehicle",crewtype,wpCR,wp1,wp2,wp3,unit_Type] exec "APatrols.sqs"; ; ["AV8B2",1,CREPw2,wp1,wp2,wp3."soldierWpilot"] exec "APatrols.sqs"; _vtyp = _this select 0; _crwt = _this select 1; _wpCR = _this select 2; _wp1 = _this select 3; _wp2 = _this select 4; _wp3 = _this select 5; _wp4 = _this select 6; _unit = _this select 7; _hpt = _this select 8; hintC format ["_vtyp - %1\n_crwt - %2\n_wpCR - %3\n_wp1 - %4\n_wp2 - %5\n_wp3 - %6\n_wp4 - %7\n_unit - %8\n_hpt - %9",_vtyp,_crwt,_wpCR,_wp1,_wp2,_wp3,_wp4,_unit,_hpt]; if ((_crwt != 1) && (_crwt != 2) && (_crwt != 3) && (_crwt != 4)) exitWith {hint "falsche Eingabe fuer crewtype. Ueberpruefe die Dokumentation."}; hintC format ["wpCR - %1\nwt - %2\nhpt - %3\nhigh wpcr - %4\nCreP = %5",_wpCR,_wt,_hpt,getPos _wpCR select 2,_CreP]; waitUntil {_wpCR distance player > 1000}; sleep (2 + random 3); _veh = _vtyp createVehicle getPos _CreP; _veh setDir random 360; _bas = objNull; // Assuming basW or basE return objects if (typeOf _veh in ["AV8B","AV8B2","UH60","UH60MG","A10","AH6","AH1W"]) then {_bas=basW;} else {if (typeOf _veh in ["Mi17","Mi17_MG","KA50","SU34B","SU34"]) then {_bas=basE;};}; _wt = 20; if (typeOf _veh in ["AV8B","AV8B2","SU34","SU34B","A10"]) then {_CreP = _wpCR; _CreP setPos [(getPos _CreP select 0),(getPos _CreP select 1),+4500];} else {_CreP = _hpt; _wt = 30;}; hintC format ["vehicle = %1\ncrewtype = %2\nbasisgroup = %3\nfirst waypoint = %4\ndistance = %5\ncount of crew = %6",_veh,_unit,_bas,_wpCR,_veh distance player,_crwt]; _men1 = _unit; if (_crwt > 1) then {_men2 = _unit}; if (_crwt > 2) then {_men3 = _unit}; if (_crwt > 3) then {_men4 = _unit}; if (_crwt > 4) then {_men5 = _unit}; _men1 createUnit [getPos (leader _bas),_bas,"",0.45,"sergeant"]; _ldr = (units _bas) select 1; [_ldr] join grpNull; _newgroup = group _ldr; sleep 0.25; if (_crwt > 1) then {_men2 createUnit [getPos _ldr,_newgroup,"",0.3,"corporal"]}; if (_crwt > 2) then {_men3 createUnit [getPos _ldr,_newgroup,"",0.28,"corporal"]}; sleep 1; if (_crwt == 1) then {leader _newgroup moveindriver _veh}; if (_crwt == 2) then {leader _newgroup moveindriver _veh; units _newgroup select 1 moveingunner _veh}; if (_crwt == 3) then {leader _newgroup moveindriver _veh; units _newgroup select 1 moveincargo _veh; units _newgroup select 2 moveingunner _veh};
  25. DrBobcat

    typeOf in array?

    This worked for me... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _veh = _this select 0; basW = "Debug string"; if ((typeOf _veh) in ["BMP2","T72"]) then {_bas = basW; hint format ["%1",_bas]}; You need to declare the '_veh' variable before it is used in your condition. Additionally, try using some parentheses and see if that yields you some more positive results. - dRb EDIT: Additionally, you have used the SQS tilde wait style instead of the sleep command used in SQF format functions. That could be causing some serious problems...
×