-
Content Count
1304 -
Joined
-
Last visited
-
Medals
Everything posted by twirly
-
script slows down game badly help please
twirly replied to jakkob4682's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm not surprised! It creates triggers over and over as long as the player is alive. Maybe try taking out the while {alive player} do { .....and {sleep .3}; deleteVehicle _trg; That way it will only create one trigger.....which I believe is all you need. -
Eliteness hates me.
twirly replied to Sharpshooter221's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There are different versions of Eliteness and also different versions of DePBO. Don't use it much anymore but I have Eliteness v2.23 and DePBO.dll v1.62 and I think that combination worked well. -
nearestLocation with no name
twirly replied to gc8's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this.... the hint will show you what's on the island/map. _locs = [ nearestLocations [[0, 0, 0], ["NameCityCapital", "NameCity", "NameVillage", "NameLocal"], 100000]]; hint format ["%1",_locs]; On Utes for instance...there are no Capitals or Cities. -
Script to check the status of groups in an array?
twirly replied to orcinus's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Might be as simple as this.... if heligroup_z1 is a list of groups! while {true} do { if (count heligroup_z1 <= 2) then { //do reinforcements or whatever here }; sleep 300; }; -
Using !isNull and isNull as a condition
twirly replied to Asung's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Might be much easier to script it than do it the way you are doing it! Now I'm saying "easier".....but the logic needs to be sorted out.... and at the moment I don't have a very logical brain. ---------- Post added at 12:51 PM ---------- Previous post was at 11:45 AM ---------- After a few coffees it's all clear now. Much simpler than I first thought! :) Create a little script in your mission folder and add this code to it. Here it's called "script.sqf"... but you can give it a more imaginative name. script.sqf... _randnum = floor random 2; switch (_randnum) do { case 0: { deletevehicle P1; deletevehicle P2; deletevehicle P3; }; case 1: { deletevehicle Z1; deletevehicle Z2; deletevehicle Z3; }; }; In your players init put this... nul = [] execVM "script.sqf"; Should be easy enough to follow what's going on. No need for probability of presence... so make sure it's off on all the targets. -
ai move to building position play ( what ever position im at)
twirly replied to quincy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Did some testing and it seems the AI won't go to just any position in the buildings.....only the fixed buildingpos's. It will take quite a bit of scripting to find the nearest viable building position for the AI to go to. This will still not be ideal....as the nearest position might be on the floor above or below. -
Using !isNull and isNull as a condition
twirly replied to Asung's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi...what do you mean by "appears"? .... and are you trying this the very hard way with triggers? -
Hi man...and welcome to the forums. Use say3D for directional sound.
-
ai move to building position play ( what ever position im at)
twirly replied to quincy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can try... _ai [url="http://community.bistudio.com/wiki/doMove"][u]doMove[/u][/url] getpos player; -
Simple Hint on Dedi server !
twirly replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Found a couple things that were not quite right....try this... init.sqf.... if (isNil "MyNetHintSilent") then { MyNetHintSilent = [0,0]; }; "MyNetHintSilent" addPublicVariableEventHandler { private ["_hint","_min","_sec"]; _hint = _this select 1; _min = _hint select 0; _sec = _hint select 1; hintSilent format ["%1:%2",_min,_sec]; }; timer.sqf.... if (!isServer) exitWith {}; private ["_t","_min","_sec"]; _t = (_this select 0) * 60; while {_t > 0 && psholdtimer} do { _min = floor (_t / 60); _sec = floor (_t mod 60); _min = (if (_min <= 9) then {"0"} else {""}) + str _min; _sec = (if (_sec <= 9) then {"0"} else {""}) + str _sec; MyNetHintSilent = [_min,_sec]; //for SP and COOP if (not isDedicated) then { hintSilent format ["%1:%2",_min,_sec]; }; publicVariable "MyNetHintSilent"; _t = _t - 1; sleep 1; }; From my limited testing seems to work everywhere.... SP, Dedi and COOP. EDIT: If you need me to post my little test mission....just scream! -
Using a Trigger to Change the Conditions of another trigger
twirly replied to vonsteimel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Actually... just realised the example I posted changes the onAct and not the condition...lol! But...anyway it still is the right command to change the condition. -
Condition of trigger/waypoint
twirly replied to Nuttex's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I think you might also need a check for non-existence. To test if the units don't exist... use isNull -
Using a Trigger to Change the Conditions of another trigger
twirly replied to vonsteimel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Place two triggers on your map. Set for Anybody Present or whatever. Name the first one Trig1 (not really necessary).... Name the second trigger Trig2. In the first triggers (Trig1) On Act put this code.... Trig2 [url="http://community.bistudio.com/wiki/setTriggerStatements"][u]setTriggerStatements[/u][/url] ["this", "hint 'Hint from Trig2'", ""]; Enter the trigger Trig1.... and Trig2's On Act statement will be set to... Hint "Hint from Trig2"; ...and you will get this hint when you enter Trig2. Hope that helps you. -
Simple Hint on Dedi server !
twirly replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Make your own network command for it using PVEH's.... In your init.sqf.... //************************************************************* //Network hintSilent system PVEH //************************************************************* if (isNil "MyNetHintSilent") then { MyNetHintSilent = 0; }; "MyNetHintSilent" addPublicVariableEventHandler { private ["_hint"]; _hint = _this select 1; hintSilent format ["Time Left: %1 seconds",_hint]; }; Then to use it.... if (isServer) then { for "_i" from 100 to 1 step -1 do { MyNetHintSilent = _i; publicVariable "MyNetHintSilent"; sleep 1; }; }; Works on Dedicated server. This hints silently "Time Left: x seconds" on clients machines. -
How to Make Targets Scroll Side to Side.
twirly replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have not tested....but do you have the Functions module placed on the map? -
Eject seat script for jets without ace mod or ace support(3rd party jets)
twirly replied to mememe12's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... downloaded the file and there are no scripts in the download package just a mission .sqm! -
"Tinted" Effect
twirly replied to WingsOfDeath's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Have a look here mate.... http://forums.bistudio.com/showthread.php?75528 -
Group chasing/hunting the player
twirly replied to Rh1985's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try it like this..... _null = [] spawn { while {true} do {{_x doMove (getPos player)} foreach units Hunters; sleep 5; }; }; -
Spawning Vehicles with addaction at Carrier Height
twirly replied to Stewe231's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No worries man... glad to help. Welcome to the forums. Actually I see you've posted before! My bad! -
Spawning Vehicles with addaction at Carrier Height
twirly replied to Stewe231's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try spawning the vehicle somewhere else and moving it to the marker.... _vec = createVehicle [_type, [0,0,30], [], 0, "NONE"]; _vec setPosASL [(getMarkerPos "Spawn_Aircraft") select 0,(getMarkerPos "Spawn_Aircraft") select 1,18]; EDIT: Just tried it ...it works fine! -
Spawning Vehicles with addaction at Carrier Height
twirly replied to Stewe231's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm assuming the marker "Spawn_Aircraft" is placed at the position of the carrier deck on the map. You need to set the "z" coordinate (height) of the spawn position to be 18. Try this.... _vec = createVehicle [_type, [(getMarkerPos "Spawn_Aircraft") select 0,(getMarkerPos "Spawn_Aircraft") select 1,[b][color="#FF0000"]18[/color][/b]], [], 0, "NONE"]; -
How to make AI attack civilians
twirly replied to _qor's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try putting this in your this in your init.sqf see if it works. Using the setFriend command. EAST setFriend [CIVILIAN, 0]; -
Change a simple waypoint
twirly replied to thetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... did you try 1 for the waypoint instead of 0? This is the waypoint number.... with 0 (zero) being the position of the unit when placed on the map. It's not clear (to me anyway) exactly what you want.... you might have to post some code or try to explain that a little better. [hughesGrp, [color="#FF0000"][b]1[/b][/color]] [url="http://community.bistudio.com/wiki/setWaypointType"][u]setWaypointType[/u][/url] "MOVE"; -
How to make a man run, when I enter the trigger-area?
twirly replied to _qor's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... check out this thread here and download the little demo mission in post #3. See if that helps you out. Might take a little hair pulling to grasp what's going on. It uses Triggers and Global Variables which is pretty much what you need. There's a list of good stuff on this page taken from the Stickies at the top of this forum. There is a link to the Script Commands there. Two essential things for debugging scripts would be having the -showScriptErrors switch placed in your shortcut and the Arma.RPT file EDIT: More... Open other peoples code and fiddle with it.... Get yourself a good text processor that will highlight code in different colours. That way when you look at script you will immediately make out what the commands are in the code. I use TextPad but NotePad+ is also supposed to be good I believe. -
Get direction of target from enemy position
twirly replied to bigshotking's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here's some code for it.... hope it helps you. _x1 = getPos _staticweapon select 0; _y1 = getPos _staticweapon select 1; _x2 = getPos _target select 0; _y2 = getPos _target select 1; _dx = _x2 - _x1; _dy = _y2 - _y1; _direction = (_dx atan2 _dy) mod 360;