Bohemia Interactive Forums  

Go Back   Bohemia Interactive Forums > BI MILITARY GAMES FORUMS > ARMA 2 EDITING > ArmA 2 & OA - MISSION EDITING & SCRIPTING

ArmA 2 & OA - MISSION EDITING & SCRIPTING For discussing the technical aspects of creating custom ArmA 2 & the standalone expansion Operation Arrowhead missions as well as scripting.

Reply
 
Thread Tools Display Modes
Old 03-13-2010, 11:04 PM   #1
{Op4}Bsilenced
Sergeant
 
Join Date: Feb 2010
Posts: 122
remove item from array

because this is a lil over my head on scripting i pulled this from domination
"thanks xeno"

// remove an item at index position in an ArrayList
// parameters: array var as string, index
// example ["_myArrayList1",_index] call XfArrayListRemoveAt;
XfArrayListRemoveAt = {
private ["_ar","_index"];
_ar = _this select 0;_index = _this select 1;
call compile format ["
%1 set [_index, ""YXZ_DEL_Q_X76""];
%1 = %1 - [""YXZ_DEL_Q_X76""];
", _ar];
};

but this doesnt do what i need it to do..

i need to remove a specific item from an array list no matter what the index pos of the array list is because the array list is gonna change more then once.

so example
_myarraylist = ["array1","array2",etc];

if whatever happened during mission remove "array2" so i can recall..

thanks in advance if anyone can help me here..
{Op4}Bsilenced is offline   Reply With Quote
Old 03-13-2010, 11:09 PM   #2
ProfTournesol
Sergeant Major
 
ProfTournesol's Avatar
 
Join Date: Jan 2005
Location: France
Posts: 1,713
Quote:
Originally Posted by {Op4}Bsilenced View Post
because this is a lil over my head on scripting i pulled this from domination
"thanks xeno"

// remove an item at index position in an ArrayList
// parameters: array var as string, index
// example ["_myArrayList1",_index] call XfArrayListRemoveAt;
XfArrayListRemoveAt = {
private ["_ar","_index"];
_ar = _this select 0;_index = _this select 1;
call compile format ["
%1 set [_index, ""YXZ_DEL_Q_X76""];
%1 = %1 - [""YXZ_DEL_Q_X76""];
", _ar];
};

but this doesnt do what i need it to do..

i need to remove a specific item from an array list no matter what the index pos of the array list is because the array list is gonna change more then once.

so example
_myarraylist = ["array1","array2",etc];

if whatever happened during mission remove "array2" so i can recall..

thanks in advance if anyone can help me here..
_myarraylist = _myarraylist - ["array2"];
ProfTournesol is offline   Reply With Quote
Old 03-13-2010, 11:15 PM   #3
{Op4}Bsilenced
Sergeant
 
Join Date: Feb 2010
Posts: 122
i spent the whole day making sure it wasnt something simple lol.
thanks ill go try it
{Op4}Bsilenced is offline   Reply With Quote
Old 03-13-2010, 11:28 PM   #4
SNKMAN
Sergeant Major
 
SNKMAN's Avatar
 
Join Date: Aug 2006
Location: Germany ( Lake Constance )
Posts: 1,460
Check this out: Wiki: Array
__________________
Group Link 4 Special FX Edition v.1.1.87 ( Full )

Group Link 4 Special FX Edition Mission Based Initialize.

Any questions? Feel free to get in contact with me: Skype: SNKMAN

All the greate things of the world only happend becouse someone is doing more then he has to do. ( Hermann Gmeiner )
SNKMAN is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.