Jump to content

Search the Community

Showing results for tags 'foreach'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Arma Reforger
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Green Sea
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics
  • CREATEANDGENERATION's Intoduction
  • CREATEANDGENERATION's HAVEN EMPIRE (NEW CREATORS COMMUNITY)
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!
  • empire brotherhood occult +2349082603448's empire money +2349082603448
  • NET88's Twitter
  • Mercurious Brotherhood +2347063372861's +2347063372861>> I WANT TO JOIN OCCULT FOR MONEY RITUAL
  • 123betcasino01's Topics
  • TEORI BERITA's qqsuper99
  • QQSUPER99: Daftar Situs Slot Gacor Online Link Terbaru Gampang Menang's slot gacor
  • QQSUPER99: Daftar Situs Slot Gacor Online Link Terbaru Gampang Menang's slot gacor

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 10 results

  1. Hello, folks. Is there any chance you share a faster or more elegant way to write the same result below? Code goal: at the mission starts, search once all named markers and remove all found markers that aren't area markers (rectangles and ellipses), saving the result in a list for further purposes. Pretty sure even the first code line below could be smarter/complete. // Search through all markers on the map with the prefix "mark_" and append them in a list: _areaMarkersOnly = allMapMarkers select {_x find "mark_" isEqualTo 0}; // result example: ["mark_1", "mark_garbage", "mark_2"] but unfortunately including markers with unwanted shapes. { // forEach in _areaMarkersOnly: // It will be needed to identify what will be deleted later: _index = _areaMarkersOnly find _x; // If the marker (_x) is NOT rectangle and is NOT ellipse, so... if ( (markerShape _x != "RECTANGLE") AND (markerShape _x != "ELLIPSE") ) then { // delete this marker from my list: _areaMarkersOnly deleteAt _index; }; } forEach _areaMarkersOnly; SOLVED! Below, you see the code that works for me after the community advice: _acceptableShapes = ["RECTANGLE", "ELLIPSE"]; _prefix = "mark_"; if ( !_debug ) then { // Selecting only relevant markers: _areaMarkersOnly = allMapMarkers select { (_x find _prefix == 0) AND {(markerShape _x) in _acceptableShapes} }; } else { // For debugging purporses, the way to select the relevant markers here it is slightly different. Now selecting all markers shapes: _areaMarkersOnly = allMapMarkers select { _x find _prefix == 0 }; { // forEach _areaMarkersOnly: // _x index in the list, need it to delete _x from the list: _markerIndex = _areaMarkersOnly find _x; // if the marker has no the shapes acceptables, do it: if ( !((markerShape _x) in _acceptableShapes) ) then { // delete the marker from the list: _possibleMinefields deleteAt _markerIndex; // delete the marker from the map: deleteMarker _x; // and print this messages: systemChat format ["DEBUG > Marker '%1' has NO a rectangle or ellipse shape to be considered a area marker.", _x]; }; } forEach _areaMarkersOnly; };
  2. Pretty sure I'm stepping through a basic question but, really, I've TRIED hard all this afternoon to find out on my own how to make the forEach understand the array content are trigger variable names already dropped in place via Eden Editor. myTriggersVarNames = [ "myTrg1", "myTrg2", "myTrg3" ]; while {true} do { // Doesn't work: { if (player inArea _x) then { systemChat "Player inside the trigger"; }; } forEach myTriggersVarNames; // Working fine: /* if (player inArea myTrg1) then { systemChat "Player inside the trigger" }; */ sleep 3; }
  3. I need some help: my code is stuck in my own (low) understanding around array and forEach when they need/should work together. Below, may you kindly point out the mistakes and show the fixes? I already read a lot of BIS wiki looking for how to code forEach inside forEach, even it doesn't look so clever, feeling... private _drivers = [driver01, driver02, driver03]; private _cars = [car01, car02, car03]; While {true} do { // DRIVERS { // forEach _drivers start... if (alive _x) then // if the driver is alive, so... { if ((_x distance _targetMarker) <= 30) then // DONT KNOW BUT IM NOT SURE THIS IS RIGHT. ISN't IT? { if (lifeState _x == "HEALTHY") then // if the driver is healthy, so... { _x directSay _sound1; // the driver screams. if (!isNull objectParent _x) then // if the driver is onboard a vehicle, so... { hint "driver has a veh"; // show text on screen. }; }; }; }; } forEach _drivers; // repeat that for each driver. // CARS { // forEach _cars start... if (alive _x) then // if the cars alive, then... { if ((_targetMarker distance _x) <= 30) then // DONT KNOW BUT IM NOT SURE THIS IS RIGHT. ISN't IT? { <HERE EACH DRIVER> directSay _sound2; // I DONT KNOW HOW TO CALL ANOTHER ARRAY+FOREACH HERE. sleep 0.3; _something createVehicle getPos _x; // DONT KNOW BUT IM NOT SURE THIS IS RIGHT. ISN't IT? }; if ((damage _x) >= 0.1) then // if the car get damage, then... { hint "car got damage!"; // show the text on screen. }; }; } forEach _cars; // repeat that for each car. sleep 1; // a looping breath. }; // while next looping.
  4. well, i'm trying to create a ww2 scenery with parachute jump. And for that I'm using the IFA3_LIB mod. The C-47s from there have the normal sitting position and also the standing up position which is when you are about to jump. I wanted to make the player not have to worry about clicking anything when jumping, so I got this script so that the jump could be done alone: Now an important detail, this script works perfectly when the plane's crew is seated (in game they appear as: crew) But before the jump takes place/the above script runs, I put in another script that makes the entire crew that was seated to stand up, and therefore be in the standing up position. In this case, when the plane reaches the trigger with the jump script, everyone standing inside the plane is still inside the plane... :l I believe maybe that's why: since when they are standing they are apparently no longer considered "crew". But I don't know, I don't know much about scripts, I was wondering if there is another variety to use in forEach other than "crew" that works for this case... An example of all units jumping out of the plane except the pilot would work but I don't know how to do it. Challenge launched! xD Thanks in advance guys!
  5. This topic is solved. Clear courses by reaching the next marker. If you're looking for the module it's available here: Drive Link This is the test rig in the demo. Adding new marks and whole new courses is easy. From here on is the original topic, I need to learn how to count. I posted this the other day, with a plea to understand why it works when, in my estimation, it shouldn't really. Regardless. I set about to simplify ring counting. I don't like having one .sqf file for each ring course. I feel like 1 or 2 scripts should be able to do this. One file if somebody helps me to learn how to count. Two if this works: Determine which course and define ring marks with generic titles, ringCOURSE.sqf-- this example shows 2 courses with 3 rings each if (ringCHALL==1) then { ring1=ringMARK1_1; ring2=ringMARK1_2; //first course second mark ring3=ringMARK1_3; rings= []execVM "ringCLEAR.sqf"; }; if (ringCHALL==2) then { ring1=ringMARK2_1; ring2=ringMARK2_2; //second course second mark ring3=ringMARK2_3; rings= []execVM "ringCLEAR.sqf"; }; and then build a switchdo case for each ring, or a waitUntil loop, or... I don't know and that's the question. Keep in mind there is only one ring with one trigger attached to drive the ring clearing script(s). This is what it needs to do, ["task1",[currentRING,true]] call BIS_fnc_taskSetDestination; ringGOAL_1 setpos (getpos currentRING); The real trick in this is how to go from: ring1, ring2, ring3, to set the variable "currentRING" in sequence. Oh, boy! I hope that makes sense!
  6. I have recently encountered some odd behavior in one of my scripts. I thought I had a pretty good grasp of this command but it has stopped behaving in the usual way. consider the following: {_x setUnitPos "UP"}forEach units group squad1; In the past and indeed up until a few minutes ago in my script, this yielded the expected behaviour of each member of squad 1 standing up. Then I got a typerror . Type group, expected object. So then I removed the word group from the command: {_x setUnitPos"UP"}forEach units squad1; And NOW it works again. Does anyone know what is going on with this? Thanks for the help.
  7. I am making a scenario where I need to have all the groups on the EAST side to change their behaviour. I tried to use foreach on multiple different ways but nothing seems to work. This is what I tried: { if (side _x == EAST) then { _x allowFleeing 0; _x setCombatMode "RED"; }; } forEach allgroups; { if (side _x == EAST) then { group _x allowFleeing 0; group _x setCombatMode "RED"; }; } forEach allUnits; Can someone help me? Thanks
  8. Hello, I'd like to have a protection zone (spawn protection) for both human players and vehicles (empty or not) inside a trigger area. This should work in dedicated server environment. I've tried two slightly different approaches and neither of them work well enough. The most current I'm trying to get to work is one where I placed a trigger for Independent side with the following attributes: Type: None Activation: Independent Activation Type: Present Repetable [Yes] Server Only [No] Condition this On Activation {(player) allowDamage false} forEach playableUnits; hint "Spawn protection enabled"; On Deactiavation {(player) allowDamage true} forEach playableUnits; hint "Spawn protection disabled"; While testing this works quite nicely. Leaving the trigger area on foot makes the player vulnerable to everything that can actually kill the player. But as long as the player stays inside the trigger area he/she will be invulnerable. Pretty basic stuff I guess. But there's a catch: if the player spawns a vehicle inside the trigger area, jumps in the vehicle for a short moment, then jumps out and leaves the trigger area on foot and as long as the vehicle stays inside the trigger area the player will be invulnerable. Why is this happening and how would I go on to fix it? Earlier I was trying to use another approach to this: Type: None Activation: Independent Activation Type: Present Repetable [Yes] Server Only [No] Condition ((vehicle player) in thisList) On Activation {(vehicle player) allowDamage false} Foreach thislist; hint "Spawn protection enabled"; On Deactiavation {(vehicle player) allowDamage true} forEach [allUnits, vehicles]; hint "Spawn protection disabled"; This worked as well as the first one: when the player moves out of the trigger area on foot he/she will become vulnerable. But as with the another approach spawning a vehicle and getting in produces awkward result: now even if the player drives out of the trigger area he will be invulnerable indefinitely. So all in all neither of the two approaches work well enough. Also both of the alternatives don't make vehicles invulnerable at all when situated inside the trigger area. Any pointers how to achieve player and vehicle invulnerability at the same time using a trigger?
  9. Hey guys, I just crawled the wiki for usefull commands and found apply in it. Correct me if Im wrong but I think its doing nearly the same as forEach if u not need that _forEachIndex variable. Is there another difference which i ve not seen and did anybody measure which command is faster?
  10. Hello, Hope all are well. I have run into a problem in a script. In the script the there is a piece that I am working to create some AI defenders for a random task.... For some reason this only runs for the first "_manType". I have not been able to see my mistake. I am sure I am missing something silly. Ideas? Thanks, dubl /***************************************************************** Create defenders ***************************************************************/ { _manType = _x select 0; _manName = _x select 1; _man = _manType createVehicle getMarkerPos "defend1"; if (_manName != "") then { (_man select 0) setVehicleVarName _manName; missionNamespace setVariable [_manName, (_man select 0)]; }; }Foreach[ ["B_soldier_LAT_F", "man1"], ["B_soldier_AR_F", "man2"], ["B_soldier_exp_F", "man3"], ["B_medic_F", "man4"] ];
×