Editing Ar Map

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 2: Line 2:
Added by NVSE V4. Returns a "map" or "stringmap" array variable with the specified key::element pairs as its entries.  
Added by NVSE V4. Returns a "map" or "stringmap" array variable with the specified key::element pairs as its entries.  


Up to 20 key::element pairs may be specified during creation, although more can be added using [[Let]] or alternative functions on subsequent lines.
Up to 20 key::element pairs may specified during creation, although more can be added using alternative functions on subsequent lines.


All keys must be of the same type, either numeric (ints and floats can be mixed) or string, which will cause the function to return an array of the type "map" or "stringmap", respectively.
All keys must be of the same type, either int or string, which will cause the function to return an array of the type "map" or "stringmap", respectively.


Array elements may be of any type in any combination. To assign the function return to a variable, the <b>Let .. := ..</b> command must be used, rather than '<b>set .. to ..</b>'.  
Array elements may be of any type in any combination. To assign the function return to a variable, the [[Let]] command must be used, rather than 'set'.  


==Syntax==
==Syntax==
<pre>
<pre>
(array) Ar_Map Key(int/float/string)::Value(multi) ...
(array) Ar_Map Key(int-or-str)::Value(multi) ...
</pre>
</pre>
==Example==
==Example==
Line 42: Line 42:
let aPartners := Ar_Map SunnyREF::EasyPeteREF, VeronicaREF::CraigBooneREF
let aPartners := Ar_Map SunnyREF::EasyPeteREF, VeronicaREF::CraigBooneREF


; FAILURE- you can not use a ref as a key, it must be either a string or number.  
; FAILURE- you can not use a ref as a key, it must be either a string or int.  
; Side note: NVSE4 adds ToNumber and ToString to convert types
; Side note: NVSE4 adds ToNumber and ToString to convert types


let aPartners := Ar_Map "key"::SunnyREF, 45::VeronicaREF
let aPartners := Ar_Map "key"::SunnyREF, 45::VeronicaREF


; FAILURE- all keys must be the same type, either strings or numbers, not a combination of both
; FAILURE- all keys must be the same type, either string or int, not a combination of both


</pre>
</pre>

Please note that all contributions to the Fallout3 GECK Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see GECK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)