Jump to content

twirly

Member
  • Content Count

    1304
  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. Cool mate...glad it's working!
  2. Make HeavyWEST,HeavyEAST etc strings and it will work. HeavyWEST has no value! So your switch statement looks like this..... //select random vehicle based on side switch (_sidetype) do { case [b]"HeavyWEST"[/b]: { _type = _HeavyWest select floor (random count _HeavyWest); }; case [b]"HeavyEAST"[/b]: { _type = _HeavyEast select floor (random count _HeavyEast); }; case [b]"LightWEST"[/b]: { _type = _LightWest select floor (random count _LightWest); }; case [b]"LightEAST"[/b]: { _type = _LightEast select floor (random count _LightEast); }; }; ...and is called with this.... _nul = [West, [b]"HeavyWEST"[/b], getmarkerpos "spawn", getpos player, 20] execVM "helispawn.sqf";
  3. To find how many cargo seats are available you can use emptyPositions. _freePositions = (vehicle player) emptyPositions "cargo";
  4. twirly

    Spawn distance from pos

    Try this mate.... Where:- _veh is the vehicle _ang is the direction you want them to come from. _dis is how far out you want them to start _ang = random 360; //if you want a random direction _dx = sin([b]_ang[/b])*[b]_dis[/b]; _dy = cos[b](_ang[/b])*[b]_dis[/b]; [b]_newpos[/b] = [((getpos [b]_veh[/b]) select 0) + _dx, ((getpos [b]_veh[/b]) select 1) + _dy, 0]; _newpos is your new position [x,y,z]
  5. Hi mate... I guess another one you can try is titleText. titleText ["Show this text", "PLAIN"];
  6. LOL! OK.... I thought you would have already checked the more obvious ones. Good that you got it working.
  7. Two things come to mind that you can try.... enableAttack and disableAI "FSM" (included in one of the latest patches for OA). Hope you get some mileage out of those.
  8. @Katipo66.... here's a quick addition for what you need. As it is here...there's a 40 percent chance you won't respawn. For a 90 percent chance you won't respawn change the 40 to 90. Place the block of code right above the line...._found = false; so it ends up looking like this.... [color="Red"]if ((random 100) < [b]40[/b]) exitWith { sleep 3; titleText ["Bad luck! Rambo has left the building.\nNo more respawns available.","plain down"]; sleep 5; enableEndDialog; };[/color] _found = false; Hope it's what you want Bro...
  9. Here's the code version. In your code they won't spawn at the same marker because each marker is chosen separately! This is not tested but should work. Name the vehicle like this... give it a Global name. [b]myChopper[/b] = createVehicle ["UH60M_EP1",getMarkerPos "marker1",["marker2","marker3","marker4","marker5","marker6"], 0, "NONE"]; Then create the driver anywhere ("marker1") and move him to the chopper's position plus a few metres... You need to create his group as well. _squad = createGroup WEST; _pilot = createUnit ["US_Soldier_Pilot_EP1",getMarkerPos "marker1",_squad]; _pilot setpos [((getpos myChopper) select 0) + 5,((getpos myChopper) select 1) + 5,0]; ....or create the driver anywhere ("marker1") and move him in to the helo.... _squad = createGroup WEST; _pilot = createUnit ["US_Soldier_Pilot_EP1",getMarkerPos "marker1",_squad]; _pilot assignAsDriver [b]myChopper[/b]; _pilot moveInDriver [b]myChopper[/b]; You should be able to refer to myChopper from anywhere. Hope it works...and helps.
  10. twirly

    Damage to objects.

    You can try creating a bomb at at the torpedo's position. _bomb = "Bo_GBU12_LGB" createVehicle getpos mytorpedo; EDIT: Actually you probably can't name the torpedo.... so you might have to place an invisible H or something there under the torpedo in order to get a position easily. That's one way.
  11. @Katipo66.... I updated the scripts and demo in the original poste mate. Or just copy and paste the stuff in the spoiler into your "playerKilled.sqf" It probably does not do exactly what you want.... but you can fiddle with the camera positions and see what you can come up with. It also should be re-written at this stage.....but it works and where it is used (when the player is dead!) it is not critical that it be efficient streamlined code. Also added some true/false variables to control the camera movement... TWIRL_DeathCamMoveToKiller and TWIRL_DeathCamMoveToNewUnit If set to true...camera will do the normal pan between units. If set to false camera will be set instantly to the object and fade from black. I'm sure you'll figure it out.
  12. Glad you like it man. I'll fiddle as soon as I have time and see what I can do to improve the camera movement.
  13. Just found this and it seems to work..... "earthquake.sqf" Switch (_This) do { Case "BIS_Earthquake": { While {Alive Player} Do { Playsound "eq"; _This = Vehicle Player; For "_i" from 0 to 140 do { _vx = vectorup _this select 0; _vy = vectorup _this select 1; _vz = vectorup _this select 2; _coef = 0.01 - ((Random 0.0004) * _i); _This setvectorup [ _vx+(-_coef+random (2*_coef)), _vy+(-_coef+random (2*_coef)), _vz+(-_coef+random (2*_coef)) ]; sleep (0.01 + random 0.01); }; sleep (60 + Random 180); }; }; Default {HintC "Error in Mainfunction";}; }; Execute from a trigger with :- nul = "BIS_Earthquake" execVM "earthquake.sqf"; Just tried it....works fine. I had placed a Function Module as well....not sure if it was needed or not. EDIT: Just realised you will have to make a few changes to get exactly what you need. I just ran the code without really looking at tit properly. The Function Module not necessary.
  14. twirly

    Track Morta Rounds

    For the map grid position try this.... _gridPos = [url="http://community.bistudio.com/wiki/mapGridPosition"]mapGridPosition[/url] getPos player;
  15. Here's a link to thread with a Virtual Sniper script..... might help you also. http://forums.bistudio.com/showthread.php?t=116565
  16. Hi.... Xeno made a mistake there. Execute .sqs with exec and .sqf with execVM. Not the other way around. ---------- Post added at 08:59 PM ---------- Previous post was at 08:58 PM ---------- EDIT: pinched at the post!
  17. I forgot I had links top and bottom of the post. Thanks for heads up. All links should work now. Hope so! :)
  18. Here's another way guys.... two scripts. No need for an EventHandler. This second script also adds a camera view of who shot you as well as a Titletext with the name and distance. onPlayerKilled.sqf (if it exists in your mission folder) gets executed when a player dies...so.... onPlayerKilled.sqf:- private ["_plyr","_kilr"]; _plyr = _this select 0; _kilr = _this select 1; //If you want to respawn at a marker as a new player...call the script like this... //nul = [_plyr,_kilr,"wrespawn0"] execVM "playerKilled.sqf"; //If you want to respawn as a playable AI...call the script like this... nul = [_plyr,_kilr] execVM "playerKilled.sqf"; This executes my script "playerKilled.sqf" which is in the same folder. playerKilled.sqf:- /* A script for SP Respawn. Twirly. July 2011. */ private ["_plyr","_kilr","_mrkr","_type","_group","_dist","_camera","_found","_unit"]; _plyr = _this select 0; _kilr = _this select 1; _mrkr = if (count _this >2) then {_this select 2}; //grab some stuff we need later _type = typeOf _plyr; _group = group _plyr; _dist = _plyr distance _kilr; //camera initialisation _camera = "camera" camCreate getpos _plyr; _camera cameraEffect ["internal","back"]; //camera look at player _camera camSetTarget vehicle _plyr; _camera camSetRelPos [0.2,0.4,2]; _camera camSetFOV 0.143; _camera camCommit 0; waituntil {(camCommitted _camera)}; //camera zooms out over 5 seconds _camera camSetRelPos [0,8,3.5]; _camera camSetFOV 0.7; _camera camCommit 5; waituntil {(camCommitted _camera)}; if (not (isNull _kilr)) then { titleText [format ["Player killed by %1 at %2m",name _kilr,round _dist],"plain down"]; } else { titleText ["Player killed by UNKNOWN","plain down"]; }; //hide and delete the body hideBody _plyr; sleep 3; deleteVehicle _plyr; //check if killer exists.... skip if killed by artillery, bomb, unknown etc... if (not (isNull _kilr)) then { //camera move to killer _camera camSetTarget vehicle _kilr; _camera camSetRelPos [2,5,2]; if (_dist > 500) then {_camera camCommit 10} else {_camera camCommit 5}; waituntil {(camCommitted _camera)}; }; _found = false; if (count _this > 2) then { //create the new unit.... same group _unit = _group createUnit [_type, (getMarkerPos _mrkr), [], 0, "NONE"]; addSwitchableUnit _unit; selectPlayer _unit; waitUntil {_unit == player}; _found = true; } else { //try to find a random playable unit while {(not (_found)) and ((count switchableunits) >=1)} do { _unit = switchableunits select (floor (random (count switchableunits))); if (alive _unit) then { _found = true; selectplayer _unit; }; sleep 1; }; }; //if no available units for respawn then end game if (not _found) exitWith { titleText ["No units available for respawn!","plain down"]; sleep 2; enableEndDialog; }; sleep 3; //check if killer exists.... skip if killed by artillery, bomb, unknown etc... if (not (isNull _kilr)) then { //camera move to new dude _camera camSetTarget vehicle _unit; _camera camSetRelPos [2,5,2]; if (_kilr distance _unit > 500) then {_camera camCommit 10} else {_camera camCommit 5}; waituntil {(camCommitted _camera)}; }; sleep 2; //quick fade-in on internal point of view of the next unit _camera camSetTarget _unit; vehicle _unit switchCamera "INTERNAL"; _unit cameraEffect ["terminate","back"]; //fade from black 3 seconds titlecut [" ","black in",3]; camDestroy _camera; //run any initialization scripts for the player here //nul = [] execVM "blahblahblah.sqf"; Demo mission is here. Hack and chop as you see fit.
  19. Thanks a lot mate.... I eventually did get it.... but that will be better for others. Thanks again.
  20. Hi... would like to download the script but nothing I click on works. Don't read Russian!!! EDIT: AHHH...Got it finally. Thanks for the work.
  21. Try it like this... unitname [url="http://community.bistudio.com/wiki/doMove"]domove[/url] (getpos hostage);
  22. I think you have your waypoint stuff wrong. _wp setWaypointType "SAD"; should be:- [_spawngroup,1] setWaypointType "SAD"; There might be other errors but that stuck out. Scripting_Commands EDIT: You should try to use the code tags when posting code.... otherwise it is too hard to read.
  23. twirly

    Ikar's F-14 Tomcat v1.6

    Cool...thanks. Will stick to the other one I have that works. Thanks again.
  24. twirly

    Ikar's F-14 Tomcat v1.6

    Just to report my experience when I tried this (v 1.6) with plain old Arma 2 (no OA). Tried with several mods loaded and got an instant CTD when I spawned an F-14. Too many mods to list! Other mods work fine together. Then I tried it in vanilla Arma 2 with no other mods (only extended_eventhandlers in folder)... and get this when loading editor. No entry 'bin\config.bin/CfgWeapons.CMFlareLauncher' ...and a whole bunch of other "No entry" errors in the .rpt file. So I'm wondering if is intended to work with vanilla Arma 2?
  25. You can do something like this. If you don't supply the second paramater to the script it will default to 0. _bomb = _this select 0; _remove = if (count _this >1) then {_this select 1} else {0};
×