Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. Keep up the good work Samael.... excellent! Great stuff Myke!
  2. Not sure exactly what you are trying to do.... but deleteVehicle is used to delete objects.
  3. It works perfectly.... how are you doing your testing?. You are probably getting an error because you are testing in the editor. Paramsarray does not work in Single Player. Save it as a multiplayer mission and test in COOP. It will work. Demo .pbo here. Put it in your MPMissions folder and start a COOP game with it.
  4. I placed a marker, a trigger and a unit with this in his init.. groupalpha = group this; and used that line in the trigger and everything worked fine. Check everything again... it's something simple.
  5. Try leaving out the quotes in the titles lines... so... titles[] = {};
  6. Read this thread man..... http://forums.bistudio.com/showthread.php?142833
  7. Look at the lines directly above the error and make sure there's nothing wrong there.
  8. What's the error? It looks OK....don't see anything wrong really. Maybe brackets around paramsArray select 0 but don't think it's necessary. But if all else fails... try everything you didn't try! Just to check... the Class params statements needs to be in your description.ext... and put the setDate in your init.sqf
  9. That looks like lines from the mission .sqm! Don't mess with that file.... there is rarely a need to ever open it. Read up on this command... http://community.bistudio.com/wiki/setVehicleInit ...or better yet read Mr Murrays Editing Guide and learn the basics.
  10. Also... check out... playableunits (for multiplayer) switchableunits (for singleplayer) I've been using something like this that works in both SP and MP. _controllableAI = []; _controllableAI = [] call { _array = []; if (isMultiplayer) then { _array = playableunits; } else { _array = switchableunits; }; _array }; //more code here for whatever... //blah... //blah... //blah... if (_unit in _controllableAI) then { hint format ["%1 is playable",_unit]; } else { hint format ["%1 is not playable",_unit]; };
  11. No worries man... I had a little error with the _heloTroop1 variable... calling it _helogroup in one line! It's been fixed.
  12. Try it like this....no need for setvehiclevarname! ... also don't use "_x" in a for statement it's reserved for the foreach statement. Use "_i", "_j", "_k" etc. instead (standard programming practice). //create the helo _testHelo1 = [getMarkerPos "mrk_WPtest0", 10, "LIN_UH1", west] call bis_fnc_spawnvehicle; Helo98 = _testHelo1 select 0; //move each group member into Helo for "_i" from 0 to (count units _heloTroop1)-1 do { _unit = (units _heloTroop1) select _i; _unit assignasCargo Helo98; _unit moveInCargo Helo98; sleep 0.2; }; ... another way of moving in the troops using foreach... {_x assignascargo Helo98; _x moveincargo Helo98} foreach units _heloTroop1;
  13. twirly

    SQF Encryptor

    Blah.... bad idea! No point.
  14. Something like this using "weighted arrays".... the last number in the array is the actual weight. _rifles = [ ["MR43","2Rnd_shotgun_74Slug",0.01], ["Winchester1866","15Rnd_W1866_Slug",0.01], ["LeeEnfield","10x_303",0.01], ["huntingrifle","5x_22_LR_17_HMR",0.05], ["FN_FAL","20Rnd_762x51_FNFAL",0.10] ]; Then.... _weighted = []; //rifles for "_i" from 0 to (count _rifles)-1 do { _weight = (_rifles select _i) select 2; _weight = round(_weight * 100); for "_j" from 0 to (_weight - 1) do { _weighted set [count _weights,_j]; }; sleep 0.003; }; _randrec = _weighted select floor (random (count _weighted)); _rifle = (_rifles select _randrec) select 0; _ammo = (_rifles select _randrec) select 1; This is similar to how it's done in DayZ...except there it's a function. Here it's part of the script. It creates huge arrays of numbers....but works. I have a better way.... just haven't written the code as yet.
  15. That should work as long as "il_money_stack_500s" is a recognisable object to the nearestObject command.
  16. http://community.bistudio.com/wiki/abs How far a number is from zero basically..... so abs (-9) = 9 and abs(9) = 9 also. Can use it to convert a negative number to a positive number.
  17. This should work....shortened it a bit. Took out lines you don't need like getting the x and y coords. That was just to show you how to get all the individual coordinates from a position array. I'm pretty sure you'll follow it based on the stuff above. _unit = _this select 0; _rate = _this select 1; _oldz = (getposATL _unit) select 2; while {(alive _unit) and (fuel _unit > 0)} do { _zcoord = (getposATL _unit) select 2; //z coordinate ATL or height ATL if (isengineon _unit) then { if (_zcoord > _oldz) then { _rate = _rate * 2.25; _unit setFuel ( Fuel _unit -_rate); [color="#FF0000"] _oldz = _zcoord;[/color] } else { _unit setFuel ( Fuel _unit -_rate); }; }; sleep 1; };
  18. No...as long as you have enough texts[] to match the values[]. paramsarray select 0 will be the value.
  19. In order to debug.... do you have -showcripterrors in your games shortcut? Also look at using hint or hintsilent to see your variable values.... or diag_log to log those values to the .rpt file? Using one or all of those little tools will help you find the errors. Get accustomed to using them from now.
  20. My 2 cents... There's a lot of sense in making your own. Because you can tailor it to your specific needs it will be way more efficient than using a generic built in routine!
  21. Hi mate... welcome to the forum. You would use getposATL... the ATL stands for Above Terrain Level. _pos = getposATL _vehicle; //returns a coordinate array [x,y,z]; _xcoord = _pos select 0; //x coordinate _ycoord = _pos select 1; //y coordinate _zcoord = _pos select 2; //z coordinate ATL or height ATL
  22. There might be more problems but something really stands out there mate.... classnames are strings so you need quotes. _units = ["USMC_SoldierS_Engineer", "US_Soldier_Engineer_EP1","BAF_Soldier_EN_W", "BAF_Soldier_EN_DDPM","BAF_Soldier_EN_MTP,Soldier_Engineer_PMC","CDF_Soldier_Engineer"];
  23. Well said... that's my feelings on a lot of these questions. You'll only get out of it what you put into it.... it's that simple.
  24. If you put something like this in the fnc_countCivDeaths part...then you can add the killer to the DeadCivilians variable (make it an array) and have the hint display both the dead civilian count and the last person to kill a civilian. _deatharray =_this select 0; //array passed from the killed eh _victim = _deatharray select 0; //victim _killer = _deatharray select 1; //killer ....or you can add another "killed" eventhandler to the Civilians that runs another script or calls another entirely different function that does something else. The main thing is knowing that the victim and killer are passed when the "killed" EH is fired. ---------- Post added at 05:24 PM ---------- Previous post was at 05:19 PM ---------- I hope I didn't totally confuse you!