Jump to content

Search the Community

Showing results for tags 'string'.



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
    • 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

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 9 results

  1. Back again with another function, Not sure if there are other string replacement routines, but I've quickly put this one together. Source // // PX_fnc_stringReplace :: Replace substrings // Author: Colin J.D. Stewart // Usage: ["xxx is awesome, I love xxx!", "xxx", "Arma"] call PX_fnc_stringReplace; // PX_fnc_stringReplace = { params["_str", "_find", "_replace"]; private _return = ""; private _len = count _find; private _pos = _str find _find; while {(_pos != -1) && (count _str > 0)} do { _return = _return + (_str select [0, _pos]) + _replace; _str = (_str select [_pos+_len]); _pos = _str find _find; }; _return + _str; }; Example: ["xxx is awesome, I love xxx!", "xxx", "Arma"] call PX_fnc_stringReplace; // Output: Arma is awesome, I love Arma! -Colin
  2. I searched for a long while for this before posting. (fairly new to this so keep the snark to a min) I am trying to compare a string against an array: _Wep = "Weapon1; _ArrayWeps = ["Weapon1", "Weapon2", "Weapon3"]; _IsInArray = _Wep in _ArrayWeps; // is _Wep inside the array should give me a boolean for _isInArray of true/false? or do I have to do: if (_Wep in _ArrayWeps) then { // true}; OR if there is a better way to please do share. I do appreciate the input.
  3. A recurring problem that i seem to run into is I don't know how to use group names as group names when writing scripts. Let me explain: In the eden editor, I have set the name of a group; by opening the interface for the group (double click on the icon above group leader) and entering something in the 'callsign' field. However, if I now go to write a script that requires the name of that group, i can't seem to format it in such a way that the command will accept the name I have inputted. For example, here is a snippet from the mission: _group = "R Rustam 1 - Alpha"; _leader = leader _group; _passangers = _group - _leader; _leader assignAsDriver qrf_w1; {_x assignAsCargo qrf_w1} forEach _passangers; _group orderGetIn true; What i can't get to work is the leader command, because no matter how I format the group name it doesn't seem to want to accept it. I believe the following has been tried without success: _group = "R Rustam 1 - Alpha"; _group = "Rustam 1 - Alpha"; _group = R Rustam 1 - Alpha; _group = Rustam 1 - Alpha;
  4. Hi. Is it possible to limit the number of characters in a string variable? For example, let's say I use "typeOf" to get the name of a vehicle. How can I display the first five characters of its name?
  5. Hello everyone, here is a really simple function that I put together: /* Author: Terra Description: Converts the elements of an array into a string Parameter(s): 0: ARRAY - array of elements of any type 1 (Optional): STRING - seperator between elements (default: ", ") Returns: STRING */ params [ ["_array", [],[[123]]], ["_seperator", ", ", ["123"]] ]; _str = format ["%1", _array select 0]; { private _addString = _x; if (typeName _addString != typeName "123") then {_addString = str _addString}; _str = _str +_seperator +_addString; } forEach (_array -[_array select 0]); _str Just some code that I wrote down while working on another project. Feel free to modify and comment.
  6. Hello everyone, I just wanted to share a small function. It can replace certain parts of a string with your own string. /* Author: Terra Description: Substitute a certain part of a string with another string. Parameters: 1: STRING - Source string 2: STRING - Part to edit 3: STRING - Substitution Returns: STRING Example: ["12345 123456", "123", "abc"] call TER_fnc_editString; Returns: "abc45 abc456" */ TER_fnc_editString = { params ["_str", "_toFind", "_subsitution"]; _char = count _toFind; _no = _str find _toFind; while {-1 != _str find _toFind} do { _no = _str find _toFind; _splitStr = _str splitString ""; _splitStr deleteRange [(_no +1), _char -1]; _splitStr set [_no, _subsitution]; _str = _splitStr joinString ""; }; _str }; Additional information:
  7. I'm trying to access an object while only having the object's name in string format. For instance, I have an object Box_East_WpsSpecial_F named "ammoBox_23". There are another 22 ammo boxes, so I need to reference this specific one. How can I do something like hideObjectGlobal or removeMPEventHandler when they expect the format OBJECT hideObjectGlobal BOOLEAN?
  8. Hi all, I am currently developing a system that will select random objectives then assign markers to that area so that it is visible. I have run into an issue with the "SetMarkerPos" command. The error I receive is "Error setmarkerpos: type string, expected Array". The reason it is setup below is due to the fact I have 3 objective types. Town Objectives Primary Objectives Secondary Objectives The script i have created for setting marker positions for Town and Primary objectives is simple as all that is required is that the markers for those are moved to that designated town. However, a secondary objective can only exist inside a primary objective and not all of the primary objectives have a secondary objective. The idea is/was to combine the name of the Primary objective (publicvariable of "mainmark") with secondary_%1 to create the names of the secondary objective markers. I am then able to see if there is a secondary objective nearby to the randomly selected Primary objective and if there is, move the marker to it to indicate such. however I receive the above mentioned error when trying to set the markers position. I was hoping I could receive assistance in fixing this error either via directing me on how to assign the string into an array so the error stops or by finding another way to achieve this goal. Thanks. Below is the script I am using to achieve this goal. null = execVM "obj\objective_controller.sqf"; _distm = getmarkerpos mainmark; _distt = getmarkerpos townmark; _dista = _distm distance _distt; if (_dista < 2200) then { execVM "obj\objective_controller.sqf"; }; if (_dista > 2200) then { _getmarkm = getmarkerpos mainmark; _showobjectivem = "mark_main_area" setMarkerPos _getmarkm; _showobjectivem = "mark_main_name" setMarkerPos _getmarkm; _getmarkt = getmarkerpos townmark; _showobjectivet = "mark_town_area" setMarkerPos _getmarkt; _showobjectivet = "mark_town_name" setMarkerPos _getmarkt; }; //----------------------------------------------------------------------------------------------- //Find secondary nearby _townsec = format ["secondary_%1",mainmark]; _dists = getmarkerpos _townsec; _secfind = _distm distance _dists; if (_secfind < 500) then { hint format ["placing %1 in %2 area", _townsec, mainmark]; _showobjectivesec = "mark_secondary_area" setMarkerPos _townsec; _showobjectivesec = "mark_secondary_name" setMarkerPos _townsec; }; if (_secfind > 500) then { };
  9. Hi all, Have not found a function to change every occurrence of given string in deeply nested array to another string, so made it myself. Hopefully some one will find it usefull ;) Fill free to critic and/or improve, this way everyone wins :) Code will return positive number showing how many times string was replaced, zero if string was not found and -1 if input is wrong. This function WILL modify provided array, if this is not wanted, perform function with copy of array. Function will make CaSE SenSitivE check. Use showcase: myArray = ["BAD","fsgg",0,[0,5,3,"BAD"],"something",[[0,0,5,4,"BAD",["Bad"]]],["ddftest","BAD"],[],[]]; searchString = "BAD"; replaceString = "GOOD"; result = [myArray, searchString, replaceString] call fnc_replaceStringDeep; So here is output result == 4 myArray == ["GOOD","fsgg",0,[0,5,3,"GOOD"],"something",[[0,0,5,4,"GOOD",["Bad"]]],["ddftest","GOOD"],[],[]]
×