-
Content Count
1304 -
Joined
-
Last visited
-
Medals
Everything posted by twirly
-
Samaels Table - small addon made by my 6 year old son
twirly replied to [frl]myke's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Keep up the good work Samael.... excellent! Great stuff Myke! -
Adding and removing objects & Connect message.
twirly replied to ben_sherman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not sure exactly what you are trying to do.... but deleteVehicle is used to delete objects. -
Need help with editing
twirly replied to hellstorm77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Naming a unit when you spawn it through a trigger
twirly replied to clydefrog's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Audible range of default sounds
twirly replied to Harzach's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try leaving out the quotes in the titles lines... so... titles[] = {}; -
Off shore bombardment script?
twirly replied to sixt's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Read this thread man..... http://forums.bistudio.com/showthread.php?142833 -
Need help with editing
twirly replied to hellstorm77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Look at the lines directly above the error and make sure there's nothing wrong there. -
Need help with editing
twirly replied to hellstorm77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
Simple Bomb defusal with keypad
twirly replied to igneous01's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ask in the DayZ forums. -
vehicle spawn init help
twirly replied to xgamer224's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Detect if unit if AI or player controlled?
twirly replied to colej_uk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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]; }; -
How to name vehicle spawned in BIS_fnc_SpawnVehicle ???
twirly replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No worries man... I had a little error with the _heloTroop1 variable... calling it _helogroup in one line! It's been fixed. -
How to name vehicle spawned in BIS_fnc_SpawnVehicle ???
twirly replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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; -
Blah.... bad idea! No point.
-
Need help with Arrays (Also random-related)
twirly replied to MrSanchez's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Creating an object through script
twirly replied to eagledude4's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That should work as long as "il_money_stack_500s" is a recognisable object to the nearestObject command. -
Player Rating script
twirly replied to ALLAN's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Obtaining Object/Vehicle Position (Mainly Height)
twirly replied to Dr3adn0ught35's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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; }; -
Need help with editing
twirly replied to hellstorm77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No...as long as you have enough texts[] to match the values[]. paramsarray select 0 will be the value. -
Obtaining Object/Vehicle Position (Mainly Height)
twirly replied to Dr3adn0ught35's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Hint only for specific units
twirly replied to _qor's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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! -
Obtaining Object/Vehicle Position (Mainly Height)
twirly replied to Dr3adn0ught35's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
faction to class name in found script
twirly replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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"]; -
Interigrate ACE and ACRE and all the ace mods into Arma 2 mission file?
twirly replied to norsk2277's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
Civilian casualty cap parameter
twirly replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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!